bug: correctly store email settings
This commit is contained in:
@@ -134,7 +134,7 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig
|
|||||||
EmailReplyToAddress = config.EmailReplyToAddress,
|
EmailReplyToAddress = config.EmailReplyToAddress,
|
||||||
EmailEnableSsl = config.EmailEnableSsl,
|
EmailEnableSsl = config.EmailEnableSsl,
|
||||||
EmailUsername = config.EmailUsername,
|
EmailUsername = config.EmailUsername,
|
||||||
EmailPassword = config.EmailPassword,
|
EmailPassword = null,
|
||||||
EmailIsConfigured = EmailService.IsConfigured,
|
EmailIsConfigured = EmailService.IsConfigured,
|
||||||
UpdateLatestResponse = config.UpdateLastCheckResponse,
|
UpdateLatestResponse = config.UpdateLastCheckResponse,
|
||||||
UpdateRunningStatus = UpdateQueryTask.RunningStatus,
|
UpdateRunningStatus = UpdateQueryTask.RunningStatus,
|
||||||
|
|||||||
@@ -761,6 +761,7 @@ else
|
|||||||
SmtpServer: $('#EmailSmtpServer').val(),
|
SmtpServer: $('#EmailSmtpServer').val(),
|
||||||
SmtpPort: $('#EmailSmtpPort').val(),
|
SmtpPort: $('#EmailSmtpPort').val(),
|
||||||
FromAddress: $('#EmailFromAddress').val(),
|
FromAddress: $('#EmailFromAddress').val(),
|
||||||
|
ReplyToAddress: $('#EmailReplyToAddress').val(),
|
||||||
EnableSsl: $('#EmailEnableSsl').is(':checked'),
|
EnableSsl: $('#EmailEnableSsl').is(':checked'),
|
||||||
Username: $('#EmailUsername').val(),
|
Username: $('#EmailUsername').val(),
|
||||||
Password: $('#EmailPassword').val(),
|
Password: $('#EmailPassword').val(),
|
||||||
|
|||||||
@@ -2233,60 +2233,61 @@ WriteLiteral(@" </div>
|
|||||||
WriteLiteral("\';\r\n var data = {\r\n " +
|
WriteLiteral("\';\r\n var data = {\r\n " +
|
||||||
" SmtpServer: $(\'#EmailSmtpServer\').val(),\r\n " +
|
" SmtpServer: $(\'#EmailSmtpServer\').val(),\r\n " +
|
||||||
" SmtpPort: $(\'#EmailSmtpPort\').val(),\r\n Fro" +
|
" SmtpPort: $(\'#EmailSmtpPort\').val(),\r\n Fro" +
|
||||||
"mAddress: $(\'#EmailFromAddress\').val(),\r\n Ena" +
|
"mAddress: $(\'#EmailFromAddress\').val(),\r\n Rep" +
|
||||||
"bleSsl: $(\'#EmailEnableSsl\').is(\':checked\'),\r\n " +
|
"lyToAddress: $(\'#EmailReplyToAddress\').val(),\r\n " +
|
||||||
" Username: $(\'#EmailUsername\').val(),\r\n Pass" +
|
" EnableSsl: $(\'#EmailEnableSsl\').is(\':checked\'),\r\n " +
|
||||||
"word: $(\'#EmailPassword\').val(),\r\n \'__Request" +
|
" Username: $(\'#EmailUsername\').val(),\r\n " +
|
||||||
"VerificationToken\': button.parent().find(\'input[name=\"__RequestVerificationToken" +
|
" Password: $(\'#EmailPassword\').val(),\r\n \'__R" +
|
||||||
"\"]\').first().val()\r\n }\r\n " +
|
"equestVerificationToken\': button.parent().find(\'input[name=\"__RequestVerificatio" +
|
||||||
|
"nToken\"]\').first().val()\r\n }\r\n " +
|
||||||
" var ajaxLoading = button.next(\'.ajaxLoading\').first().show();\r\n\r\n " +
|
" var ajaxLoading = button.next(\'.ajaxLoading\').first().show();\r\n\r\n " +
|
||||||
" $.ajax({\r\n type: \'POS" +
|
" $.ajax({\r\n type" +
|
||||||
"T\',\r\n dataType: \'json\',\r\n " +
|
": \'POST\',\r\n dataType: \'json\',\r\n " +
|
||||||
" url: url,\r\n data: data,\r\n " +
|
" url: url,\r\n data: data," +
|
||||||
" complete: function (response, result) {\r\n " +
|
"\r\n complete: function (response, result) {\r\n " +
|
||||||
" if (result != \'success\' || response.responseJSO" +
|
" if (result != \'success\' || response.respo" +
|
||||||
"N != \'OK\') {\r\n alert(\'Unable to chang" +
|
"nseJSON != \'OK\') {\r\n alert(\'Unable to" +
|
||||||
"e email settings:\\nCheck logs for more information\');\r\n " +
|
" change email settings:\\nCheck logs for more information\');\r\n " +
|
||||||
" ajaxLoading.hide();\r\n " +
|
" ajaxLoading.hide();\r\n " +
|
||||||
"} else {\r\n ajaxLoading.hide().next(\'." +
|
" } else {\r\n ajaxLoading.hide().n" +
|
||||||
"ajaxOk\').show().delay(\'fast\').fadeOut(\'slow\');\r\n " +
|
"ext(\'.ajaxOk\').show().delay(\'fast\').fadeOut(\'slow\');\r\n " +
|
||||||
" if (!!$(\'#EmailSmtpServer\').val()) {\r\n " +
|
" if (!!$(\'#EmailSmtpServer\').val()) {\r\n " +
|
||||||
" testButton.removeAttr(\'disabled\');\r\n " +
|
" testButton.removeAttr(\'disabled\');\r\n " +
|
||||||
" } else {\r\n test" +
|
" } else {\r\n " +
|
||||||
"Button.attr(\'disabled\', \'disabled\');\r\n " +
|
" testButton.attr(\'disabled\', \'disabled\');\r\n " +
|
||||||
" }\r\n }\r\n " +
|
" }\r\n }\r\n " +
|
||||||
" }\r\n });\r\n });\r\n\r\n " +
|
" }\r\n });\r\n })" +
|
||||||
" testButton.closest(\'table\').find(\'td>input\').change(f" +
|
";\r\n\r\n testButton.closest(\'table\').find(\'td>input\').ch" +
|
||||||
"unction () {\r\n testButton.attr(\'disabled\', \'disab" +
|
"ange(function () {\r\n testButton.attr(\'disabled\', " +
|
||||||
"led\');\r\n });\r\n testButton." +
|
"\'disabled\');\r\n });\r\n testB" +
|
||||||
"click(function () {\r\n if (!testDialog) {\r\n " +
|
"utton.click(function () {\r\n if (!testDialog) {\r\n " +
|
||||||
" testDialog = $(\'#Config_System_Email_Test_Dialog\')\r" +
|
" testDialog = $(\'#Config_System_Email_Test_Dia" +
|
||||||
"\n .dialog({\r\n " +
|
"log\')\r\n .dialog({\r\n " +
|
||||||
" resizable: false,\r\n h" +
|
" resizable: false,\r\n " +
|
||||||
"eight: 180,\r\n modal: true,\r\n " +
|
" height: 180,\r\n modal: true,\r\n " +
|
||||||
" autoOpen: false,\r\n " +
|
" autoOpen: false,\r\n " +
|
||||||
" buttons: {\r\n Sen" +
|
" buttons: {\r\n " +
|
||||||
"d: function () {\r\n var $this " +
|
" Send: function () {\r\n var " +
|
||||||
"= $(this);\r\n var recipientInp" +
|
"$this = $(this);\r\n var recipi" +
|
||||||
"ut = $(\'#Config_System_Email_Test_Recipient\');\r\n " +
|
"entInput = $(\'#Config_System_Email_Test_Recipient\');\r\n " +
|
||||||
" if (!!recipientInput.val()) {\r\n " +
|
" if (!!recipientInput.val()) {\r\n " +
|
||||||
" $this.dialog(\"disable\");\r\n " +
|
" $this.dialog(\"disable\");\r\n " +
|
||||||
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
||||||
" recipientInput.closest(\'form\').su" +
|
" recipientInput.closest(\'for" +
|
||||||
"bmit()\r\n } else {\r\n " +
|
"m\').submit()\r\n } else {\r\n " +
|
||||||
" alert(\'Enter the recipient address" +
|
" alert(\'Enter the recipient a" +
|
||||||
" for the test email\');\r\n }\r\n " +
|
"ddress for the test email\');\r\n " +
|
||||||
" },\r\n " +
|
" }\r\n },\r\n " +
|
||||||
" Cancel: function () {\r\n " +
|
" Cancel: function () {\r\n " +
|
||||||
" $(this).dialog(\"close\");\r\n " +
|
" $(this).dialog(\"close\");\r\n " +
|
||||||
" }\r\n }\r\n " +
|
" }\r\n }\r\n " +
|
||||||
" });\r\n }\r\n " +
|
" });\r\n }\r\n " +
|
||||||
" testDialog.dialog(\'open\');\r\n });\r\n\r\n " +
|
" testDialog.dialog(\'open\');\r\n });\r\n\r\n " +
|
||||||
" });\r\n </script>\r\n </td>\r\n " +
|
" });\r\n </script>\r\n </td>" +
|
||||||
" </tr>\r\n </table>\r\n </div>\r\n");
|
"\r\n </tr>\r\n </table>\r\n </div>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 830 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
#line 831 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2311,7 +2312,7 @@ WriteLiteral(">\r\n SMTP Server:\r\n </th>\r\n
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 841 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
#line 842 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
||||||
Write(Html.DisplayFor(m => m.EmailSmtpServer));
|
Write(Html.DisplayFor(m => m.EmailSmtpServer));
|
||||||
|
|
||||||
|
|
||||||
@@ -2327,7 +2328,7 @@ WriteLiteral(">\r\n Port:\r\n </th>\r\n
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 849 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
#line 850 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
||||||
Write(Html.DisplayFor(m => m.EmailSmtpPort));
|
Write(Html.DisplayFor(m => m.EmailSmtpPort));
|
||||||
|
|
||||||
|
|
||||||
@@ -2344,7 +2345,7 @@ WriteLiteral(">\r\n Default From Address:\r\n
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 857 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
#line 858 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
||||||
Write(Html.DisplayFor(m => m.EmailFromAddress));
|
Write(Html.DisplayFor(m => m.EmailFromAddress));
|
||||||
|
|
||||||
|
|
||||||
@@ -2361,7 +2362,7 @@ WriteLiteral(">\r\n Reply To Address:\r\n </th
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 865 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
#line 866 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
||||||
Write(Html.DisplayFor(m => m.EmailReplyToAddress));
|
Write(Html.DisplayFor(m => m.EmailReplyToAddress));
|
||||||
|
|
||||||
|
|
||||||
@@ -2378,7 +2379,7 @@ WriteLiteral(">\r\n Enable SSL:\r\n </th>\r\n
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 873 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
#line 874 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
||||||
Write(Html.CheckBoxFor(m => m.EmailEnableSsl, new { disabled = "disabled" }));
|
Write(Html.CheckBoxFor(m => m.EmailEnableSsl, new { disabled = "disabled" }));
|
||||||
|
|
||||||
|
|
||||||
@@ -2387,7 +2388,7 @@ WriteLiteral(" ");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 873 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
#line 874 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
||||||
Write(Html.LabelFor(m => m.EmailEnableSsl));
|
Write(Html.LabelFor(m => m.EmailEnableSsl));
|
||||||
|
|
||||||
|
|
||||||
@@ -2403,7 +2404,7 @@ WriteLiteral(">\r\n Username:\r\n </th>\r\n
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 881 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
#line 882 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
||||||
Write(Html.DisplayFor(m => m.EmailUsername));
|
Write(Html.DisplayFor(m => m.EmailUsername));
|
||||||
|
|
||||||
|
|
||||||
@@ -2419,7 +2420,7 @@ WriteLiteral(">\r\n Password:\r\n </th>\r\n
|
|||||||
"table>\r\n </div>\r\n");
|
"table>\r\n </div>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 894 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
#line 895 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2434,7 +2435,7 @@ WriteLiteral(">\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 896 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
#line 897 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
|
||||||
Write(Html.ActionLinkButton("Update Device Last Network Logons", MVC.API.System.UpdateLastNetworkLogonDates()));
|
Write(Html.ActionLinkButton("Update Device Last Network Logons", MVC.API.System.UpdateLastNetworkLogonDates()));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user