mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
Should fix #429
This commit is contained in:
parent
67df79bcca
commit
ce7305faf0
3 changed files with 92 additions and 59 deletions
|
@ -34,6 +34,7 @@ namespace PlexRequests.Core.SettingModels
|
||||||
public string EmailSender { get; set; }
|
public string EmailSender { get; set; }
|
||||||
public string EmailUsername { get; set; }
|
public string EmailUsername { get; set; }
|
||||||
public bool Enabled { get; set; }
|
public bool Enabled { get; set; }
|
||||||
|
public bool Authentication { get; set; }
|
||||||
public bool EnableUserEmailNotifications { get; set; }
|
public bool EnableUserEmailNotifications { get; set; }
|
||||||
public string RecipientEmail { get; set; }
|
public string RecipientEmail { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,8 +38,6 @@ namespace PlexRequests.UI.Validators
|
||||||
RuleFor(request => request.EmailPort).NotEmpty().WithMessage("You must specify a Port.");
|
RuleFor(request => request.EmailPort).NotEmpty().WithMessage("You must specify a Port.");
|
||||||
RuleFor(request => request.RecipientEmail).NotEmpty().WithMessage("You must specify a Recipient.");
|
RuleFor(request => request.RecipientEmail).NotEmpty().WithMessage("You must specify a Recipient.");
|
||||||
RuleFor(request => request.RecipientEmail).EmailAddress().WithMessage("You must specify a valid Recipient.");
|
RuleFor(request => request.RecipientEmail).EmailAddress().WithMessage("You must specify a valid Recipient.");
|
||||||
RuleFor(request => request.EmailUsername).NotEmpty().WithMessage("You must specify a Username.");
|
|
||||||
RuleFor(request => request.EmailPassword).NotEmpty().WithMessage("You must specify a valid password.");
|
|
||||||
RuleFor(request => request.EmailSender).EmailAddress().WithMessage("You must specify a valid Email for the email sender.");
|
RuleFor(request => request.EmailSender).EmailAddress().WithMessage("You must specify a valid Email for the email sender.");
|
||||||
RuleFor(request => request.EmailSender).NotEmpty().WithMessage("You must specify a Email Sender.");
|
RuleFor(request => request.EmailSender).NotEmpty().WithMessage("You must specify a Email Sender.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<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">
|
||||||
|
|
||||||
|
@ -47,6 +47,20 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="checkbox">
|
||||||
|
|
||||||
|
@if (Model.Authentication)
|
||||||
|
{
|
||||||
|
<input type="checkbox" id="Authentication" name="Authentication" checked="checked"><label for="Authentication">Enable SMTP Authentication</label>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<input type="checkbox" id="Authentication" name="Authentication"><label for="Authentication">Enable SMTP Authentication</label>
|
||||||
|
}
|
||||||
|
|
||||||
|
</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>
|
||||||
|
@ -144,6 +158,15 @@
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
|
var auth = $('#Authentication').prop('checked');
|
||||||
|
ChangeUsernameAndPassword(auth);
|
||||||
|
|
||||||
|
|
||||||
|
$("#Authentication")
|
||||||
|
.change(function(e) {
|
||||||
|
ChangeUsernameAndPassword(auth);
|
||||||
|
});
|
||||||
|
|
||||||
var base = '@Html.GetBaseUrl()';
|
var base = '@Html.GetBaseUrl()';
|
||||||
$('#save').click(function (e) {
|
$('#save').click(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -207,6 +230,17 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
function ChangeUsernameAndPassword(checked) {
|
||||||
|
var $userName = $('#EmailUsername');
|
||||||
|
var $password = $('#EmailPassword');
|
||||||
|
if (!checked) {
|
||||||
|
$userName.attr('disabled', 'disabled');
|
||||||
|
$password.attr('disabled', 'disabled');
|
||||||
|
} else {
|
||||||
|
$userName.removeAttr('disabled', 'disabled');
|
||||||
|
$password.removeAttr('disabled', 'disabled');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue