mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Improving the settings message behavior
This commit is contained in:
@@ -15,13 +15,19 @@ namespace Orchard.SecureSocketsLayer.Filters {
|
||||
_orchardServices = orchardServices;
|
||||
}
|
||||
public Localizer T { get; set; }
|
||||
public void OnActionExecuted(ActionExecutedContext filterContext) {}
|
||||
|
||||
public void OnActionExecuted(ActionExecutedContext filterContext) {
|
||||
var settings = _sslService.GetSettings();
|
||||
|
||||
if (!settings.Enabled) {
|
||||
_orchardServices.Notifier.Warning(T("You need to configure the SSL settings."));
|
||||
}
|
||||
}
|
||||
|
||||
public void OnActionExecuting(ActionExecutingContext filterContext) {
|
||||
var settings = _sslService.GetSettings();
|
||||
|
||||
if (!settings.Enabled) {
|
||||
_orchardServices.Notifier.Warning(T("You need to configure the SSL settings."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,11 @@ namespace Orchard.SecureSocketsLayer.Services {
|
||||
var actionName = (string) requestContext.RouteData.Values["action"];
|
||||
if (actionName == null) return false;
|
||||
|
||||
var settings = GetSettings();
|
||||
if (settings == null || !settings.Enabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (actionName.EndsWith("Ssl") || controllerName.EndsWith("Ssl")) {
|
||||
return true;
|
||||
}
|
||||
@@ -74,9 +79,6 @@ namespace Orchard.SecureSocketsLayer.Services {
|
||||
}
|
||||
}
|
||||
|
||||
var settings = GetSettings();
|
||||
if (settings == null) return false;
|
||||
|
||||
if (settings.SecureEverything) return true;
|
||||
|
||||
if (controllerName == "Account" &&
|
||||
|
||||
Reference in New Issue
Block a user