mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.FieldStorage.InfosetStorage;
|
||||
|
||||
@@ -45,11 +46,13 @@ namespace Orchard.SecureSocketsLayer.Models {
|
||||
set { this.As<InfosetPart>().Set<SslSettingsPart>("CustomEnabled", value.ToString()); }
|
||||
}
|
||||
|
||||
[Required]
|
||||
public string SecureHostName {
|
||||
get { return this.As<InfosetPart>().Get<SslSettingsPart>("SecureHostName"); }
|
||||
set { this.As<InfosetPart>().Set<SslSettingsPart>("SecureHostName", value); }
|
||||
}
|
||||
|
||||
[Required]
|
||||
public string InsecureHostName {
|
||||
get { return this.As<InfosetPart>().Get<SslSettingsPart>("InsecureHostName"); }
|
||||
set { this.As<InfosetPart>().Set<SslSettingsPart>("InsecureHostName", value); }
|
||||
|
@@ -99,6 +99,10 @@ namespace Orchard.SecureSocketsLayer.Services {
|
||||
var urlHelper = new UrlHelper(requestContext);
|
||||
var url = urlHelper.Action(actionName, controllerName, requestContext.RouteData);
|
||||
|
||||
if (String.IsNullOrWhiteSpace(url)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return IsRequestProtected(
|
||||
url, requestContext.HttpContext.Request.ApplicationPath, settings);
|
||||
}
|
||||
|
@@ -8,6 +8,16 @@
|
||||
@Html.ValidationMessage("Enabled", "*")
|
||||
</div>
|
||||
<div data-controllerid="@Html.FieldIdFor(m => m.Enabled)">
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.SecureHostName)">@T("Secure Host Name")</label>
|
||||
@Html.TextBoxFor(m => m.SecureHostName, new { @class = "textMedium" })
|
||||
<span class="hint">@T("(Mandatory) The host name secured traffic should be redirected to (e.g. localhost:44300, secure.mydomain.com). Don't include the protocol or anything else than the host name. A port can be specified after a colon if necessary (e.g. secure.127-0-0-1.org.uk:4333).")</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.InsecureHostName)">@T("Insecure Host Name")</label>
|
||||
@Html.TextBoxFor(m => m.InsecureHostName, new { @class = "textMedium" })
|
||||
<span class="hint">@T("(Mandatory) The host name non-secured traffic should be redirected to (e.g. localhost:30321, mydomain.com). Don't include the protocol or anything else than the host name. A port can be specified after a colon if necessary (e.g. dev.127-0-0-1.org.uk:4333).")</span>
|
||||
</div>
|
||||
<div>
|
||||
@Html.EditorFor(m => m.SecureEverything)
|
||||
<label for="@Html.FieldIdFor(m => m.SecureEverything)" class="forcheckbox">@T("Force SSL on all pages")</label>
|
||||
@@ -29,16 +39,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.SecureHostName)">@T("Secure Host Name")</label>
|
||||
@Html.TextBoxFor(m => m.SecureHostName, new { @class = "textMedium" })
|
||||
<span class="hint">@T("Provide the host name secure traffic should be redirected to (e.g. secure.mydomain.com). Don't include the protocol or anything else than the host name. A port can be specified after a colon if necessary (e.g. secure.127-0-0-1.org.uk:4333).")</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.InsecureHostName)">@T("Insecure Host Name")</label>
|
||||
@Html.TextBoxFor(m => m.InsecureHostName, new { @class = "textMedium" })
|
||||
<span class="hint">@T("Provide the host name non-secured traffic should be redirected to (e.g. mydomain.com). Don't include the protocol or anything else than the host name. A port can be specified after a colon if necessary (e.g. dev.127-0-0-1.org.uk:4333).")</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
Reference in New Issue
Block a user