mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge branch '1.9.x' into dev
This commit is contained in:
@@ -7,7 +7,7 @@ using Orchard.Localization;
|
|||||||
namespace Orchard.Email.Drivers {
|
namespace Orchard.Email.Drivers {
|
||||||
|
|
||||||
// We define a specific driver instead of using a TemplateFilterForRecord, because we need the model to be the part and not the record.
|
// We define a specific driver instead of using a TemplateFilterForRecord, because we need the model to be the part and not the record.
|
||||||
// Thus the encryption/decryption will be done when accessing the part's property
|
// Thus the encryption/decryption will be done when accessing the part's property.
|
||||||
|
|
||||||
public class SmtpSettingsPartDriver : ContentPartDriver<SmtpSettingsPart> {
|
public class SmtpSettingsPartDriver : ContentPartDriver<SmtpSettingsPart> {
|
||||||
private const string TemplateName = "Parts/SmtpSettings";
|
private const string TemplateName = "Parts/SmtpSettings";
|
||||||
@@ -31,7 +31,7 @@ namespace Orchard.Email.Drivers {
|
|||||||
var previousPassword = part.Password;
|
var previousPassword = part.Password;
|
||||||
updater.TryUpdateModel(part, Prefix, null, null);
|
updater.TryUpdateModel(part, Prefix, null, null);
|
||||||
|
|
||||||
// restore password if the input is empty, meaning it has not been reseted
|
// Restore password if the input is empty, meaning that it has not been reset.
|
||||||
if (string.IsNullOrEmpty(part.Password)) {
|
if (string.IsNullOrEmpty(part.Password)) {
|
||||||
part.Password = previousPassword;
|
part.Password = previousPassword;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ namespace Orchard.Layouts {
|
|||||||
.WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false")
|
.WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false")
|
||||||
.WithSetting("DateEditorSettings.ShowDateEditor", "false"))
|
.WithSetting("DateEditorSettings.ShowDateEditor", "false"))
|
||||||
.WithPart("TitlePart")
|
.WithPart("TitlePart")
|
||||||
|
.WithPart("IdentityPart")
|
||||||
.WithPart("LayoutPart", p => p
|
.WithPart("LayoutPart", p => p
|
||||||
.WithSetting("LayoutTypePartSettings.IsTemplate", "True"))
|
.WithSetting("LayoutTypePartSettings.IsTemplate", "True"))
|
||||||
.DisplayedAs("Layout")
|
.DisplayedAs("Layout")
|
||||||
@@ -62,7 +63,7 @@ namespace Orchard.Layouts {
|
|||||||
.WithPart("LayoutPart", p => p
|
.WithPart("LayoutPart", p => p
|
||||||
.WithSetting("LayoutTypePartSettings.IsTemplate", "False")));
|
.WithSetting("LayoutTypePartSettings.IsTemplate", "False")));
|
||||||
|
|
||||||
return 2;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int UpdateFrom1() {
|
public int UpdateFrom1() {
|
||||||
@@ -70,6 +71,13 @@ namespace Orchard.Layouts {
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int UpdateFrom2() {
|
||||||
|
ContentDefinitionManager.AlterTypeDefinition("Layout", type => type
|
||||||
|
.WithPart("IdentityPart"));
|
||||||
|
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
private void DefineElementWidget(string widgetTypeName, string widgetDisplayedAs, string elementTypeName) {
|
private void DefineElementWidget(string widgetTypeName, string widgetDisplayedAs, string elementTypeName) {
|
||||||
ContentDefinitionManager.AlterTypeDefinition(widgetTypeName, type => type
|
ContentDefinitionManager.AlterTypeDefinition(widgetTypeName, type => type
|
||||||
.WithPart("CommonPart", p => p
|
.WithPart("CommonPart", p => p
|
||||||
|
|||||||
@@ -7,13 +7,20 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Orchard.Environment.Configuration {
|
namespace Orchard.Environment.Configuration {
|
||||||
public class AppConfigurationAccessor : IAppConfigurationAccessor {
|
public class AppConfigurationAccessor : IAppConfigurationAccessor {
|
||||||
|
private readonly ShellSettings _shellSettings;
|
||||||
|
public AppConfigurationAccessor(ShellSettings shellSettings) {
|
||||||
|
_shellSettings = shellSettings;
|
||||||
|
}
|
||||||
|
|
||||||
public string GetConfiguration(string name) {
|
public string GetConfiguration(string name) {
|
||||||
var appSettingsValue = ConfigurationManager.AppSettings[name];
|
var tenantName = String.Format("{0}:{1}", _shellSettings.Name, name);
|
||||||
|
|
||||||
|
var appSettingsValue = ConfigurationManager.AppSettings[tenantName] ?? ConfigurationManager.AppSettings[name];
|
||||||
if (appSettingsValue != null) {
|
if (appSettingsValue != null) {
|
||||||
return appSettingsValue;
|
return appSettingsValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var connectionStringSettings = ConfigurationManager.ConnectionStrings[name];
|
var connectionStringSettings = ConfigurationManager.ConnectionStrings[tenantName] ?? ConfigurationManager.ConnectionStrings[name];
|
||||||
if (connectionStringSettings != null) {
|
if (connectionStringSettings != null) {
|
||||||
return connectionStringSettings.ConnectionString;
|
return connectionStringSettings.ConnectionString;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Orchard.Security {
|
namespace Orchard.Security {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Applied on a Controller or an Action, will prevent any action from being filtered by AccessFrontEnd permssion
|
/// Applied on a Controller or an Action, it will prevent any action from being filtered by the AccessFrontEnd permission.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
|
||||||
public class AlwaysAccessibleAttribute : Attribute {
|
public class AlwaysAccessibleAttribute : Attribute {
|
||||||
|
|||||||
Reference in New Issue
Block a user