mirror of https://github.com/Ombi-app/Ombi
parent
d6f3f7b750
commit
07beddc26a
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="AutoFixture" version="3.40.0" targetFramework="net452" />
|
||||
<package id="Moq" version="4.2.1510.2205" targetFramework="net452" />
|
||||
<package id="NUnit" version="3.0.1" targetFramework="net452" />
|
||||
</packages>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="AutoFixture" version="3.40.0" targetFramework="net452" />
|
||||
<package id="Moq" version="4.2.1510.2205" targetFramework="net452" />
|
||||
<package id="NUnit" version="3.0.1" targetFramework="net452" />
|
||||
</packages>
|
@ -0,0 +1,157 @@
|
||||
@Html.Partial("/Admin/_Sidebar")
|
||||
|
||||
<div class="col-sm-8">
|
||||
<form class="form-horizontal" method="POST" action="/admin/SaveAuthentication" id="mainForm">
|
||||
<fieldset>
|
||||
<legend>Authentication Settings</legend>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="userAuth" class="col-lg-2 control-label">Enable User Authentication</label>
|
||||
<div class="col-lg-4 checkbox">
|
||||
<label>
|
||||
@if (Model.UserAuthentication)
|
||||
{
|
||||
<input type="checkbox" id="userAuth" name="UserAuthentication" checked="checked">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="userAuth" name="UserAuthentication">
|
||||
}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="userAuth" class="col-lg-2 control-label">Require users to login with their passwords</label>
|
||||
<div class="col-lg-4 checkbox">
|
||||
<label>
|
||||
@if (Model.UsePassword)
|
||||
{
|
||||
<input type="checkbox" id="UsePassword" name="UsePassword" checked="checked">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" id="UsePassword" name="UsePassword">
|
||||
}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="authToken" class="col-lg-2 control-label">Plex Authorization Token</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" id="authToken" name="PlexAuthToken" placeholder="Plex Auth Token" value="@Model.PlexAuthToken">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="username" class="col-lg-2 control-label">Username and Password</label>
|
||||
<div class="col-lg-4">
|
||||
<input type="text" class="form-control" id="username" name="Username" placeholder="Username">
|
||||
</div>
|
||||
<div class="col-lg-4 col-lg-push-1">
|
||||
<input type="password" class="form-control" id="password" name="Password" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-10 col-lg-offset-2">
|
||||
<button id="requestToken" class="btn btn-primary">Request Token <i class="fa fa-key"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<small class="col-lg-offset-2">Current users that are allowed to authenticate: </small>
|
||||
<br />
|
||||
<br />
|
||||
<div class="form-group">
|
||||
<select id="users" multiple="" class="col-lg-10 col-lg-offset-2"></select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<br />
|
||||
<br />
|
||||
<div class="col-lg-10 col-lg-offset-2">
|
||||
<button id="refreshUsers" class="btn btn-primary">Refresh Users</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-10 col-lg-offset-2">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
if ($('#PlexAuthToken')) {
|
||||
loadUserList();
|
||||
}
|
||||
|
||||
$('#refreshUsers').click(function () {
|
||||
e.preventDefault();
|
||||
loadUserList();
|
||||
});
|
||||
|
||||
$('#requestToken').click(function (e) {
|
||||
e.preventDefault();
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: "requestauth",
|
||||
data: $form.serialize(),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
generateNotify("Success!", "success");
|
||||
$('#authToken').val(response.authToken);
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
function loadUserList() {
|
||||
$.ajax({
|
||||
type: "Get",
|
||||
url: "getusers",
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.length > 1) {
|
||||
$(response).each(function(user) {
|
||||
$('#users').append("<option>" + this + "</option>");
|
||||
});
|
||||
} else {
|
||||
$('#users').append("<option>No Users!</option>");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
</script>
|
Loading…
Reference in new issue