diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/CommaDelimitedConfigurationElement.cs b/src/Umbraco.Core/Configuration/CommaDelimitedConfigurationElement.cs similarity index 91% rename from src/Umbraco.Core/Configuration/UmbracoSettings/CommaDelimitedConfigurationElement.cs rename to src/Umbraco.Core/Configuration/CommaDelimitedConfigurationElement.cs index 03a31fc1fd..ce43416a25 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/CommaDelimitedConfigurationElement.cs +++ b/src/Umbraco.Core/Configuration/CommaDelimitedConfigurationElement.cs @@ -1,70 +1,70 @@ -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Configuration; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - /// - /// Defines a configuration section that contains inner text that is comma delimited - /// - internal class CommaDelimitedConfigurationElement : InnerTextConfigurationElement, IEnumerable - { - public override CommaDelimitedStringCollection Value - { - get - { - var converter = new CommaDelimitedStringCollectionConverter(); - return (CommaDelimitedStringCollection) converter.ConvertFrom(RawValue); - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return new InnerEnumerator(Value.GetEnumerator()); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return new InnerEnumerator(Value.GetEnumerator()); - } - - /// - /// A wrapper for StringEnumerator since it doesn't explicitly implement IEnumerable - /// - private class InnerEnumerator : IEnumerator - { - private readonly StringEnumerator _stringEnumerator; - - public InnerEnumerator(StringEnumerator stringEnumerator) - { - _stringEnumerator = stringEnumerator; - } - - public bool MoveNext() - { - return _stringEnumerator.MoveNext(); - } - - public void Reset() - { - _stringEnumerator.Reset(); - } - - string IEnumerator.Current - { - get { return _stringEnumerator.Current; } - } - - public object Current - { - get { return _stringEnumerator.Current; } - } - - public void Dispose() - { - _stringEnumerator.DisposeIfDisposable(); - } - } - } +using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Configuration; + +namespace Umbraco.Core.Configuration +{ + /// + /// Defines a configuration section that contains inner text that is comma delimited + /// + internal class CommaDelimitedConfigurationElement : InnerTextConfigurationElement, IEnumerable + { + public override CommaDelimitedStringCollection Value + { + get + { + var converter = new CommaDelimitedStringCollectionConverter(); + return (CommaDelimitedStringCollection) converter.ConvertFrom(RawValue); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return new InnerEnumerator(Value.GetEnumerator()); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return new InnerEnumerator(Value.GetEnumerator()); + } + + /// + /// A wrapper for StringEnumerator since it doesn't explicitly implement IEnumerable + /// + private class InnerEnumerator : IEnumerator + { + private readonly StringEnumerator _stringEnumerator; + + public InnerEnumerator(StringEnumerator stringEnumerator) + { + _stringEnumerator = stringEnumerator; + } + + public bool MoveNext() + { + return _stringEnumerator.MoveNext(); + } + + public void Reset() + { + _stringEnumerator.Reset(); + } + + string IEnumerator.Current + { + get { return _stringEnumerator.Current; } + } + + public object Current + { + get { return _stringEnumerator.Current; } + } + + public void Dispose() + { + UmbracoSettings.ObjectExtensions.DisposeIfDisposable(_stringEnumerator); + } + } + } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/InnerTextConfigurationElement.cs b/src/Umbraco.Core/Configuration/InnerTextConfigurationElement.cs similarity index 92% rename from src/Umbraco.Core/Configuration/UmbracoSettings/InnerTextConfigurationElement.cs rename to src/Umbraco.Core/Configuration/InnerTextConfigurationElement.cs index 11da52bd3c..5363893971 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/InnerTextConfigurationElement.cs +++ b/src/Umbraco.Core/Configuration/InnerTextConfigurationElement.cs @@ -1,69 +1,69 @@ -using System; -using System.Xml; -using System.Xml.Linq; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - /// - /// A full config section is required for any full element and we have some elements that are defined like this: - /// {element}MyValue{/element} instead of as attribute values. - /// - /// - internal class InnerTextConfigurationElement : RawXmlConfigurationElement - { - public InnerTextConfigurationElement() - { - } - - public InnerTextConfigurationElement(XElement rawXml) : base(rawXml) - { - } - - protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey) - { - base.DeserializeElement(reader, serializeCollectionKey); - //now validate and set the raw value - if (RawXml.HasElements) - throw new InvalidOperationException("An InnerTextConfigurationElement cannot contain any child elements, only attributes and a value"); - RawValue = RawXml.Value; - - //RawValue = reader.ReadElementContentAsString(); - } - - public virtual T Value - { - get - { - var converted = RawValue.TryConvertTo(); - if (converted.Success == false) - throw new InvalidCastException("Could not convert value " + RawValue + " to type " + typeof(T)); - return converted.Result; - } - } - - /// - /// Exposes the raw string value - /// - internal string RawValue { get; set; } - - /// - /// Implicit operator so we don't need to use the 'Value' property explicitly - /// - /// - /// - public static implicit operator T(InnerTextConfigurationElement m) - { - return m.Value; - } - - /// - /// Return the string value of Value - /// - /// - public override string ToString() - { - return string.Format("{0}", Value); - } - - } +using System; +using System.Xml; +using System.Xml.Linq; + +namespace Umbraco.Core.Configuration +{ + /// + /// A full config section is required for any full element and we have some elements that are defined like this: + /// {element}MyValue{/element} instead of as attribute values. + /// + /// + internal class InnerTextConfigurationElement : RawXmlConfigurationElement + { + public InnerTextConfigurationElement() + { + } + + public InnerTextConfigurationElement(XElement rawXml) : base(rawXml) + { + } + + protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey) + { + base.DeserializeElement(reader, serializeCollectionKey); + //now validate and set the raw value + if (RawXml.HasElements) + throw new InvalidOperationException("An InnerTextConfigurationElement cannot contain any child elements, only attributes and a value"); + RawValue = RawXml.Value; + + //RawValue = reader.ReadElementContentAsString(); + } + + public virtual T Value + { + get + { + var converted = UmbracoSettings.ObjectExtensions.TryConvertTo(RawValue); + if (converted.Success == false) + throw new InvalidCastException("Could not convert value " + RawValue + " to type " + typeof(T)); + return converted.Result; + } + } + + /// + /// Exposes the raw string value + /// + internal string RawValue { get; set; } + + /// + /// Implicit operator so we don't need to use the 'Value' property explicitly + /// + /// + /// + public static implicit operator T(InnerTextConfigurationElement m) + { + return m.Value; + } + + /// + /// Return the string value of Value + /// + /// + public override string ToString() + { + return string.Format("{0}", Value); + } + + } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/OptionalCommaDelimitedConfigurationElement.cs b/src/Umbraco.Core/Configuration/OptionalCommaDelimitedConfigurationElement.cs similarity index 92% rename from src/Umbraco.Core/Configuration/UmbracoSettings/OptionalCommaDelimitedConfigurationElement.cs rename to src/Umbraco.Core/Configuration/OptionalCommaDelimitedConfigurationElement.cs index 432e4d8fa9..18062a9ed9 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/OptionalCommaDelimitedConfigurationElement.cs +++ b/src/Umbraco.Core/Configuration/OptionalCommaDelimitedConfigurationElement.cs @@ -1,42 +1,43 @@ -using System.Configuration; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - /// - /// Used for specifying default values for comma delimited config - /// - internal class OptionalCommaDelimitedConfigurationElement : CommaDelimitedConfigurationElement - { - private readonly CommaDelimitedConfigurationElement _wrapped; - private readonly string[] _defaultValue; - - public OptionalCommaDelimitedConfigurationElement() - { - } - - public OptionalCommaDelimitedConfigurationElement(CommaDelimitedConfigurationElement wrapped, string[] defaultValue) - { - _wrapped = wrapped; - _defaultValue = defaultValue; - } - - public override CommaDelimitedStringCollection Value - { - get - { - if (_wrapped == null) - { - return base.Value; - } - - if (string.IsNullOrEmpty(_wrapped.RawValue)) - { - var val = new CommaDelimitedStringCollection(); - val.AddRange(_defaultValue); - return val; - } - return _wrapped.Value; - } - } - } +using System.Configuration; +using Umbraco.Core.Configuration.UmbracoSettings; + +namespace Umbraco.Core.Configuration +{ + /// + /// Used for specifying default values for comma delimited config + /// + internal class OptionalCommaDelimitedConfigurationElement : CommaDelimitedConfigurationElement + { + private readonly CommaDelimitedConfigurationElement _wrapped; + private readonly string[] _defaultValue; + + public OptionalCommaDelimitedConfigurationElement() + { + } + + public OptionalCommaDelimitedConfigurationElement(CommaDelimitedConfigurationElement wrapped, string[] defaultValue) + { + _wrapped = wrapped; + _defaultValue = defaultValue; + } + + public override CommaDelimitedStringCollection Value + { + get + { + if (_wrapped == null) + { + return base.Value; + } + + if (string.IsNullOrEmpty(_wrapped.RawValue)) + { + var val = new CommaDelimitedStringCollection(); + val.AddRange(_defaultValue); + return val; + } + return _wrapped.Value; + } + } + } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/OptionalInnerTextConfigurationElement.cs b/src/Umbraco.Core/Configuration/OptionalInnerTextConfigurationElement.cs similarity index 90% rename from src/Umbraco.Core/Configuration/UmbracoSettings/OptionalInnerTextConfigurationElement.cs rename to src/Umbraco.Core/Configuration/OptionalInnerTextConfigurationElement.cs index 2180955c91..a2daf059b4 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/OptionalInnerTextConfigurationElement.cs +++ b/src/Umbraco.Core/Configuration/OptionalInnerTextConfigurationElement.cs @@ -1,23 +1,23 @@ -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - /// - /// This is used to supply optional/default values when using InnerTextConfigurationElement - /// - /// - internal class OptionalInnerTextConfigurationElement : InnerTextConfigurationElement - { - private readonly InnerTextConfigurationElement _wrapped; - private readonly T _defaultValue; - - public OptionalInnerTextConfigurationElement(InnerTextConfigurationElement wrapped, T defaultValue) - { - _wrapped = wrapped; - _defaultValue = defaultValue; - } - - public override T Value - { - get { return string.IsNullOrEmpty(_wrapped.RawValue) ? _defaultValue : _wrapped.Value; } - } - } +namespace Umbraco.Core.Configuration +{ + /// + /// This is used to supply optional/default values when using InnerTextConfigurationElement + /// + /// + internal class OptionalInnerTextConfigurationElement : InnerTextConfigurationElement + { + private readonly InnerTextConfigurationElement _wrapped; + private readonly T _defaultValue; + + public OptionalInnerTextConfigurationElement(InnerTextConfigurationElement wrapped, T defaultValue) + { + _wrapped = wrapped; + _defaultValue = defaultValue; + } + + public override T Value + { + get { return string.IsNullOrEmpty(_wrapped.RawValue) ? _defaultValue : _wrapped.Value; } + } + } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/RawXmlConfigurationElement.cs b/src/Umbraco.Core/Configuration/RawXmlConfigurationElement.cs similarity index 90% rename from src/Umbraco.Core/Configuration/UmbracoSettings/RawXmlConfigurationElement.cs rename to src/Umbraco.Core/Configuration/RawXmlConfigurationElement.cs index dbe1e6b6ad..aec3af9481 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/RawXmlConfigurationElement.cs +++ b/src/Umbraco.Core/Configuration/RawXmlConfigurationElement.cs @@ -1,30 +1,30 @@ -using System.Configuration; -using System.Xml; -using System.Xml.Linq; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - /// - /// A configuration section that simply exposes the entire raw xml of the section itself which inheritors can use - /// to do with as they please. - /// - internal abstract class RawXmlConfigurationElement : ConfigurationElement - { - protected RawXmlConfigurationElement() - { - - } - - protected RawXmlConfigurationElement(XElement rawXml) - { - RawXml = rawXml; - } - - protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey) - { - RawXml = (XElement)XNode.ReadFrom(reader); - } - - protected XElement RawXml { get; private set; } - } +using System.Configuration; +using System.Xml; +using System.Xml.Linq; + +namespace Umbraco.Core.Configuration +{ + /// + /// A configuration section that simply exposes the entire raw xml of the section itself which inheritors can use + /// to do with as they please. + /// + internal abstract class RawXmlConfigurationElement : ConfigurationElement + { + protected RawXmlConfigurationElement() + { + + } + + protected RawXmlConfigurationElement(XElement rawXml) + { + RawXml = rawXml; + } + + protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey) + { + RawXml = (XElement)XNode.ReadFrom(reader); + } + + protected XElement RawXml { get; private set; } + } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ExternalLoggerElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ExternalLoggerElement.cs index 98039f8e65..8d8d7b3f0d 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ExternalLoggerElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ExternalLoggerElement.cs @@ -2,7 +2,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { - internal class ExternalLoggerElement : ConfigurationElement, IExternalLogger + internal class ExternalLoggerElement : ConfigurationElement { [ConfigurationProperty("assembly")] internal string Assembly @@ -21,20 +21,5 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { get { return (bool)base["logAuditTrail"]; } } - - string IExternalLogger.Assembly - { - get { return Assembly; } - } - - string IExternalLogger.ExternalLoggerType - { - get { return Type; } - } - - bool IExternalLogger.LogAuditTrail - { - get { return LogAuditTrail; } - } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IExternalLogger.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IExternalLogger.cs deleted file mode 100644 index ae2353f161..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IExternalLogger.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Configuration; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - public interface IExternalLogger - { - string Assembly { get; } - - string ExternalLoggerType { get; } - - bool LogAuditTrail { get; } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ILogging.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ILogging.cs index b5525f3f52..cc0a54b515 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ILogging.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ILogging.cs @@ -16,7 +16,11 @@ namespace Umbraco.Core.Configuration.UmbracoSettings IEnumerable DisabledLogTypes { get; } - IExternalLogger ExternalLogger { get; } + string ExternalLoggerAssembly { get; } + + string ExternalLoggerType { get; } + + bool ExternalLoggerEnableAuditTrail { get; } bool ExternalLoggerIsConfigured { get; } } diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IProviders.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IProviders.cs index 60bf0e9687..92543401b0 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IProviders.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IProviders.cs @@ -3,7 +3,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { public interface IProviders - { - IUserProvider Users { get; } + { + string DefaultBackOfficeUserProvider { get; } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IRazor.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IRazor.cs deleted file mode 100644 index 10f70dcf55..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IRazor.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - public interface IRazor - { - IEnumerable NotDynamicXmlDocumentElements { get; } - - IEnumerable DataTypeModelStaticMappings { get; } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IRequestHandler.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IRequestHandler.cs index 2d550d3b49..0f3ff38413 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IRequestHandler.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IRequestHandler.cs @@ -1,4 +1,6 @@ -namespace Umbraco.Core.Configuration.UmbracoSettings +using System.Collections.Generic; + +namespace Umbraco.Core.Configuration.UmbracoSettings { public interface IRequestHandler { @@ -6,6 +8,8 @@ bool AddTrailingSlash { get; } - IUrlReplacing UrlReplacing { get; } + bool RemoveDoubleDashes { get; } + + IEnumerable CharCollection { get; } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IScripting.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IScripting.cs index 6b541b2371..3b7810958d 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IScripting.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IScripting.cs @@ -1,7 +1,11 @@ -namespace Umbraco.Core.Configuration.UmbracoSettings +using System.Collections.Generic; + +namespace Umbraco.Core.Configuration.UmbracoSettings { public interface IScripting { - IRazor Razor { get; } + IEnumerable NotDynamicXmlDocumentElements { get; } + + IEnumerable DataTypeModelStaticMappings { get; } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IUrlReplacing.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IUrlReplacing.cs deleted file mode 100644 index 54ee16a2b7..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IUrlReplacing.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - public interface IUrlReplacing - { - bool RemoveDoubleDashes { get; } - - IEnumerable CharCollection { get; } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IUserProvider.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IUserProvider.cs deleted file mode 100644 index 233a285bea..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IUserProvider.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - public interface IUserProvider - { - string DefaultBackOfficeProvider { get; } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/LoggingElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/LoggingElement.cs index a28d71e9d4..bb880af85c 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/LoggingElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/LoggingElement.cs @@ -93,6 +93,20 @@ namespace Umbraco.Core.Configuration.UmbracoSettings } } + string ILogging.ExternalLoggerAssembly + { + get { return ExternalLogger.Assembly; } + } + + string ILogging.ExternalLoggerType + { + get { return ExternalLogger.Type; } + } + + bool ILogging.ExternalLoggerEnableAuditTrail + { + get { return ExternalLogger.LogAuditTrail; } + } bool ILogging.AutoCleanLogs { @@ -124,10 +138,5 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return DisabledLogTypes; } } - IExternalLogger ILogging.ExternalLogger - { - get { return ExternalLogger; } - } - } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ProvidersElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ProvidersElement.cs index 86718c8520..76f3363f20 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ProvidersElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ProvidersElement.cs @@ -10,9 +10,9 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return (UserProviderElement)base["users"]; } } - IUserProvider IProviders.Users + public string DefaultBackOfficeUserProvider { - get { return Users; } + get { return Users.DefaultBackOfficeProvider; } } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/RazorElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/RazorElement.cs index af7f258eb3..06d0abdf76 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/RazorElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/RazorElement.cs @@ -3,7 +3,7 @@ using System.Configuration; namespace Umbraco.Core.Configuration.UmbracoSettings { - internal class RazorElement : ConfigurationElement, IRazor + internal class RazorElement : ConfigurationElement { private NotDynamicXmlDocumentElementCollection _defaultCollection; @@ -46,14 +46,5 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return (RazorStaticMappingCollection) base["dataTypeModelStaticMappings"]; } } - IEnumerable IRazor.NotDynamicXmlDocumentElements - { - get { return NotDynamicXmlDocumentElements; } - } - - IEnumerable IRazor.DataTypeModelStaticMappings - { - get { return DataTypeModelStaticMappings; } - } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/RequestHandlerElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/RequestHandlerElement.cs index 22611ba7c2..acdd2d94ea 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/RequestHandlerElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/RequestHandlerElement.cs @@ -111,9 +111,14 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return AddTrailingSlash; } } - IUrlReplacing IRequestHandler.UrlReplacing + bool IRequestHandler.RemoveDoubleDashes { - get { return UrlReplacing; } + get { return UrlReplacing.RemoveDoubleDashes; } + } + + IEnumerable IRequestHandler.CharCollection + { + get { return UrlReplacing.CharCollection; } } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ScriptingElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ScriptingElement.cs index 0b51f1e810..7de6b8b4f2 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ScriptingElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ScriptingElement.cs @@ -1,4 +1,5 @@ -using System.Configuration; +using System.Collections.Generic; +using System.Configuration; namespace Umbraco.Core.Configuration.UmbracoSettings { @@ -10,10 +11,14 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return (RazorElement) base["razor"]; } } - - IRazor IScripting.Razor + IEnumerable IScripting.NotDynamicXmlDocumentElements { - get { return Razor; } + get { return Razor.NotDynamicXmlDocumentElements; } + } + + IEnumerable IScripting.DataTypeModelStaticMappings + { + get { return Razor.DataTypeModelStaticMappings; } } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/UrlReplacingElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/UrlReplacingElement.cs index 597e15f156..f7f35e55e5 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/UrlReplacingElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/UrlReplacingElement.cs @@ -3,7 +3,7 @@ using System.Configuration; namespace Umbraco.Core.Configuration.UmbracoSettings { - internal class UrlReplacingElement : ConfigurationElement, IUrlReplacing + internal class UrlReplacingElement : ConfigurationElement { [ConfigurationProperty("removeDoubleDashes", DefaultValue = true)] internal bool RemoveDoubleDashes @@ -18,16 +18,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return (CharCollection)base[""]; } set { base[""] = value; } } - - - bool IUrlReplacing.RemoveDoubleDashes - { - get { return RemoveDoubleDashes; } - } - - IEnumerable IUrlReplacing.CharCollection - { - get { return CharCollection; } - } + } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/UserProviderElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/UserProviderElement.cs index fbff598d79..d12c937abf 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/UserProviderElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/UserProviderElement.cs @@ -2,7 +2,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { - internal class UserProviderElement : ConfigurationElement, IUserProvider + internal class UserProviderElement : ConfigurationElement { [ConfigurationProperty("DefaultBackofficeProvider")] internal InnerTextConfigurationElement DefaultBackOfficeProvider @@ -16,9 +16,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings } } - string IUserProvider.DefaultBackOfficeProvider - { - get { return DefaultBackOfficeProvider; } - } + } } \ No newline at end of file diff --git a/src/Umbraco.Core/PublishedContentHelper.cs b/src/Umbraco.Core/PublishedContentHelper.cs index 41ad058a7e..ebb7b5c083 100644 --- a/src/Umbraco.Core/PublishedContentHelper.cs +++ b/src/Umbraco.Core/PublishedContentHelper.cs @@ -174,7 +174,7 @@ namespace Umbraco.Core var documentElement = e.Name.LocalName; //TODO: See note against this setting, pretty sure we don't need this - if (UmbracoConfiguration.Current.UmbracoSettings.Scripting.Razor.NotDynamicXmlDocumentElements.Any( + if (UmbracoConfiguration.Current.UmbracoSettings.Scripting.NotDynamicXmlDocumentElements.Any( tag => string.Equals(tag.Element, documentElement, StringComparison.CurrentCultureIgnoreCase)) == false) { return new Attempt(true, new DynamicXml(e)); diff --git a/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs b/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs index 04045f25fd..d834d0f81b 100644 --- a/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs +++ b/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs @@ -57,7 +57,7 @@ namespace Umbraco.Core.Strings static void InitializeLegacyUrlReplaceCharacters() { - foreach (var node in UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.UrlReplacing.CharCollection) + foreach (var node in UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.CharCollection) { if (node.Char.IsNullOrWhiteSpace() == false) UrlReplaceCharacters[node.Char] = node.Replacement; diff --git a/src/Umbraco.Core/Strings/LegacyShortStringHelper.cs b/src/Umbraco.Core/Strings/LegacyShortStringHelper.cs index 89b454348e..5af243f234 100644 --- a/src/Umbraco.Core/Strings/LegacyShortStringHelper.cs +++ b/src/Umbraco.Core/Strings/LegacyShortStringHelper.cs @@ -205,7 +205,7 @@ function isValidAlias(alias) {{ var ext = filePath.Substring(filePath.LastIndexOf('.')); //Because the file usually is downloadable as well we check characters against 'UmbracoSettings.UrlReplaceCharacters' - foreach (var n in UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.UrlReplacing.CharCollection) + foreach (var n in UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.CharCollection) { if (n.Char.IsNullOrWhiteSpace() == false) fileNamePart = fileNamePart.Replace(n.Char, n.Replacement); @@ -468,14 +468,14 @@ function isValidAlias(alias) {{ public string LegacyFormatUrl(string url) { var newUrl = url.ToLowerInvariant(); - foreach (var n in UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.UrlReplacing.CharCollection) + foreach (var n in UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.CharCollection) { if (n.Char.IsNullOrWhiteSpace() == false) newUrl = newUrl.Replace(n.Char, n.Replacement); } // check for double dashes - if (UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.UrlReplacing.RemoveDoubleDashes) + if (UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.RemoveDoubleDashes) { newUrl = Regex.Replace(newUrl, @"[-]{2,}", "-"); } diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index da536637f7..ce26bada89 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -163,7 +163,7 @@ - + @@ -185,16 +185,14 @@ - - + - @@ -206,8 +204,6 @@ - - @@ -218,10 +214,10 @@ - - + + - + diff --git a/src/Umbraco.Core/XmlHelper.cs b/src/Umbraco.Core/XmlHelper.cs index bd488a0084..382f8975a2 100644 --- a/src/Umbraco.Core/XmlHelper.cs +++ b/src/Umbraco.Core/XmlHelper.cs @@ -78,7 +78,7 @@ namespace Umbraco.Core if (xml == null) return false; xml = xml.Trim(); if (xml.StartsWith("<") == false || xml.EndsWith(">") == false || xml.Contains('/') == false) return false; - if (UmbracoConfiguration.Current.UmbracoSettings.Scripting.Razor.NotDynamicXmlDocumentElements.Any(x => x.Element.InvariantEquals(alias))) return false; + if (UmbracoConfiguration.Current.UmbracoSettings.Scripting.NotDynamicXmlDocumentElements.Any(x => x.Element.InvariantEquals(alias))) return false; return TryCreateXPathDocument(xml, out doc); } diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/LoggingElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/LoggingElementTests.cs index 6247d0e81b..d7fc49054b 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/LoggingElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/LoggingElementTests.cs @@ -32,17 +32,17 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings [Test] public virtual void ExternalLogger_Assembly() { - Assert.IsTrue(Section.Logging.ExternalLogger.Assembly == "~/bin/assemblyFileName.dll"); + Assert.IsTrue(Section.Logging.ExternalLoggerAssembly == "~/bin/assemblyFileName.dll"); } [Test] public virtual void ExternalLogger_Type() { - Assert.IsTrue(Section.Logging.ExternalLogger.ExternalLoggerType == "fully.qualified.namespace.and.type"); + Assert.IsTrue(Section.Logging.ExternalLoggerType == "fully.qualified.namespace.and.type"); } [Test] public virtual void ExternalLogger_LogAuditTrail() { - Assert.IsTrue(Section.Logging.ExternalLogger.LogAuditTrail == false); + Assert.IsTrue(Section.Logging.ExternalLoggerEnableAuditTrail == false); } [Test] public void AutoCleanLogs() diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ProvidersElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ProvidersElementTests.cs index 77440d5dd1..2e61f92563 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ProvidersElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ProvidersElementTests.cs @@ -8,7 +8,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings [Test] public void Users() { - Assert.IsTrue(Section.Providers.Users.DefaultBackOfficeProvider == "UsersMembershipProvider"); + Assert.IsTrue(Section.Providers.DefaultBackOfficeUserProvider == "UsersMembershipProvider"); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/RequestHandlerElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/RequestHandlerElementTests.cs index ad9b6e1a40..a4c740b5d6 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/RequestHandlerElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/RequestHandlerElementTests.cs @@ -21,7 +21,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings [Test] public void RemoveDoubleDashes() { - Assert.IsTrue(Section.RequestHandler.UrlReplacing.RemoveDoubleDashes == true); + Assert.IsTrue(Section.RequestHandler.RemoveDoubleDashes == true); } [Test] @@ -29,14 +29,14 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings { var chars = @" ,"",',%,.,;,/,\,:,#,+,*,&,?,æ,ø,å,ä,ö,ü,ß,Ä,Ö,|,<,>"; var items = chars.Split(','); - Assert.AreEqual(items.Length, Section.RequestHandler.UrlReplacing.CharCollection.Count()); - Assert.IsTrue(Section.RequestHandler.UrlReplacing.CharCollection + Assert.AreEqual(items.Length, Section.RequestHandler.CharCollection.Count()); + Assert.IsTrue(Section.RequestHandler.CharCollection .All(x => items.Contains(x.Char))); var vals = @"-,plus,star,ae,oe,aa,ae,oe,ue,ss,ae,oe,-"; var splitVals = vals.Split(','); - Assert.AreEqual(splitVals.Length, Section.RequestHandler.UrlReplacing.CharCollection.Count(x => x.Replacement.IsNullOrWhiteSpace() == false)); - Assert.IsTrue(Section.RequestHandler.UrlReplacing.CharCollection + Assert.AreEqual(splitVals.Length, Section.RequestHandler.CharCollection.Count(x => x.Replacement.IsNullOrWhiteSpace() == false)); + Assert.IsTrue(Section.RequestHandler.CharCollection .All(x => string.IsNullOrEmpty(x.Replacement) || vals.Split(',').Contains(x.Replacement))); } diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ScriptingElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ScriptingElementDefaultTests.cs index e5407a8859..b3c62115f0 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ScriptingElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ScriptingElementDefaultTests.cs @@ -14,7 +14,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings [Test] public override void DataTypeModelStaticMappings() { - Assert.AreEqual(0, Section.Scripting.Razor.DataTypeModelStaticMappings.Count()); + Assert.AreEqual(0, Section.Scripting.DataTypeModelStaticMappings.Count()); } } diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ScriptingElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ScriptingElementTests.cs index 6e7da50e90..b1c127ec32 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ScriptingElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ScriptingElementTests.cs @@ -10,14 +10,14 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings [Test] public void NotDynamicXmlDocumentElements() { - Assert.IsTrue(Section.Scripting.Razor.NotDynamicXmlDocumentElements + Assert.IsTrue(Section.Scripting.NotDynamicXmlDocumentElements .All(x => "p,div,ul,span".Split(',').Contains(x.Element))); } [Test] public virtual void DataTypeModelStaticMappings() { - var mappings = Section.Scripting.Razor.DataTypeModelStaticMappings.ToArray(); + var mappings = Section.Scripting.DataTypeModelStaticMappings.ToArray(); Assert.IsTrue(mappings[0].DataTypeGuid == Guid.Parse("A3DB4034-BCB0-4E69-B3EE-DD4E6ECA74C2")); Assert.IsTrue(mappings[0].MappingName == "MyName.1"); diff --git a/src/Umbraco.Web.UI/install/steps/DefaultUser.ascx.cs b/src/Umbraco.Web.UI/install/steps/DefaultUser.ascx.cs index 768a3ab679..5407c7c52d 100644 --- a/src/Umbraco.Web.UI/install/steps/DefaultUser.ascx.cs +++ b/src/Umbraco.Web.UI/install/steps/DefaultUser.ascx.cs @@ -22,16 +22,16 @@ namespace Umbraco.Web.UI.Install.Steps if (Page.IsValid) { var u = User.GetUser(0); - var user = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].GetUser(0, true); + var user = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].GetUser(0, true); user.ChangePassword(u.GetPassword(), tb_password.Text.Trim()); // Is it using the default membership provider - if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider] is UsersMembershipProvider) + if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider] is UsersMembershipProvider) { // Save user in membership provider var umbracoUser = user as UsersMembershipUser; umbracoUser.FullName = tb_name.Text.Trim(); - Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].UpdateUser(umbracoUser); + Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].UpdateUser(umbracoUser); // Save user details u.Email = tb_email.Text.Trim(); @@ -39,7 +39,7 @@ namespace Umbraco.Web.UI.Install.Steps else { u.Name = tb_name.Text.Trim(); - if (!(Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider] is ActiveDirectoryMembershipProvider)) Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].UpdateUser(user); + if (!(Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider] is ActiveDirectoryMembershipProvider)) Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].UpdateUser(user); } // we need to update the login name here as it's set to the old name when saving the user via the membership provider! diff --git a/src/Umbraco.Web.UI/web.Template.Debug.config b/src/Umbraco.Web.UI/web.Template.Debug.config index 74226da91a..fe19fc359e 100644 --- a/src/Umbraco.Web.UI/web.Template.Debug.config +++ b/src/Umbraco.Web.UI/web.Template.Debug.config @@ -21,19 +21,25 @@
-
+
+
-
+
+
+ + + + diff --git a/src/Umbraco.Web.UI/web.Template.config b/src/Umbraco.Web.UI/web.Template.config index 7c3158d8ee..d6ce444040 100644 --- a/src/Umbraco.Web.UI/web.Template.config +++ b/src/Umbraco.Web.UI/web.Template.config @@ -5,8 +5,7 @@
-
-
+
@@ -17,6 +16,7 @@
+
@@ -24,14 +24,14 @@ + - - + diff --git a/src/Umbraco.Web/Security/WebSecurity.cs b/src/Umbraco.Web/Security/WebSecurity.cs index 79d7edd87c..4bf721a3c8 100644 --- a/src/Umbraco.Web/Security/WebSecurity.cs +++ b/src/Umbraco.Web/Security/WebSecurity.cs @@ -177,7 +177,7 @@ namespace Umbraco.Web.Security /// internal bool ValidateBackOfficeCredentials(string username, string password) { - var membershipProvider = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider]; + var membershipProvider = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider]; return membershipProvider != null && membershipProvider.ValidateUser(username, password); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs index a6a80513fe..348e4ffb81 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs @@ -517,7 +517,7 @@ namespace umbraco.presentation.channels private static bool validateUser(string username, string password) { - return Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].ValidateUser(username, password); + return Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].ValidateUser(username, password); } [XmlRpcMethod("blogger.getUsersBlogs", diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs index cffbb0d10d..17d17a5dc5 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs @@ -37,10 +37,10 @@ namespace umbraco try { // Password is auto-generated. They are they required to change the password by editing the user information. - var u = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].CreateUser(Alias, + var u = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].CreateUser(Alias, Membership.GeneratePassword( - Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].MinRequiredPasswordLength, - Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].MinRequiredNonAlphanumericCharacters), + Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].MinRequiredPasswordLength, + Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].MinRequiredNonAlphanumericCharacters), "", "", "", true, null, out status); _returnUrl = string.Format("users/EditUser.aspx?id={0}", u.ProviderUserKey); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/ChangePassword.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/ChangePassword.ascx.cs index 228f0338d2..3364a8e42a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/ChangePassword.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/ChangePassword.ascx.cs @@ -20,7 +20,7 @@ namespace umbraco.presentation.umbraco.dashboard protected void changePassword_Click(object sender, EventArgs e) { User u = User.GetCurrent(); - MembershipProvider provider = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider]; + MembershipProvider provider = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider]; MembershipUser user = provider.GetUser(u.LoginName, true); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs index d8f3cc4f4c..769c6be5df 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs @@ -70,10 +70,10 @@ namespace umbraco.cms.presentation protected void Button1_Click(object sender, System.EventArgs e) { // Authenticate users by using the provider specified in umbracoSettings.config - if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].ValidateUser(lname.Text, passw.Text)) + if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].ValidateUser(lname.Text, passw.Text)) { - if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider] is ActiveDirectoryMembershipProvider) - ActiveDirectoryMapping(lname.Text, Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].GetUser(lname.Text, false).Email); + if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider] is ActiveDirectoryMembershipProvider) + ActiveDirectoryMapping(lname.Text, Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].GetUser(lname.Text, false).Email); BusinessLogic.User u = new User(lname.Text); doLogin(u); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs index 782771318e..1ac3c93f9e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs @@ -312,7 +312,7 @@ namespace umbraco.cms.presentation.user if (!IsPostBack) { - MembershipUser user = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].GetUser(u.LoginName, true); + MembershipUser user = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].GetUser(u.LoginName, true); uname.Text = u.Name; lname.Text = (user == null) ? u.LoginName : user.UserName; email.Text = (user == null) ? u.Email : user.Email; @@ -377,7 +377,7 @@ namespace umbraco.cms.presentation.user { try { - MembershipUser user = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].GetUser(u.LoginName, true); + MembershipUser user = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].GetUser(u.LoginName, true); string tempPassword = ((controls.passwordChanger)passw.Controls[0]).Password; @@ -389,14 +389,14 @@ namespace umbraco.cms.presentation.user } // Is it using the default membership provider - if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider] is UsersMembershipProvider) + if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider] is UsersMembershipProvider) { // Save user in membership provider UsersMembershipUser umbracoUser = user as UsersMembershipUser; umbracoUser.FullName = uname.Text.Trim(); umbracoUser.Language = userLanguage.SelectedValue; umbracoUser.UserType = UserType.GetUserType(int.Parse(userType.SelectedValue)); - Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].UpdateUser(umbracoUser); + Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].UpdateUser(umbracoUser); // Save user details u.Email = email.Text.Trim(); @@ -407,7 +407,7 @@ namespace umbraco.cms.presentation.user u.Name = uname.Text.Trim(); u.Language = userLanguage.SelectedValue; u.UserType = UserType.GetUserType(int.Parse(userType.SelectedValue)); - if (!(Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider] is ActiveDirectoryMembershipProvider)) Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].UpdateUser(user); + if (!(Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider] is ActiveDirectoryMembershipProvider)) Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].UpdateUser(user); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/MediaUploader.ashx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/MediaUploader.ashx.cs index 322bc0b0ed..6746f15407 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/MediaUploader.ashx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/MediaUploader.ashx.cs @@ -223,7 +223,7 @@ namespace umbraco.presentation.umbraco.webservices if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password)) { - var mp = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider]; + var mp = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider]; if (mp != null && mp.ValidateUser(username, password)) { var user = new User(username); diff --git a/src/umbraco.MacroEngines/RazorDynamicNode/DynamicNode.cs b/src/umbraco.MacroEngines/RazorDynamicNode/DynamicNode.cs index b6f0c96d7d..f7fe7b74af 100644 --- a/src/umbraco.MacroEngines/RazorDynamicNode/DynamicNode.cs +++ b/src/umbraco.MacroEngines/RazorDynamicNode/DynamicNode.cs @@ -486,7 +486,7 @@ namespace umbraco.MacroEngines var dataType = GetDataType(propResult.ContextAlias, propResult.Alias); //now we need to map to the old object until we can clean all this nonsense up - var configMapping = UmbracoConfiguration.Current.UmbracoSettings.Scripting.Razor.DataTypeModelStaticMappings + var configMapping = UmbracoConfiguration.Current.UmbracoSettings.Scripting.DataTypeModelStaticMappings .Select(x => new RazorDataTypeModelStaticMappingItem() { DataTypeGuid = x.DataTypeGuid, @@ -812,7 +812,7 @@ namespace umbraco.MacroEngines //check that the document element is not one of the disallowed elements //allows RTE to still return as html if it's valid xhtml string documentElement = e.Name.LocalName; - if (UmbracoConfiguration.Current.UmbracoSettings.Scripting.Razor.NotDynamicXmlDocumentElements.Any(tag => + if (UmbracoConfiguration.Current.UmbracoSettings.Scripting.NotDynamicXmlDocumentElements.Any(tag => string.Equals(tag.Element, documentElement, StringComparison.CurrentCultureIgnoreCase)) == false) { result = new DynamicXml(e); diff --git a/src/umbraco.businesslogic/Log.cs b/src/umbraco.businesslogic/Log.cs index d7f644e057..7bdfe01c73 100644 --- a/src/umbraco.businesslogic/Log.cs +++ b/src/umbraco.businesslogic/Log.cs @@ -31,13 +31,13 @@ namespace umbraco.BusinessLogic if (_externalLoggerInitiated == false) { _externalLoggerInitiated = true; - if (string.IsNullOrEmpty(UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLogger.Assembly) == false - && string.IsNullOrEmpty(UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLogger.ExternalLoggerType) == false) + if (string.IsNullOrEmpty(UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerAssembly) == false + && string.IsNullOrEmpty(UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerType) == false) { try { - var assemblyPath = IOHelper.MapPath(UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLogger.Assembly); - _externalLogger = Assembly.LoadFrom(assemblyPath).CreateInstance(UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLogger.ExternalLoggerType) as Interfaces.ILog; + var assemblyPath = IOHelper.MapPath(UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerAssembly); + _externalLogger = Assembly.LoadFrom(assemblyPath).CreateInstance(UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerType) as Interfaces.ILog; } catch (Exception ee) { @@ -78,7 +78,7 @@ namespace umbraco.BusinessLogic { Instance.ExternalLogger.Add(type, user, nodeId, comment); - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLogger.LogAuditTrail == false) + if (UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerEnableAuditTrail == false) { AddLocally(type, user, nodeId, comment); } @@ -199,7 +199,7 @@ namespace umbraco.BusinessLogic public List GetAuditLogItems(int NodeId) { - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLogger.LogAuditTrail && ExternalLogger != null) + if (UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerEnableAuditTrail && ExternalLogger != null) return ExternalLogger.GetAuditLogReader(NodeId); return LogItem.ConvertIRecordsReader(SqlHelper.ExecuteReader( diff --git a/src/umbraco.businesslogic/UmbracoSettings.cs b/src/umbraco.businesslogic/UmbracoSettings.cs index c2a2c0f12a..e80d1d27ea 100644 --- a/src/umbraco.businesslogic/UmbracoSettings.cs +++ b/src/umbraco.businesslogic/UmbracoSettings.cs @@ -68,14 +68,14 @@ namespace umbraco /// public static string ExternalLoggerAssembly { - get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLogger.Assembly; } + get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerAssembly; } } /// /// Gets the type of an external logger that can be used to store log items in 3rd party systems /// public static string ExternalLoggerType { - get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLogger.ExternalLoggerType; } + get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerType; } } /// @@ -83,7 +83,7 @@ namespace umbraco /// public static bool ExternalLoggerLogAuditTrail { - get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLogger.LogAuditTrail; } + get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerEnableAuditTrail; } } /// @@ -192,14 +192,14 @@ namespace umbraco /// public static List NotDynamicXmlDocumentElements { - get { return UmbracoConfiguration.Current.UmbracoSettings.Scripting.Razor.NotDynamicXmlDocumentElements.Select(x => x.Element).ToList(); } + get { return UmbracoConfiguration.Current.UmbracoSettings.Scripting.NotDynamicXmlDocumentElements.Select(x => x.Element).ToList(); } } public static List RazorDataTypeModelStaticMapping { get { - var mapping = UmbracoConfiguration.Current.UmbracoSettings.Scripting.Razor.DataTypeModelStaticMappings; + var mapping = UmbracoConfiguration.Current.UmbracoSettings.Scripting.DataTypeModelStaticMappings; //now we need to map to the old object until we can clean all this nonsense up return mapping.Select(x => new RazorDataTypeModelStaticMappingItem() @@ -253,7 +253,7 @@ namespace umbraco public static string DefaultBackofficeProvider { - get { return UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider; } + get { return UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider; } } /// @@ -384,7 +384,7 @@ namespace umbraco /// public static bool RemoveDoubleDashesFromUrlReplacing { - get { return UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.UrlReplacing.RemoveDoubleDashes; } + get { return UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.RemoveDoubleDashes; } } ///