mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-08-01 18:45:54 +08:00
Merge branch '1.9.x' into dev
This commit is contained in:
commit
c508584e63
@ -7,7 +7,7 @@ using Orchard.Localization;
|
||||
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.
|
||||
// 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> {
|
||||
private const string TemplateName = "Parts/SmtpSettings";
|
||||
@ -31,7 +31,7 @@ namespace Orchard.Email.Drivers {
|
||||
var previousPassword = part.Password;
|
||||
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)) {
|
||||
part.Password = previousPassword;
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ namespace Orchard.Layouts {
|
||||
.WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false")
|
||||
.WithSetting("DateEditorSettings.ShowDateEditor", "false"))
|
||||
.WithPart("TitlePart")
|
||||
.WithPart("IdentityPart")
|
||||
.WithPart("LayoutPart", p => p
|
||||
.WithSetting("LayoutTypePartSettings.IsTemplate", "True"))
|
||||
.DisplayedAs("Layout")
|
||||
@ -62,7 +63,7 @@ namespace Orchard.Layouts {
|
||||
.WithPart("LayoutPart", p => p
|
||||
.WithSetting("LayoutTypePartSettings.IsTemplate", "False")));
|
||||
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
@ -70,6 +71,13 @@ namespace Orchard.Layouts {
|
||||
return 2;
|
||||
}
|
||||
|
||||
public int UpdateFrom2() {
|
||||
ContentDefinitionManager.AlterTypeDefinition("Layout", type => type
|
||||
.WithPart("IdentityPart"));
|
||||
|
||||
return 3;
|
||||
}
|
||||
|
||||
private void DefineElementWidget(string widgetTypeName, string widgetDisplayedAs, string elementTypeName) {
|
||||
ContentDefinitionManager.AlterTypeDefinition(widgetTypeName, type => type
|
||||
.WithPart("CommonPart", p => p
|
||||
|
@ -7,13 +7,20 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Orchard.Environment.Configuration {
|
||||
public class AppConfigurationAccessor : IAppConfigurationAccessor {
|
||||
private readonly ShellSettings _shellSettings;
|
||||
public AppConfigurationAccessor(ShellSettings shellSettings) {
|
||||
_shellSettings = shellSettings;
|
||||
}
|
||||
|
||||
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) {
|
||||
return appSettingsValue;
|
||||
}
|
||||
|
||||
var connectionStringSettings = ConfigurationManager.ConnectionStrings[name];
|
||||
var connectionStringSettings = ConfigurationManager.ConnectionStrings[tenantName] ?? ConfigurationManager.ConnectionStrings[name];
|
||||
if (connectionStringSettings != null) {
|
||||
return connectionStringSettings.ConnectionString;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Orchard.Security {
|
||||
/// <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>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
|
||||
public class AlwaysAccessibleAttribute : Attribute {
|
||||
|
Loading…
Reference in New Issue
Block a user