mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Finished the auth stuff
This commit is contained in:
parent
0e99dc29c9
commit
0cfb6c8b1e
5 changed files with 103 additions and 76 deletions
|
@ -1,6 +1,9 @@
|
||||||
.form-control-custom {
|
.form-control-custom {
|
||||||
background-color: #333333 !important; }
|
background-color: #333333 !important; }
|
||||||
|
|
||||||
|
.form-control-custom-disabled {
|
||||||
|
background-color: #252424 !important; }
|
||||||
|
|
||||||
.nav-tabs > li.active > a,
|
.nav-tabs > li.active > a,
|
||||||
.nav-tabs > li.active > a:hover,
|
.nav-tabs > li.active > a:hover,
|
||||||
.nav-tabs > li.active > a:focus {
|
.nav-tabs > li.active > a:focus {
|
||||||
|
|
2
PlexRequests.UI/Content/Themes/plex.min.css
vendored
2
PlexRequests.UI/Content/Themes/plex.min.css
vendored
|
@ -1 +1 @@
|
||||||
.form-control-custom{background-color:#333 !important;}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{background:#df691a;}.scroll-top-wrapper{background-color:#333;}.scroll-top-wrapper:hover{background-color:#df691a;}body{font-family:Open Sans Regular,Helvetica Neue,Helvetica,Arial,sans-serif;color:#eee;background-color:#1f1f1f;}.table-striped>tbody>tr:nth-of-type(odd){background-color:#333;}.table-hover>tbody>tr:hover{background-color:#282828;}fieldset{padding:15px;}legend{border-bottom:1px solid #333;}.form-control{color:#fefefe;background-color:#333;}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{margin-left:-0;}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:-15px;}.dropdown-menu{background-color:#282828;}.dropdown-menu .divider{background-color:#333;}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-color:#333;}.input-group-addon{background-color:#333;}.nav>li>a:hover,.nav>li>a:focus{background-color:#df691a;}.nav-tabs>li>a:hover{border-color:#df691a #df691a transparent;}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{background-color:#df691a;border:1px solid #df691a;}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #df691a;}.navbar-default{background-color:#0a0a0a;}.navbar-default .navbar-brand{color:#df691a;}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#f0ad4e;background-color:#282828;}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{background-color:#282828;}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#df691a;color:#fff;}.pagination>li>a,.pagination>li>span{background-color:#282828;}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{background-color:#333;}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#fefefe;background-color:#333;}.list-group-item{background-color:#282828;}a.list-group-item:hover,button.list-group-item:hover,a.list-group-item:focus,button.list-group-item:focus{background-color:#333;}.input-addon,.input-group-addon{color:#df691a;}.modal-header,.modal-footer{background-color:#282828;}.modal-content{position:relative;background-color:#282828;border:1px solid transparent;border-radius:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;outline:0;}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:300;color:#ebebeb;line-height:1;vertical-align:middle;white-space:nowrap;text-align:center;background-color:#333;border-radius:10px;}.bootstrap-datetimepicker-widget.dropdown-menu{background-color:#333;}.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after{border-bottom:6px solid #333 !important;}
|
.form-control-custom{background-color:#333 !important;}.form-control-custom-disabled{background-color:#252424 !important;}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{background:#df691a;}.scroll-top-wrapper{background-color:#333;}.scroll-top-wrapper:hover{background-color:#df691a;}body{font-family:Open Sans Regular,Helvetica Neue,Helvetica,Arial,sans-serif;color:#eee;background-color:#1f1f1f;}.table-striped>tbody>tr:nth-of-type(odd){background-color:#333;}.table-hover>tbody>tr:hover{background-color:#282828;}fieldset{padding:15px;}legend{border-bottom:1px solid #333;}.form-control{color:#fefefe;background-color:#333;}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{margin-left:-0;}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:-15px;}.dropdown-menu{background-color:#282828;}.dropdown-menu .divider{background-color:#333;}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-color:#333;}.input-group-addon{background-color:#333;}.nav>li>a:hover,.nav>li>a:focus{background-color:#df691a;}.nav-tabs>li>a:hover{border-color:#df691a #df691a transparent;}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{background-color:#df691a;border:1px solid #df691a;}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #df691a;}.navbar-default{background-color:#0a0a0a;}.navbar-default .navbar-brand{color:#df691a;}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#f0ad4e;background-color:#282828;}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{background-color:#282828;}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#df691a;color:#fff;}.pagination>li>a,.pagination>li>span{background-color:#282828;}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{background-color:#333;}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#fefefe;background-color:#333;}.list-group-item{background-color:#282828;}a.list-group-item:hover,button.list-group-item:hover,a.list-group-item:focus,button.list-group-item:focus{background-color:#333;}.input-addon,.input-group-addon{color:#df691a;}.modal-header,.modal-footer{background-color:#282828;}.modal-content{position:relative;background-color:#282828;border:1px solid transparent;border-radius:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;outline:0;}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:300;color:#ebebeb;line-height:1;vertical-align:middle;white-space:nowrap;text-align:center;background-color:#333;border-radius:10px;}.bootstrap-datetimepicker-widget.dropdown-menu{background-color:#333;}.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after{border-bottom:6px solid #333 !important;}
|
|
@ -1,12 +1,17 @@
|
||||||
$primary-colour: #df691a;
|
$primary-colour: #df691a;
|
||||||
$primary-colour-outline: #ff761b;
|
$primary-colour-outline: #ff761b;
|
||||||
$bg-colour: #333333;
|
$bg-colour: #333333;
|
||||||
|
$bg-colour-disabled: #252424;
|
||||||
$i: !important;
|
$i: !important;
|
||||||
|
|
||||||
.form-control-custom {
|
.form-control-custom {
|
||||||
background-color: $bg-colour $i;
|
background-color: $bg-colour $i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-control-custom-disabled {
|
||||||
|
background-color: $bg-colour-disabled $i;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-tabs > li.active > a,
|
.nav-tabs > li.active > a,
|
||||||
.nav-tabs > li.active > a:hover,
|
.nav-tabs > li.active > a:hover,
|
||||||
.nav-tabs > li.active > a:focus {
|
.nav-tabs > li.active > a:focus {
|
||||||
|
|
|
@ -512,6 +512,13 @@ namespace PlexRequests.UI.Modules
|
||||||
{
|
{
|
||||||
return Response.AsJson(valid.SendJsonError());
|
return Response.AsJson(valid.SendJsonError());
|
||||||
}
|
}
|
||||||
|
if (settings.Authentication)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(settings.EmailUsername) || string.IsNullOrEmpty(settings.EmailPassword))
|
||||||
|
{
|
||||||
|
return Response.AsJson(new JsonResponseModel {Result = false, Message = "SMTP Authentication is enabled, please specify a username and password"});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var result = EmailService.SaveSettings(settings);
|
var result = EmailService.SaveSettings(settings);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
<form class="form-horizontal" method="POST" id="mainForm">
|
<form class="form-horizontal" method="POST" id="mainForm">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Email Notifications</legend>
|
<legend>Email Notifications</legend>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
|
||||||
|
@ -33,35 +32,35 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
|
||||||
@if (Model.EnableUserEmailNotifications)
|
@if (Model.EnableUserEmailNotifications)
|
||||||
{
|
{
|
||||||
<input type="checkbox" id="EnableUserEmailNotifications" name="EnableUserEmailNotifications" checked="checked"><label for="EnableUserEmailNotifications">Enable user email notifications</label>
|
<input type="checkbox" id="EnableUserEmailNotifications" name="EnableUserEmailNotifications" checked="checked"><label for="EnableUserEmailNotifications">Enable user email notifications</label>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<input type="checkbox" id="EnableUserEmailNotifications" name="EnableUserEmailNotifications"><label for="EnableUserEmailNotifications">Enable user email notifications</label>
|
<input type="checkbox" id="EnableUserEmailNotifications" name="EnableUserEmailNotifications"><label for="EnableUserEmailNotifications">Enable user email notifications</label>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<div class="checkbox">
|
||||||
<div class="checkbox">
|
|
||||||
|
|
||||||
@if (Model.Authentication)
|
@if (Model.Authentication)
|
||||||
{
|
{
|
||||||
<input type="checkbox" id="Authentication" name="Authentication" checked="checked"><label for="Authentication">Enable SMTP Authentication</label>
|
<input type="checkbox" id="Authentication" name="Authentication" checked="checked"><label for="Authentication">Enable SMTP Authentication</label>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<input type="checkbox" id="Authentication" name="Authentication"><label for="Authentication">Enable SMTP Authentication</label>
|
<input type="checkbox" id="Authentication" name="Authentication"><label for="Authentication">Enable SMTP Authentication</label>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<small>Please note that if user notifications is enabled, the email will get sent with the SMTP set-up below.</small>
|
||||||
<small>Please note that if user notifications is enabled, the email will get sent with the SMTP set-up below.</small>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="EmailHost" class="control-label">SMTP Host name or IP</label>
|
<label for="EmailHost" class="control-label">SMTP Host name or IP</label>
|
||||||
<div class="">
|
<div class="">
|
||||||
|
@ -107,37 +106,37 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* <!--Accordion Item-->
|
@* <!--Accordion Item-->
|
||||||
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
|
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
|
||||||
@for (var i = 0; i < Model.Message.Count; i++)
|
@for (var i = 0; i < Model.Message.Count; i++)
|
||||||
{
|
{
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading" role="tab" id="@(i)headingOne">
|
<div class="panel-heading" role="tab" id="@(i)headingOne">
|
||||||
<h4 class="panel-title">
|
<h4 class="panel-title">
|
||||||
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#@(i)collapseOne" aria-controls="@(i)collapseOne">
|
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#@(i)collapseOne" aria-controls="@(i)collapseOne">
|
||||||
@Model.Message[i].NotificationType.ToString()
|
@Model.Message[i].NotificationType.ToString()
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div id="@(i)collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="@(i)headingOne">
|
<div id="@(i)collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="@(i)headingOne">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="@(Model.Message[i])" class="control-label"> @Model.Message[i].NotificationType.ToString() Subject</label>
|
<label for="@(Model.Message[i])" class="control-label"> @Model.Message[i].NotificationType.ToString() Subject</label>
|
||||||
<div>
|
<div>
|
||||||
<input type="text" class="form-control form-control-custom " id="@(Model.Message[i].Subject)" name="Message[@(i)].Subject" value="@(Model.Message[i].Subject)">
|
<input type="text" class="form-control form-control-custom " id="@(Model.Message[i].Subject)" name="Message[@(i)].Subject" value="@(Model.Message[i].Subject)">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="@(Model.Message[i].Body)" class="control-label">@Model.Message[i].NotificationType.ToString() Body</label>
|
||||||
|
<div>
|
||||||
|
<input type="text" class="form-control form-control-custom " id="@(Model.Message[i].Body)" name="Message[@(i)].Body" value="@(Model.Message[i].Body)">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
}
|
||||||
<label for="@(Model.Message[i].Body)" class="control-label">@Model.Message[i].NotificationType.ToString() Body</label>
|
</div>*@
|
||||||
<div>
|
|
||||||
<input type="text" class="form-control form-control-custom " id="@(Model.Message[i].Body)" name="Message[@(i)].Body" value="@(Model.Message[i].Body)">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>*@
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div>
|
<div>
|
||||||
|
@ -158,14 +157,15 @@
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
var auth = $('#Authentication').prop('checked');
|
var auth = $('#Authentication').prop('checked');
|
||||||
ChangeUsernameAndPassword(auth);
|
changeUsernameAndPassword(auth);
|
||||||
|
|
||||||
|
|
||||||
$("#Authentication")
|
$("#Authentication")
|
||||||
.change(function(e) {
|
.change(function () {
|
||||||
ChangeUsernameAndPassword(auth);
|
auth = $('#Authentication').prop('checked');
|
||||||
});
|
changeUsernameAndPassword(auth);
|
||||||
|
});
|
||||||
|
|
||||||
var base = '@Html.GetBaseUrl()';
|
var base = '@Html.GetBaseUrl()';
|
||||||
$('#save').click(function (e) {
|
$('#save').click(function (e) {
|
||||||
|
@ -198,8 +198,8 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#testEmail').click(function (e) {
|
$('#testEmail').click(function (e) {
|
||||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||||
|
|
||||||
var url = createBaseUrl(base, '/admin/testemailnotification');
|
var url = createBaseUrl(base, '/admin/testemailnotification');
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -216,31 +216,43 @@
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
if (response.result === true) {
|
if (response.result === true) {
|
||||||
$('#spinner').attr("class", "fa fa-check");
|
$('#spinner').attr("class", "fa fa-check");
|
||||||
generateNotify(response.message, "success");
|
generateNotify(response.message, "success");
|
||||||
} else {
|
} else {
|
||||||
$('#spinner').attr("class", "fa fa-times");
|
$('#spinner').attr("class", "fa fa-times");
|
||||||
generateNotify(response.message, "warning");
|
generateNotify(response.message, "warning");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (e) {
|
error: function (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
$('#spinner').attr("class", "fa fa-times");
|
$('#spinner').attr("class", "fa fa-times");
|
||||||
generateNotify("Something went wrong!", "danger");
|
generateNotify("Something went wrong!", "danger");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
function ChangeUsernameAndPassword(checked) {
|
function changeUsernameAndPassword(checked) {
|
||||||
var $userName = $('#EmailUsername');
|
var $userName = $('#EmailUsername');
|
||||||
var $password = $('#EmailPassword');
|
var $password = $('#EmailPassword');
|
||||||
if (!checked) {
|
if (!checked) {
|
||||||
$userName.attr('disabled', 'disabled');
|
disableElement($userName);
|
||||||
$password.attr('disabled', 'disabled');
|
disableElement($password);
|
||||||
} else {
|
} else {
|
||||||
$userName.removeAttr('disabled', 'disabled');
|
enableElement($userName);
|
||||||
$password.removeAttr('disabled', 'disabled');
|
enableElement($password);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function disableElement(element) {
|
||||||
|
element.attr('disabled', 'disabled');
|
||||||
|
element.removeClass('form-control-custom');
|
||||||
|
element.addClass('form-control-custom-disabled');
|
||||||
|
}
|
||||||
|
|
||||||
|
function enableElement(element) {
|
||||||
|
element.removeAttr('disabled', 'disabled');
|
||||||
|
element.addClass('form-control-custom');
|
||||||
|
element.removeClass('form-control-custom-disabled');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue