You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/Ombi.UI/Views/Admin/Authentication.cshtml

83 lines
3.0 KiB

8 years ago
@using Ombi.UI.Helpers
8 years ago
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.AuthenticationSettings>
@Html.Partial("Shared/Partial/_Sidebar")
@{
var baseUrl = Html.GetBaseUrl();
var formAction = "/admin/authentication";
8 years ago
var usermanagement = "/usermanagement";
if (!string.IsNullOrEmpty(baseUrl.ToHtmlString()))
{
formAction = "/" + baseUrl.ToHtmlString() + formAction;
8 years ago
usermanagement = "/" + baseUrl.ToHtmlString() + usermanagement;
}
8 years ago
}
<div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" action="@formAction" id="mainForm">
<fieldset>
<legend>Authentication Settings</legend>
8 years ago
@Html.Checkbox(Model.UserAuthentication, "UserAuthentication", "Enable User Authentication", "If enabled we will check the login name against a user in your local users list or Plex/Emby users.")
@Html.Checkbox(Model.UsePassword, "UsePassword", "Require users to login with their passwords", "If enabled, users must provide a valid password to log into Ombi")
<br />
8 years ago
<a href="@usermanagement" class="btn btn-info-outline">User Management</a>
<br />
8 years ago
<br />
8 years ago
<p class="form-group">A comma separated list of users that you do not want to login.
@Html.ToolTip("This is a 'blacklist', if you have users that you do not want to log in, enter them here!")</p>
<div class="form-group">
<label for="DeniedUsers" class="control-label">Denied Users</label>
<div >
<input type="text" class="form-control-custom form-control " id="DeniedUsers" name="DeniedUsers" placeholder="e.g. John, Bobby" value="@Model.DeniedUsers">
</div>
</div>
<br/>
<div>
</div>
<div class="form-group">
<div>
<button type="submit" class="btn btn-primary-outline">Submit</button>
</div>
</div>
</fieldset>
</form>
</div>
<script>
$(function () {
var base = '@Html.GetBaseUrl()';
8 years ago
$('.customTooltip').tooltipster({
contentCloning: true
});
changeDisabledStatus($('#UsePassword'), @Model.UserAuthentication.ToString().ToLower(), $('#passLabel'));
$('#mainForm').on('click', '#userAuth', function () {
var checked = this.checked;
changeDisabledStatus($('#UsePassword'), checked, $('#passLabel'));
});
function changeDisabledStatus($element, checked, $label) {
if (checked) {
$element.removeAttr("disabled");
$label.css("color", "");
} else {
$('#UsePassword').prop('checked', false);
$element.attr("disabled", "disabled");
$label.css("color", "grey");
}
}
});
</script>