mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge branch '1.9-int' into dev
This commit is contained in:
@@ -175,7 +175,7 @@
|
||||
if (controller.is(":checkbox")) {
|
||||
controller.click($(this).toggleWhatYouControl).each($(this).toggleWhatYouControl);
|
||||
} else if (controller.is(":radio")) {
|
||||
$("[name=" + controller.attr("name") + "]").click(function () { $("[name=" + $(this).attr("name") + "]").each($(this).toggleWhatYouControl); });
|
||||
$("[name='" + controller.attr("name") + "']").click(function () { $("[name='" + $(this).attr("name") + "']").each($(this).toggleWhatYouControl); });
|
||||
}
|
||||
else if (controller.is("option")) {
|
||||
controller.parent().change(function() {
|
||||
|
@@ -41,6 +41,7 @@ namespace Orchard.Email.Controllers {
|
||||
smtpSettings.Port = testSettings.Port;
|
||||
smtpSettings.EnableSsl = testSettings.EnableSsl;
|
||||
smtpSettings.RequireCredentials = testSettings.RequireCredentials;
|
||||
smtpSettings.UseDefaultCredentials = testSettings.UseDefaultCredentials;
|
||||
smtpSettings.UserName = testSettings.UserName;
|
||||
smtpSettings.Password = testSettings.Password;
|
||||
|
||||
@@ -97,6 +98,7 @@ namespace Orchard.Email.Controllers {
|
||||
public int Port { get; set; }
|
||||
public bool EnableSsl { get; set; }
|
||||
public bool RequireCredentials { get; set; }
|
||||
public bool UseDefaultCredentials { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string To { get; set; }
|
||||
|
@@ -41,6 +41,11 @@ namespace Orchard.Email.Models {
|
||||
set { this.Store(x => x.RequireCredentials, value); }
|
||||
}
|
||||
|
||||
public bool UseDefaultCredentials {
|
||||
get { return this.Retrieve(x => x.UseDefaultCredentials); }
|
||||
set { this.Store(x => x.UseDefaultCredentials, value); }
|
||||
}
|
||||
|
||||
public string UserName {
|
||||
get { return this.Retrieve(x => x.UserName); }
|
||||
set { this.Store(x => x.UserName, value); }
|
||||
|
@@ -133,7 +133,7 @@ namespace Orchard.Email.Services {
|
||||
}
|
||||
|
||||
var smtpClient = new SmtpClient {
|
||||
UseDefaultCredentials = !_smtpSettings.RequireCredentials,
|
||||
UseDefaultCredentials = _smtpSettings.RequireCredentials && _smtpSettings.UseDefaultCredentials
|
||||
};
|
||||
|
||||
if (!smtpClient.UseDefaultCredentials && !String.IsNullOrWhiteSpace(_smtpSettings.UserName)) {
|
||||
|
@@ -35,18 +35,34 @@
|
||||
<label for="@Html.FieldIdFor(m => m.RequireCredentials)" class="forcheckbox">@T("Require credentials")</label>
|
||||
@Html.ValidationMessage("RequireCredentials", "*")
|
||||
</div>
|
||||
|
||||
<div data-controllerid="@Html.FieldIdFor(m => m.RequireCredentials)">
|
||||
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.UserName)">@T("User name")</label>
|
||||
@Html.TextBoxFor(m => m.UserName, new { @class = "text" })
|
||||
@Html.ValidationMessage("UserName", "*")
|
||||
<span class="hint">@T("The username for authentication.")</span>
|
||||
@Html.RadioButtonFor(m => m.UseDefaultCredentials, false, new { id = "customCredentialsOption", name = "UseDefaultCredentials" })
|
||||
<label for="customCredentialsOption" class="forcheckbox">@T("Specify username/password")</label>
|
||||
@Html.ValidationMessage("UseDefaultCredentials", "*")
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.Password)">@T("Password")</label>
|
||||
@Html.TextBoxFor(m => m.Password, new { type = "password", @class = "text medium" })
|
||||
@Html.ValidationMessage("Password", "*")
|
||||
<span class="hint">@T("The password for authentication.")</span>
|
||||
@Html.RadioButtonFor(m => m.UseDefaultCredentials, true, new { id = "defaultCredentialsOptions", name = "UseDefaultCredentials" })
|
||||
<label for="defaultCredentialsOptions" class="forcheckbox">@T("Use Windows authentication")</label>
|
||||
@Html.ValidationMessage("UseDefaultCredentials", "*")
|
||||
<span class="hint">@T("When this option is selected, the aplication pool or host-process identity is used to authenticate with the mail server. ")</span>
|
||||
</div>
|
||||
<div class="options">
|
||||
<span data-controllerid="customCredentialsOption">
|
||||
<label for="@Html.FieldIdFor(m => m.UserName)">@T("User name")</label>
|
||||
@Html.TextBoxFor(m => m.UserName, new { @class = "text" })
|
||||
@Html.ValidationMessage("UserName", "*")
|
||||
<span class="hint">@T("The username for authentication.")</span>
|
||||
</span>
|
||||
<span data-controllerid="customCredentialsOption">
|
||||
<label for="@Html.FieldIdFor(m => m.Password)">@T("Password")</label>
|
||||
@Html.TextBoxFor(m => m.Password, new { type = "password", @class = "text medium" })
|
||||
@Html.ValidationMessage("Password", "*")
|
||||
<span class="hint">@T("The password for authentication.")</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -80,7 +96,8 @@
|
||||
</div>
|
||||
<div id="emailtesterror" class="message-Error" style="display:none;"></div>
|
||||
<div id="emailtestinfo" class="message-Information" style="display:none;"></div>
|
||||
@using (Script.Foot()) {
|
||||
@using (Script.Foot())
|
||||
{
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var url = "@Url.Action("TestSettings", "EmailAdmin", new {area = "Orchard.Email"})",
|
||||
@@ -91,6 +108,7 @@
|
||||
port = $("#@Html.FieldIdFor(m => m.Port)"),
|
||||
enableSsl = $("#@Html.FieldIdFor(m => m.EnableSsl)"),
|
||||
requireCredentials = $("#@Html.FieldIdFor(m => m.RequireCredentials)"),
|
||||
useDefaultCredentials = $("input[name='@Html.NameFor(m => m.UseDefaultCredentials)']"),
|
||||
userName = $("#@Html.FieldIdFor(m => m.UserName)"),
|
||||
password = $("#@Html.FieldIdFor(m => m.Password)"),
|
||||
to = $("#emailtestto"),
|
||||
@@ -107,6 +125,7 @@
|
||||
port: port.val(),
|
||||
enableSsl: enableSsl.prop("checked"),
|
||||
requireCredentials: requireCredentials.prop("checked"),
|
||||
useDefaultCredentials: useDefaultCredentials.filter(':checked').val(),
|
||||
userName: userName.val(),
|
||||
password: password.val(),
|
||||
to: to.val(),
|
||||
|
Reference in New Issue
Block a user