diff --git a/src/Umbraco.Core/Configuration/ClientDependencyConfiguration.cs b/src/Umbraco.Core/Configuration/ClientDependencyConfiguration.cs index 01fdbd17a4..c85df0be73 100644 --- a/src/Umbraco.Core/Configuration/ClientDependencyConfiguration.cs +++ b/src/Umbraco.Core/Configuration/ClientDependencyConfiguration.cs @@ -107,4 +107,4 @@ namespace Umbraco.Core.Configuration return success; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/FileSystemProviderElement.cs b/src/Umbraco.Core/Configuration/FileSystemProviderElement.cs index a1221bc0d4..144ddf3195 100644 --- a/src/Umbraco.Core/Configuration/FileSystemProviderElement.cs +++ b/src/Umbraco.Core/Configuration/FileSystemProviderElement.cs @@ -62,6 +62,6 @@ namespace Umbraco.Core.Configuration } return _params; } - } + } } } diff --git a/src/Umbraco.Core/Configuration/FileSystemProvidersSection.cs b/src/Umbraco.Core/Configuration/FileSystemProvidersSection.cs index fa32fe0885..6829ed0cd6 100644 --- a/src/Umbraco.Core/Configuration/FileSystemProvidersSection.cs +++ b/src/Umbraco.Core/Configuration/FileSystemProvidersSection.cs @@ -6,7 +6,7 @@ using System.Text; namespace Umbraco.Core.Configuration { - public class FileSystemProvidersSection : ConfigurationSection, IFileSystemProvidersSection + public class FileSystemProvidersSection : ConfigurationSection, IFileSystemProvidersSection { [ConfigurationProperty("", IsDefaultCollection = true, IsRequired = true)] @@ -15,16 +15,16 @@ namespace Umbraco.Core.Configuration get { return ((FileSystemProviderElementCollection)(base[""])); } } - private IDictionary _providers; + private IDictionary _providers; IDictionary IFileSystemProvidersSection.Providers { get { - if (_providers != null) return _providers; + if (_providers != null) return _providers; _providers = Providers.ToDictionary(x => x.Alias, x => x); return _providers; } - } + } } } diff --git a/src/Umbraco.Core/Configuration/IFileSystemProviderElement.cs b/src/Umbraco.Core/Configuration/IFileSystemProviderElement.cs index 9427f42b68..438e6f2b81 100644 --- a/src/Umbraco.Core/Configuration/IFileSystemProviderElement.cs +++ b/src/Umbraco.Core/Configuration/IFileSystemProviderElement.cs @@ -8,4 +8,4 @@ namespace Umbraco.Core.Configuration string Type { get; } IDictionary Parameters { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/IFileSystemProvidersSection.cs b/src/Umbraco.Core/Configuration/IFileSystemProvidersSection.cs index 108d5a87de..f87ba383a9 100644 --- a/src/Umbraco.Core/Configuration/IFileSystemProvidersSection.cs +++ b/src/Umbraco.Core/Configuration/IFileSystemProvidersSection.cs @@ -6,4 +6,4 @@ namespace Umbraco.Core.Configuration { IDictionary Providers { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ISecuritySection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ISecuritySection.cs index 31ee4611d0..e170f9fb2a 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ISecuritySection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ISecuritySection.cs @@ -5,7 +5,7 @@ bool KeepUserLoggedIn { get; } bool HideDisabledUsersInBackoffice { get; } - + /// /// Used to enable/disable the forgot password functionality on the back office login screen /// @@ -13,7 +13,7 @@ string AuthCookieName { get; } - string AuthCookieDomain { get; } + string AuthCookieDomain { get; } /// /// A boolean indicating that by default the email address will be the username @@ -21,7 +21,7 @@ /// /// Even if this is true and the username is different from the email in the database, the username field will still be shown. /// When this is false, the username and email fields will be shown in the user section. - /// + /// bool UsernameIsEmail { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Constants-Conventions.cs b/src/Umbraco.Core/Constants-Conventions.cs index 9674a86fd8..80260aab4e 100644 --- a/src/Umbraco.Core/Constants-Conventions.cs +++ b/src/Umbraco.Core/Constants-Conventions.cs @@ -11,13 +11,13 @@ namespace Umbraco.Core /// public static class Conventions { - internal static class PermissionCategories - { - public const string ContentCategory = "content"; - public const string AdministrationCategory = "administration"; - public const string StructureCategory = "structure"; - public const string OtherCategory = "other"; - } + internal static class PermissionCategories + { + public const string ContentCategory = "content"; + public const string AdministrationCategory = "administration"; + public const string StructureCategory = "structure"; + public const string OtherCategory = "other"; + } public static class PublicAccess { diff --git a/src/Umbraco.Core/Constants-Examine.cs b/src/Umbraco.Core/Constants-Examine.cs index ddc23fc219..e701b4ea12 100644 --- a/src/Umbraco.Core/Constants-Examine.cs +++ b/src/Umbraco.Core/Constants-Examine.cs @@ -17,7 +17,7 @@ /// /// The alias of the external content indexer /// - public const string ExternalIndexer = "ExternalIndexer"; + public const string ExternalIndexer = "ExternalIndexer"; /// /// The alias of the internal member searcher diff --git a/src/Umbraco.Core/Constants-ObjectTypes.cs b/src/Umbraco.Core/Constants-ObjectTypes.cs index 9b0cd19e00..c303068a24 100644 --- a/src/Umbraco.Core/Constants-ObjectTypes.cs +++ b/src/Umbraco.Core/Constants-ObjectTypes.cs @@ -12,7 +12,7 @@ namespace Umbraco.Core /// /// Defines the Umbraco object type unique identifiers as string. /// - /// Should be used only when it's not possible to use the corresponding + /// Should be used only when it's not possible to use the corresponding /// readonly Guid value, e.g. in attributes (where only consts can be used). public static class Strings { @@ -134,4 +134,4 @@ namespace Umbraco.Core internal static readonly Guid StylesheetProperty = new Guid(Strings.StylesheetProperty); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Constants-Security.cs b/src/Umbraco.Core/Constants-Security.cs index 71b1d912f6..e308a09ad8 100644 --- a/src/Umbraco.Core/Constants-Security.cs +++ b/src/Umbraco.Core/Constants-Security.cs @@ -19,7 +19,7 @@ namespace Umbraco.Core internal const string EmptyPasswordPrefix = "___UIDEMPTYPWORD__"; internal const string ForceReAuthFlag = "umbraco-force-auth"; - + /// /// The prefix used for external identity providers for their authentication type /// diff --git a/src/Umbraco.Core/DateTimeExtensions.cs b/src/Umbraco.Core/DateTimeExtensions.cs index 6e2676ac72..bb993b8bc9 100644 --- a/src/Umbraco.Core/DateTimeExtensions.cs +++ b/src/Umbraco.Core/DateTimeExtensions.cs @@ -41,43 +41,43 @@ namespace Umbraco.Core Hour, Minute, Second - } + } /// - /// Calculates the number of minutes from a date time, on a rolling daily basis (so if + /// Calculates the number of minutes from a date time, on a rolling daily basis (so if /// date time is before the time, calculate onto next day) /// /// Date to start from /// Time to compare against (in Hmm form, e.g. 330, 2200) - /// - public static int PeriodicMinutesFrom(this DateTime fromDateTime, string scheduledTime) - { - // Ensure time provided is 4 digits long - if (scheduledTime.Length == 3) - { - scheduledTime = "0" + scheduledTime; - } + /// + public static int PeriodicMinutesFrom(this DateTime fromDateTime, string scheduledTime) + { + // Ensure time provided is 4 digits long + if (scheduledTime.Length == 3) + { + scheduledTime = "0" + scheduledTime; + } - var scheduledHour = int.Parse(scheduledTime.Substring(0, 2)); - var scheduledMinute = int.Parse(scheduledTime.Substring(2)); + var scheduledHour = int.Parse(scheduledTime.Substring(0, 2)); + var scheduledMinute = int.Parse(scheduledTime.Substring(2)); - DateTime scheduledDateTime; - if (IsScheduledInRemainingDay(fromDateTime, scheduledHour, scheduledMinute)) - { - scheduledDateTime = new DateTime(fromDateTime.Year, fromDateTime.Month, fromDateTime.Day, scheduledHour, scheduledMinute, 0); - } - else - { - var nextDay = fromDateTime.AddDays(1); - scheduledDateTime = new DateTime(nextDay.Year, nextDay.Month, nextDay.Day, scheduledHour, scheduledMinute, 0); - } + DateTime scheduledDateTime; + if (IsScheduledInRemainingDay(fromDateTime, scheduledHour, scheduledMinute)) + { + scheduledDateTime = new DateTime(fromDateTime.Year, fromDateTime.Month, fromDateTime.Day, scheduledHour, scheduledMinute, 0); + } + else + { + var nextDay = fromDateTime.AddDays(1); + scheduledDateTime = new DateTime(nextDay.Year, nextDay.Month, nextDay.Day, scheduledHour, scheduledMinute, 0); + } - return (int)(scheduledDateTime - fromDateTime).TotalMinutes; - } + return (int)(scheduledDateTime - fromDateTime).TotalMinutes; + } - private static bool IsScheduledInRemainingDay(DateTime fromDateTime, int scheduledHour, int scheduledMinute) - { - return scheduledHour > fromDateTime.Hour || (scheduledHour == fromDateTime.Hour && scheduledMinute >= fromDateTime.Minute); + private static bool IsScheduledInRemainingDay(DateTime fromDateTime, int scheduledHour, int scheduledMinute) + { + return scheduledHour > fromDateTime.Hour || (scheduledHour == fromDateTime.Hour && scheduledMinute >= fromDateTime.Minute); } } } diff --git a/src/Umbraco.Core/EmailSender.cs b/src/Umbraco.Core/EmailSender.cs index 6f381f693c..1f2c6d8653 100644 --- a/src/Umbraco.Core/EmailSender.cs +++ b/src/Umbraco.Core/EmailSender.cs @@ -78,7 +78,7 @@ namespace Umbraco.Core client.Send(message); } } - } + } } /// @@ -99,7 +99,7 @@ namespace Umbraco.Core { get { return SendEmail != null; } } - + /// /// An event that is raised when no smtp server is configured if events are enabled /// diff --git a/src/Umbraco.Core/EnumerableExtensions.cs b/src/Umbraco.Core/EnumerableExtensions.cs index 87d73fdd4a..de8ff22e15 100644 --- a/src/Umbraco.Core/EnumerableExtensions.cs +++ b/src/Umbraco.Core/EnumerableExtensions.cs @@ -352,7 +352,7 @@ namespace Umbraco.Core { return contents.Where(x => types.Contains(x.GetType())); } - + public static IEnumerable SkipLast(this IEnumerable source) { using (var e = source.GetEnumerator()) diff --git a/src/Umbraco.Core/Events/CancellableEventArgs.cs b/src/Umbraco.Core/Events/CancellableEventArgs.cs index c82bdf9229..6f88fdcce4 100644 --- a/src/Umbraco.Core/Events/CancellableEventArgs.cs +++ b/src/Umbraco.Core/Events/CancellableEventArgs.cs @@ -36,7 +36,7 @@ namespace Umbraco.Core.Events CanCancel = canCancel; //create a standalone messages Messages = new EventMessages(); - AdditionalData = EmptyAdditionalData; + AdditionalData = EmptyAdditionalData; } public CancellableEventArgs(EventMessages eventMessages) @@ -45,7 +45,7 @@ namespace Umbraco.Core.Events public CancellableEventArgs() : this(true) - { } + { } /// /// Flag to determine if this instance will support being cancellable @@ -120,13 +120,13 @@ namespace Umbraco.Core.Events { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != GetType()) return false; + if (obj.GetType() != GetType()) return false; return Equals((CancellableEventArgs) obj); } public override int GetHashCode() { - return AdditionalData != null ? AdditionalData.GetHashCode() : 0; + return AdditionalData != null ? AdditionalData.GetHashCode() : 0; } public static bool operator ==(CancellableEventArgs left, CancellableEventArgs right) @@ -136,7 +136,7 @@ namespace Umbraco.Core.Events public static bool operator !=(CancellableEventArgs left, CancellableEventArgs right) { - return Equals(left, right) == false; + return Equals(left, right) == false; } } } diff --git a/src/Umbraco.Core/Events/MoveEventArgs.cs b/src/Umbraco.Core/Events/MoveEventArgs.cs index 8fae8a5e60..afc1f57111 100644 --- a/src/Umbraco.Core/Events/MoveEventArgs.cs +++ b/src/Umbraco.Core/Events/MoveEventArgs.cs @@ -118,13 +118,13 @@ namespace Umbraco.Core.Events if (first == null) { throw new InvalidOperationException("MoveInfoCollection must have at least one item"); - } + } - _moveInfoCollection = value; - - //assign the legacy props + _moveInfoCollection = value; + + //assign the legacy props EventObject = first.Entity; - ParentId = first.NewParentId; + ParentId = first.NewParentId; } } diff --git a/src/Umbraco.Core/Events/SendEmailEventArgs.cs b/src/Umbraco.Core/Events/SendEmailEventArgs.cs index 8c6a2138d5..7b6cfceaaf 100644 --- a/src/Umbraco.Core/Events/SendEmailEventArgs.cs +++ b/src/Umbraco.Core/Events/SendEmailEventArgs.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net.Mail; namespace Umbraco.Core.Events @@ -10,6 +10,6 @@ namespace Umbraco.Core.Events public SendEmailEventArgs(MailMessage message) { Message = message; - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/ExpressionHelper.cs b/src/Umbraco.Core/ExpressionHelper.cs index 0225dfcf2e..1d84b2b59c 100644 --- a/src/Umbraco.Core/ExpressionHelper.cs +++ b/src/Umbraco.Core/ExpressionHelper.cs @@ -218,20 +218,20 @@ namespace Umbraco.Core { if (fromExpression == null) return null; - MemberExpression me; - switch (fromExpression.Body.NodeType) - { - case ExpressionType.Convert: - case ExpressionType.ConvertChecked: - var ue = fromExpression.Body as UnaryExpression; - me = ((ue != null) ? ue.Operand : null) as MemberExpression; - break; - default: - me = fromExpression.Body as MemberExpression; - break; - } + MemberExpression me; + switch (fromExpression.Body.NodeType) + { + case ExpressionType.Convert: + case ExpressionType.ConvertChecked: + var ue = fromExpression.Body as UnaryExpression; + me = ((ue != null) ? ue.Operand : null) as MemberExpression; + break; + default: + me = fromExpression.Body as MemberExpression; + break; + } - return me != null ? me.Member : null; + return me != null ? me.Member : null; } /// diff --git a/src/Umbraco.Core/HashCodeCombiner.cs b/src/Umbraco.Core/HashCodeCombiner.cs index ebeb50fb8f..d0bb869cc8 100644 --- a/src/Umbraco.Core/HashCodeCombiner.cs +++ b/src/Umbraco.Core/HashCodeCombiner.cs @@ -11,7 +11,7 @@ namespace Umbraco.Core /// .Net has a class the same as this: System.Web.Util.HashCodeCombiner and of course it works for all sorts of things /// which we've not included here as we just need a quick easy class for this in order to create a unique /// hash of directories/files to see if they have changed. - /// + /// /// NOTE: It's probably best to not relying on the hashing result across AppDomains! If you need a constant/reliable hash value /// between AppDomains use SHA1. This is perfect for hashing things in a very fast way for a single AppDomain. /// diff --git a/src/Umbraco.Core/HashGenerator.cs b/src/Umbraco.Core/HashGenerator.cs index 7306dc9045..0f03e22a9b 100644 --- a/src/Umbraco.Core/HashGenerator.cs +++ b/src/Umbraco.Core/HashGenerator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.IO; using System.Security.Cryptography; @@ -10,8 +10,8 @@ namespace Umbraco.Core /// Used to generate a string hash using crypto libraries over multiple objects /// /// - /// This should be used to generate a reliable hash that survives AppDomain restarts. - /// This will use the crypto libs to generate the hash and will try to ensure that + /// This should be used to generate a reliable hash that survives AppDomain restarts. + /// This will use the crypto libs to generate the hash and will try to ensure that /// strings, etc... are not re-allocated so it's not consuming much memory. /// internal class HashGenerator : DisposableObject @@ -60,7 +60,7 @@ namespace Umbraco.Core //we could go a step further and s.Normalize() but we're not really dealing with crazy unicode with this class so far. if (s != null) - _writer.Write(s.ToUpperInvariant()); + _writer.Write(s.ToUpperInvariant()); } internal void AddFileSystemItem(FileSystemInfo f) @@ -73,7 +73,7 @@ namespace Umbraco.Core AddDateTime(f.CreationTimeUtc); AddDateTime(f.LastWriteTimeUtc); - //check if it is a file or folder + //check if it is a file or folder var fileInfo = f as FileInfo; if (fileInfo != null) { @@ -151,4 +151,4 @@ namespace Umbraco.Core _ms.Dispose(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/IEmailSender.cs b/src/Umbraco.Core/IEmailSender.cs index 7e6565a53b..f2c5fd744d 100644 --- a/src/Umbraco.Core/IEmailSender.cs +++ b/src/Umbraco.Core/IEmailSender.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core { Task SendAsync(MailMessage message); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ContentTypeBase.cs b/src/Umbraco.Core/Models/ContentTypeBase.cs index 772be82769..dfc94d3b2d 100644 --- a/src/Umbraco.Core/Models/ContentTypeBase.cs +++ b/src/Umbraco.Core/Models/ContentTypeBase.cs @@ -279,8 +279,8 @@ namespace Umbraco.Core.Models get { return _allowedContentTypes; } set { - SetPropertyValueAndDetectChanges(value, ref _allowedContentTypes, Ps.Value.AllowedContentTypesSelector, - Ps.Value.ContentTypeSortComparer); + SetPropertyValueAndDetectChanges(value, ref _allowedContentTypes, Ps.Value.AllowedContentTypesSelector, + Ps.Value.ContentTypeSortComparer); } } diff --git a/src/Umbraco.Core/Models/DictionaryItem.cs b/src/Umbraco.Core/Models/DictionaryItem.cs index ff1e26165f..e32bfd7f76 100644 --- a/src/Umbraco.Core/Models/DictionaryItem.cs +++ b/src/Umbraco.Core/Models/DictionaryItem.cs @@ -85,7 +85,7 @@ namespace Umbraco.Core.Models } SetPropertyValueAndDetectChanges(asArray, ref _translations, Ps.Value.TranslationsSelector, - Ps.Value.DictionaryTranslationComparer); + Ps.Value.DictionaryTranslationComparer); } } } diff --git a/src/Umbraco.Core/Models/IContent.cs b/src/Umbraco.Core/Models/IContent.cs index da02645cdb..fd8b9dbb97 100644 --- a/src/Umbraco.Core/Models/IContent.cs +++ b/src/Umbraco.Core/Models/IContent.cs @@ -89,4 +89,4 @@ namespace Umbraco.Core.Models /// bool IsBlueprint { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/UmbracoMembershipUser.cs b/src/Umbraco.Core/Models/Membership/UmbracoMembershipUser.cs index e45cec04c2..6ca2df2a38 100644 --- a/src/Umbraco.Core/Models/Membership/UmbracoMembershipUser.cs +++ b/src/Umbraco.Core/Models/Membership/UmbracoMembershipUser.cs @@ -47,4 +47,4 @@ namespace Umbraco.Core.Models.Membership #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/User.cs b/src/Umbraco.Core/Models/Membership/User.cs index b3f13629cd..9ad1c87108 100644 --- a/src/Umbraco.Core/Models/Membership/User.cs +++ b/src/Umbraco.Core/Models/Membership/User.cs @@ -421,7 +421,7 @@ namespace Umbraco.Core.Models.Membership //if the group isn't IUserGroup we'll need to look it up var realGroup = customUserGroup as IUserGroup ?? Current.Services.UserService.GetUserGroupById(customUserGroup.Id); realGroup.AddAllowedSection(sectionAlias); - //now we need to flag this for saving (hack!) + //now we need to flag this for saving (hack!) GroupsToSave.Add(realGroup); } diff --git a/src/Umbraco.Core/Models/Membership/UserGroup.cs b/src/Umbraco.Core/Models/Membership/UserGroup.cs index 6b20b07110..dc91862e77 100644 --- a/src/Umbraco.Core/Models/Membership/UserGroup.cs +++ b/src/Umbraco.Core/Models/Membership/UserGroup.cs @@ -136,4 +136,4 @@ namespace Umbraco.Core.Models.Membership public int UserCount { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Property.cs b/src/Umbraco.Core/Models/Property.cs index 697241d715..7110d428a2 100644 --- a/src/Umbraco.Core/Models/Property.cs +++ b/src/Umbraco.Core/Models/Property.cs @@ -53,7 +53,7 @@ namespace Umbraco.Core.Models { if (o == null && o1 == null) return true; - //custom comparer for strings. + //custom comparer for strings. if (o is string || o1 is string) { //if one is null and another is empty then they are the same diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyBase.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyBase.cs index fbb95ec434..8aea69a835 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyBase.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyBase.cs @@ -26,7 +26,7 @@ namespace Umbraco.Core.Models.PublishedContent case PropertyCacheLevel.Snapshot: case PropertyCacheLevel.Facade: case PropertyCacheLevel.None: - break; + break; case PropertyCacheLevel.Unknown: if (!validateUnknown) goto default; break; diff --git a/src/Umbraco.Core/Models/Rdbms/User2UserGroupDto.cs b/src/Umbraco.Core/Models/Rdbms/User2UserGroupDto.cs index 72fa1593a0..a975ac9571 100644 --- a/src/Umbraco.Core/Models/Rdbms/User2UserGroupDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/User2UserGroupDto.cs @@ -34,4 +34,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.Foreign)] // fixme public UserGroupDto UserGroupDto { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/UserGroup2AppDto.cs b/src/Umbraco.Core/Models/Rdbms/UserGroup2AppDto.cs index 13a0a4473d..ef74fcf45d 100644 --- a/src/Umbraco.Core/Models/Rdbms/UserGroup2AppDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/UserGroup2AppDto.cs @@ -16,4 +16,4 @@ namespace Umbraco.Core.Models.Rdbms [Length(50)] public string AppAlias { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/UserGroup2NodePermissionDto.cs b/src/Umbraco.Core/Models/Rdbms/UserGroup2NodePermissionDto.cs index c4782e7259..8916f9f6b1 100644 --- a/src/Umbraco.Core/Models/Rdbms/UserGroup2NodePermissionDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/UserGroup2NodePermissionDto.cs @@ -20,4 +20,4 @@ namespace Umbraco.Core.Models.Rdbms [Column("permission")] public string Permission { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/UserGroupDto.cs b/src/Umbraco.Core/Models/Rdbms/UserGroupDto.cs index fde641ecc6..64945d740a 100644 --- a/src/Umbraco.Core/Models/Rdbms/UserGroupDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/UserGroupDto.cs @@ -69,4 +69,4 @@ namespace Umbraco.Core.Models.Rdbms [ResultColumn] public int UserCount { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/UserStartNodeDto.cs b/src/Umbraco.Core/Models/Rdbms/UserStartNodeDto.cs index ecc360c24e..d19c4316d3 100644 --- a/src/Umbraco.Core/Models/Rdbms/UserStartNodeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/UserStartNodeDto.cs @@ -64,4 +64,4 @@ namespace Umbraco.Core.Models.Rdbms return !Equals(left, right); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/UserTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/UserTypeDto.cs index ab5cccb241..0ef0dee083 100644 --- a/src/Umbraco.Core/Models/Rdbms/UserTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/UserTypeDto.cs @@ -3,7 +3,7 @@ using NPoco; using Umbraco.Core.Persistence.DatabaseAnnotations; namespace Umbraco.Core.Models.Rdbms -{ +{ // fixme - remove in v8 [Obsolete("Table no longer exists as of 7.6 - retained only to support migrations from previous versions")] [TableName("umbracoUserType")] diff --git a/src/Umbraco.Core/Models/UmbracoObjectTypes.cs b/src/Umbraco.Core/Models/UmbracoObjectTypes.cs index ba5fe2f1f0..cf75d3c7cd 100644 --- a/src/Umbraco.Core/Models/UmbracoObjectTypes.cs +++ b/src/Umbraco.Core/Models/UmbracoObjectTypes.cs @@ -194,7 +194,7 @@ namespace Umbraco.Core.Models [FriendlyName("DocumentBlueprint")] [UmbracoUdiType(Constants.UdiEntityType.DocumentBluePrint)] DocumentBlueprint, - + /// /// Reserved Identifier /// @@ -203,4 +203,4 @@ namespace Umbraco.Core.Models IdReservation } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/UmbracoObjectTypesExtensions.cs b/src/Umbraco.Core/Models/UmbracoObjectTypesExtensions.cs index 9582af36d6..93582d337d 100644 --- a/src/Umbraco.Core/Models/UmbracoObjectTypesExtensions.cs +++ b/src/Umbraco.Core/Models/UmbracoObjectTypesExtensions.cs @@ -69,7 +69,7 @@ namespace Umbraco.Core.Models return UmbracoObjectTypeCache.GetOrAdd(umbracoObjectType, types => { var type = typeof (UmbracoObjectTypes); - var memberInfo = type.GetMember(umbracoObjectType.ToString()); + var memberInfo = type.GetMember(umbracoObjectType.ToString()); var attributes = memberInfo[0].GetCustomAttributes(typeof (UmbracoObjectTypeAttribute), false); if (attributes.Length == 0) diff --git a/src/Umbraco.Core/Models/UserExtensions.cs b/src/Umbraco.Core/Models/UserExtensions.cs index 269e211f1c..015ddc94f2 100644 --- a/src/Umbraco.Core/Models/UserExtensions.cs +++ b/src/Umbraco.Core/Models/UserExtensions.cs @@ -241,7 +241,7 @@ namespace Umbraco.Core.Models { hasPathAccess = true; return true; - } + } //is it self? var self = startNodePaths.Any(x => x == path); @@ -266,7 +266,7 @@ namespace Umbraco.Core.Models hasPathAccess = true; return true; } - + return false; } diff --git a/src/Umbraco.Core/Persistence/Factories/UserFactory.cs b/src/Umbraco.Core/Persistence/Factories/UserFactory.cs index 01237c3066..a3d687d6d5 100644 --- a/src/Umbraco.Core/Persistence/Factories/UserFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/UserFactory.cs @@ -7,13 +7,13 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal static class UserFactory + internal static class UserFactory { public static IUser BuildEntity(UserDto dto) { var guidId = dto.Id.ToGuid(); - - var user = new User(dto.Id, dto.UserName, dto.Email, dto.Login,dto.Password, + + var user = new User(dto.Id, dto.UserName, dto.Email, dto.Login,dto.Password, dto.UserGroupDtos.Select(x => x.ToReadOnlyGroup()).ToArray(), dto.UserStartNodeDtos.Where(x => x.StartNodeType == (int)UserStartNodeDto.StartNodeTypeValue.Content).Select(x => x.StartNode).ToArray(), dto.UserStartNodeDtos.Where(x => x.StartNodeType == (int)UserStartNodeDto.StartNodeTypeValue.Media).Select(x => x.StartNode).ToArray()); @@ -21,7 +21,7 @@ namespace Umbraco.Core.Persistence.Factories try { user.DisableChangeTracking(); - + user.Key = guidId; user.IsLockedOut = dto.NoConsole; user.IsApproved = dto.Disabled == false; @@ -52,7 +52,7 @@ namespace Umbraco.Core.Persistence.Factories public static UserDto BuildDto(IUser entity) { var dto = new UserDto - { + { Disabled = entity.IsApproved == false, Email = entity.Email, Login = entity.Username, @@ -98,6 +98,6 @@ namespace Umbraco.Core.Persistence.Factories } return dto; - } + } } } diff --git a/src/Umbraco.Core/Persistence/Factories/UserGroupFactory.cs b/src/Umbraco.Core/Persistence/Factories/UserGroupFactory.cs index f4ecffca54..dbda2a1e9d 100644 --- a/src/Umbraco.Core/Persistence/Factories/UserGroupFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/UserGroupFactory.cs @@ -19,11 +19,11 @@ namespace Umbraco.Core.Persistence.Factories try { userGroup.DisableChangeTracking(); - userGroup.Id = dto.Id; + userGroup.Id = dto.Id; userGroup.CreateDate = dto.CreateDate; - userGroup.UpdateDate = dto.UpdateDate; - userGroup.StartContentId = dto.StartContentId; - userGroup.StartMediaId = dto.StartMediaId; + userGroup.UpdateDate = dto.UpdateDate; + userGroup.StartContentId = dto.StartContentId; + userGroup.StartMediaId = dto.StartMediaId; if (dto.UserGroup2AppDtos != null) { foreach (var app in dto.UserGroup2AppDtos) @@ -77,4 +77,4 @@ namespace Umbraco.Core.Persistence.Factories } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/ISqlContext.cs b/src/Umbraco.Core/Persistence/ISqlContext.cs index 7ac28c2364..f8a6bfd0fb 100644 --- a/src/Umbraco.Core/Persistence/ISqlContext.cs +++ b/src/Umbraco.Core/Persistence/ISqlContext.cs @@ -50,4 +50,4 @@ namespace Umbraco.Core.Persistence /// IMapperCollection Mappers { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/LocalDb.cs b/src/Umbraco.Core/Persistence/LocalDb.cs index f706979e17..7b5ea196ea 100644 --- a/src/Umbraco.Core/Persistence/LocalDb.cs +++ b/src/Umbraco.Core/Persistence/LocalDb.cs @@ -381,7 +381,7 @@ namespace Umbraco.Core.Persistence // cannot use parameters on CREATE DATABASE // ie "CREATE DATABASE @0 ..." does not work SetCommand(cmd, string.Format(@" - CREATE DATABASE {0} + CREATE DATABASE {0} ON (NAME=N{1}, FILENAME={2}) LOG ON (NAME=N{3}, FILENAME={4})", QuotedName(databaseName), @@ -691,7 +691,7 @@ namespace Umbraco.Core.Persistence // cannot use parameters on CREATE DATABASE // ie "CREATE DATABASE @0 ..." does not work SetCommand(cmd, string.Format(@" - CREATE DATABASE {0} + CREATE DATABASE {0} ON (NAME=N{1}, FILENAME={2}) LOG ON (NAME=N{3}, FILENAME={4}) FOR ATTACH", @@ -929,7 +929,7 @@ namespace Umbraco.Core.Persistence } /// - /// Returns a Unicode string with the delimiters added to make the input string a valid SQL Server delimited identifier. + /// Returns a Unicode string with the delimiters added to make the input string a valid SQL Server delimited identifier. /// /// The name to quote. /// A quote character. diff --git a/src/Umbraco.Core/Persistence/Mappers/ExternalLoginMapper.cs b/src/Umbraco.Core/Persistence/Mappers/ExternalLoginMapper.cs index c1b07a8117..222da7380e 100644 --- a/src/Umbraco.Core/Persistence/Mappers/ExternalLoginMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/ExternalLoginMapper.cs @@ -1,4 +1,4 @@ -using System.Collections.Concurrent; +using System.Collections.Concurrent; using Umbraco.Core.Models.Identity; using Umbraco.Core.Models.Rdbms; @@ -29,4 +29,4 @@ namespace Umbraco.Core.Persistence.Mappers #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/UserGroupMapper.cs b/src/Umbraco.Core/Persistence/Mappers/UserGroupMapper.cs index 31237fd977..d7c42c3d18 100644 --- a/src/Umbraco.Core/Persistence/Mappers/UserGroupMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/UserGroupMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(IUserGroup))] @@ -37,4 +37,4 @@ namespace Umbraco.Core.Persistence.Mappers #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/UserMapper.cs b/src/Umbraco.Core/Persistence/Mappers/UserMapper.cs index cda559633d..04cf278693 100644 --- a/src/Umbraco.Core/Persistence/Mappers/UserMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/UserMapper.cs @@ -20,7 +20,7 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.RawPasswordValue, dto => dto.Password); CacheMap(src => src.Name, dto => dto.UserName); //NOTE: This column in the db is *not* used! - //CacheMap(src => src.DefaultPermissions, dto => dto.DefaultPermissions); + //CacheMap(src => src.DefaultPermissions, dto => dto.DefaultPermissions); CacheMap(src => src.IsApproved, dto => dto.Disabled); CacheMap(src => src.IsLockedOut, dto => dto.NoConsole); CacheMap(src => src.Language, dto => dto.UserLanguage); diff --git a/src/Umbraco.Core/Persistence/Mappers/UserTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/UserTypeMapper.cs index eab01769b7..ee493a327e 100644 --- a/src/Umbraco.Core/Persistence/Mappers/UserTypeMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/UserTypeMapper.cs @@ -25,4 +25,4 @@ // } // } //} -// fixme remoev this file \ No newline at end of file +// fixme remoev this file diff --git a/src/Umbraco.Core/Persistence/Migrations/IMigrationContext.cs b/src/Umbraco.Core/Persistence/Migrations/IMigrationContext.cs index 858eb3f1c7..30e3ac52b8 100644 --- a/src/Umbraco.Core/Persistence/Migrations/IMigrationContext.cs +++ b/src/Umbraco.Core/Persistence/Migrations/IMigrationContext.cs @@ -11,7 +11,7 @@ namespace Umbraco.Core.Persistence.Migrations ILogger Logger { get; } - ILocalMigration GetLocalMigration(); + ILocalMigration GetLocalMigration(); ISqlContext SqlContext { get; } } diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs index f083b46ea6..3d6880e143 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs @@ -196,18 +196,18 @@ namespace Umbraco.Core.Persistence.Migrations.Initial private void CreateUmbracoUserGroup2AppData() { _database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Content }); - _database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Developer }); + _database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Developer }); _database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Media }); _database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Members }); - _database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Settings }); + _database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Settings }); _database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Users }); - _database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Forms }); - - _database.Insert(new UserGroup2AppDto { UserGroupId = 2, AppAlias = Constants.Applications.Content }); + _database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Forms }); + + _database.Insert(new UserGroup2AppDto { UserGroupId = 2, AppAlias = Constants.Applications.Content }); _database.Insert(new UserGroup2AppDto { UserGroupId = 3, AppAlias = Constants.Applications.Content }); _database.Insert(new UserGroup2AppDto { UserGroupId = 3, AppAlias = Constants.Applications.Media }); - _database.Insert(new UserGroup2AppDto { UserGroupId = 3, AppAlias = Constants.Applications.Forms }); + _database.Insert(new UserGroup2AppDto { UserGroupId = 3, AppAlias = Constants.Applications.Forms }); _database.Insert(new UserGroup2AppDto { UserGroupId = 4, AppAlias = Constants.Applications.Translation }); } diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/AddUserGroupTables.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/AddUserGroupTables.cs index df0b71987a..18f6fe5f90 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/AddUserGroupTables.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/AddUserGroupTables.cs @@ -182,7 +182,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZe INNER JOIN umbracoUser2UserGroup u2ug ON u2ug.userGroupId = ug.id INNER JOIN umbracoUser u ON u.id = u2ug.userId INNER JOIN umbracoUser2app u2a ON u2a." + SqlSyntax.GetQuotedColumnName("user") + @" = u.id - WHERE u.id = 0"); + WHERE u.id = 0"); // Add the default section access to the other built-in accounts // writer: @@ -289,8 +289,8 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZe SELECT 'permissionGroupFor' + userLogin, 'Migrated Permission Group for ' + userLogin FROM umbracoUser WHERE (id IN ( - SELECT userid - FROM umbracoUser2NodePermission + SELECT userid + FROM umbracoUser2NodePermission )) AND id > 0"); @@ -307,10 +307,10 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZe INNER JOIN umbracoUser2UserGroup u2ug ON u2ug.userGroupId = ug.id INNER JOIN umbracoUser u ON u.id = u2ug.userId INNER JOIN umbracoUser2NodePermission u2np ON u2np.userId = u.id - WHERE ug.userGroupAlias {0} NOT IN ( - SELECT userTypeAlias {0} - FROM umbracoUserType - )", _collateSyntax)); + WHERE ug.userGroupAlias {0} NOT IN ( + SELECT userTypeAlias {0} + FROM umbracoUserType + )", _collateSyntax)); // Create app permissions on the groups Execute.Sql(string.Format(@"INSERT INTO umbracoUserGroup2app (userGroupId,app) @@ -319,10 +319,10 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZe INNER JOIN umbracoUser2UserGroup u2ug ON u2ug.userGroupId = ug.id INNER JOIN umbracoUser u ON u.id = u2ug.userId INNER JOIN umbracoUser2app u2a ON u2a." + SqlSyntax.GetQuotedColumnName("user") + @" = u.id - WHERE ug.userGroupAlias {0} NOT IN ( - SELECT userTypeAlias {0} - FROM umbracoUserType - )", _collateSyntax)); + WHERE ug.userGroupAlias {0} NOT IN ( + SELECT userTypeAlias {0} + FROM umbracoUserType + )", _collateSyntax)); } private void DeleteOldTables(List tables, Tuple[] constraints) @@ -354,4 +354,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZe } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/AddUserStartNodeTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/AddUserStartNodeTable.cs index 8ec8a5d541..b647cbbd9d 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/AddUserStartNodeTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/AddUserStartNodeTable.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZero @@ -40,4 +40,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZe WHERE startMediaID IS NOT NULL AND startMediaID > 0 AND startMediaID IN (SELECT id FROM umbracoNode WHERE nodeObjectType='" + Constants.ObjectTypes.Media + "')"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/EnsureContentTemplatePermissions.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/EnsureContentTemplatePermissions.cs index f20dbecd60..504384338a 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/EnsureContentTemplatePermissions.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/EnsureContentTemplatePermissions.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZero @@ -27,9 +27,9 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZe foreach (var userGroup in userGroups) { - if (userGroup.DefaultPermissions.Contains('ï') == false) + if (userGroup.DefaultPermissions.Contains('�') == false) { - userGroup.DefaultPermissions += "ï"; + userGroup.DefaultPermissions += "�"; local.Update.Table("umbracoUserGroup") .Set(new { userGroupDefaultPermissions = userGroup.DefaultPermissions }) .Where(new { id = userGroup.Id }); @@ -40,4 +40,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZe }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/ReduceDictionaryKeyColumnsSize.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/ReduceDictionaryKeyColumnsSize.cs index 048d03aeeb..aade0500d8 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/ReduceDictionaryKeyColumnsSize.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/ReduceDictionaryKeyColumnsSize.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Persistence.SqlSyntax; namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZero @@ -43,4 +43,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZe }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/UpdateUserTables.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/UpdateUserTables.cs index 512404113d..7ab9ff8006 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/UpdateUserTables.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSevenZero/UpdateUserTables.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using System.Web.Security; using Newtonsoft.Json; using Umbraco.Core.Persistence.DatabaseModelDefinitions; @@ -47,4 +47,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZe } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/IQuery.cs b/src/Umbraco.Core/Persistence/Querying/IQuery.cs index 6b48ad5313..d4c1d83f8a 100644 --- a/src/Umbraco.Core/Persistence/Querying/IQuery.cs +++ b/src/Umbraco.Core/Persistence/Querying/IQuery.cs @@ -31,7 +31,7 @@ namespace Umbraco.Core.Persistence.Querying /// /// This instance so calls to this method are chainable IQuery WhereIn(Expression> fieldSelector, IEnumerable values); - + /// /// Adds a set of OR-ed where clauses to the query. /// diff --git a/src/Umbraco.Core/Persistence/Repositories/ContentBlueprintRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ContentBlueprintRepository.cs index 2c70c2474e..227e5e7170 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ContentBlueprintRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ContentBlueprintRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Cache; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.Logging; @@ -26,4 +26,4 @@ namespace Umbraco.Core.Persistence.Repositories protected override Guid NodeObjectTypeId => Constants.ObjectTypes.DocumentBlueprint; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/DataTypeDefinitionRepository.cs b/src/Umbraco.Core/Persistence/Repositories/DataTypeDefinitionRepository.cs index 318bab773a..ffb4687586 100644 --- a/src/Umbraco.Core/Persistence/Repositories/DataTypeDefinitionRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/DataTypeDefinitionRepository.cs @@ -219,7 +219,7 @@ AND umbracoNode.id <> @id", throw new DuplicateNameException("A data type with the name " + entity.Name + " already exists"); } - //Updates Modified date + //Updates Modified date ((DataTypeDefinition)entity).UpdatingEntity(); //Look up parent to get and set the correct Path if ParentId has changed diff --git a/src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs b/src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs index 5e8a5c84c5..acfaee8f95 100644 --- a/src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs @@ -251,15 +251,15 @@ namespace Umbraco.Core.Persistence.Repositories public virtual IEnumerable GetAll(Guid objectTypeId, params int[] ids) { - return ids.Any() - ? PerformGetAll(objectTypeId, sql => sql.Where(" umbracoNode.id in (@ids)", new { ids })) + return ids.Any() + ? PerformGetAll(objectTypeId, sql => sql.Where(" umbracoNode.id in (@ids)", new { ids })) : PerformGetAll(objectTypeId); } public virtual IEnumerable GetAll(Guid objectTypeId, params Guid[] keys) { - return keys.Any() - ? PerformGetAll(objectTypeId, sql => sql.Where(" umbracoNode.uniqueID in (@keys)", new { keys })) + return keys.Any() + ? PerformGetAll(objectTypeId, sql => sql.Where(" umbracoNode.uniqueID in (@keys)", new { keys })) : PerformGetAll(objectTypeId); } diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDictionaryRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDictionaryRepository.cs index d4cbde17ee..351320395b 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDictionaryRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDictionaryRepository.cs @@ -11,4 +11,4 @@ namespace Umbraco.Core.Persistence.Repositories IEnumerable GetDictionaryItemDescendants(Guid? parentId); Dictionary GetDictionaryItemKeyMap(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserGroupRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserGroupRepository.cs index c75e2bdb41..b5bd7d0f1f 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserGroupRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserGroupRepository.cs @@ -57,4 +57,4 @@ namespace Umbraco.Core.Persistence.Repositories /// Specify the nodes to replace permissions for void AssignGroupPermission(int groupId, char permission, params int[] entityIds); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserRepository.cs index 1e2c0f8229..c371070809 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserRepository.cs @@ -23,7 +23,7 @@ namespace Umbraco.Core.Persistence.Repositories /// /// bool Exists(string username); - + /// /// Gets a list of objects associated with a given group /// @@ -56,7 +56,7 @@ namespace Umbraco.Core.Persistence.Repositories /// IEnumerable GetPagedResultsByQuery(IQuery query, long pageIndex, int pageSize, out long totalRecords, Expression> orderBy, Direction orderDirection = Direction.Ascending, - string[] includeUserGroups = null, string[] excludeUserGroups = null, UserState[] userState = null, + string[] includeUserGroups = null, string[] excludeUserGroups = null, UserState[] userState = null, IQuery filter = null); /// @@ -76,7 +76,7 @@ namespace Umbraco.Core.Persistence.Repositories /// /// /// - /// This is only used for a shim in order to upgrade to 7.7 + /// This is only used for a shim in order to upgrade to 7.7 /// /// /// A non cached instance @@ -85,6 +85,6 @@ namespace Umbraco.Core.Persistence.Repositories IProfile GetProfile(string username); IProfile GetProfile(int id); - IDictionary GetUserStates(); + IDictionary GetUserStates(); } } diff --git a/src/Umbraco.Core/Persistence/Repositories/MemberGroupRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MemberGroupRepository.cs index f8936f413d..17f3aa8b61 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MemberGroupRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MemberGroupRepository.cs @@ -178,7 +178,7 @@ namespace Umbraco.Core.Persistence.Repositories .On("member.id = cmsMember2MemberGroup.Member") .Where("un.nodeObjectType=@objectType", new {objectType = NodeObjectTypeId }) .Where("member.LoginName=@loginName", new {loginName = username}); - + return Database.Fetch(sql) .DistinctBy(dto => dto.NodeId) .Select(x => _modelFactory.BuildEntity(x)); diff --git a/src/Umbraco.Core/Persistence/Repositories/SimilarNodeName.cs b/src/Umbraco.Core/Persistence/Repositories/SimilarNodeName.cs index 371f73b27f..8b8b2d3658 100644 --- a/src/Umbraco.Core/Persistence/Repositories/SimilarNodeName.cs +++ b/src/Umbraco.Core/Persistence/Repositories/SimilarNodeName.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; @@ -109,4 +109,4 @@ namespace Umbraco.Core.Persistence.Repositories return uniqueing ? string.Concat(nodeName, " (", uniqueNumber.ToString(), ")") : nodeName; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/UserGroupRepository.cs b/src/Umbraco.Core/Persistence/Repositories/UserGroupRepository.cs index eba18fbc77..189a5adcb9 100644 --- a/src/Umbraco.Core/Persistence/Repositories/UserGroupRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/UserGroupRepository.cs @@ -457,4 +457,4 @@ namespace Umbraco.Core.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/UserRepository.cs b/src/Umbraco.Core/Persistence/Repositories/UserRepository.cs index 667a102972..edf54333ee 100644 --- a/src/Umbraco.Core/Persistence/Repositories/UserRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/UserRepository.cs @@ -120,9 +120,9 @@ namespace Umbraco.Core.Persistence.Repositories public IDictionary GetUserStates() { - var sql = @"SELECT '1CountOfAll' AS colName, COUNT(id) AS num FROM umbracoUser + var sql = @"SELECT '1CountOfAll' AS colName, COUNT(id) AS num FROM umbracoUser UNION -SELECT '2CountOfActive' AS colName, COUNT(id) AS num FROM umbracoUser WHERE userDisabled = 0 AND userNoConsole = 0 AND lastLoginDate IS NOT NULL +SELECT '2CountOfActive' AS colName, COUNT(id) AS num FROM umbracoUser WHERE userDisabled = 0 AND userNoConsole = 0 AND lastLoginDate IS NOT NULL UNION SELECT '3CountOfDisabled' AS colName, COUNT(id) AS num FROM umbracoUser WHERE userDisabled = 1 UNION @@ -642,20 +642,20 @@ ORDER BY colName"; if (includeUserGroups != null && includeUserGroups.Length > 0) { const string subQuery = @"AND (umbracoUser.id IN (SELECT DISTINCT umbracoUser.id - FROM umbracoUser - INNER JOIN umbracoUser2UserGroup ON umbracoUser2UserGroup.userId = umbracoUser.id - INNER JOIN umbracoUserGroup ON umbracoUserGroup.id = umbracoUser2UserGroup.userGroupId - WHERE umbracoUserGroup.userGroupAlias IN (@userGroups)))"; + FROM umbracoUser + INNER JOIN umbracoUser2UserGroup ON umbracoUser2UserGroup.userId = umbracoUser.id + INNER JOIN umbracoUserGroup ON umbracoUserGroup.id = umbracoUser2UserGroup.userGroupId + WHERE umbracoUserGroup.userGroupAlias IN (@userGroups)))"; filterSql.Append(subQuery, new { userGroups = includeUserGroups }); } if (excludeUserGroups != null && excludeUserGroups.Length > 0) { var subQuery = @"AND (umbracoUser.id NOT IN (SELECT DISTINCT umbracoUser.id - FROM umbracoUser - INNER JOIN umbracoUser2UserGroup ON umbracoUser2UserGroup.userId = umbracoUser.id - INNER JOIN umbracoUserGroup ON umbracoUserGroup.id = umbracoUser2UserGroup.userGroupId - WHERE umbracoUserGroup.userGroupAlias IN (@userGroups)))"; + FROM umbracoUser + INNER JOIN umbracoUser2UserGroup ON umbracoUser2UserGroup.userId = umbracoUser.id + INNER JOIN umbracoUserGroup ON umbracoUserGroup.id = umbracoUser2UserGroup.userGroupId + WHERE umbracoUserGroup.userGroupAlias IN (@userGroups)))"; filterSql.Append(subQuery, new { userGroups = excludeUserGroups }); } diff --git a/src/Umbraco.Core/Persistence/SqlTemplate.cs b/src/Umbraco.Core/Persistence/SqlTemplate.cs index e61ed9d996..ffe0ca99e1 100644 --- a/src/Umbraco.Core/Persistence/SqlTemplate.cs +++ b/src/Umbraco.Core/Persistence/SqlTemplate.cs @@ -47,4 +47,4 @@ namespace Umbraco.Core.Persistence return new Sql(_sqlContext, _sql, args); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/SqlTemplates.cs b/src/Umbraco.Core/Persistence/SqlTemplates.cs index 255fade615..06c985232e 100644 --- a/src/Umbraco.Core/Persistence/SqlTemplates.cs +++ b/src/Umbraco.Core/Persistence/SqlTemplates.cs @@ -27,4 +27,4 @@ namespace Umbraco.Core.Persistence return _templates[key] = new SqlTemplate(_sqlContext, sql.SQL, sql.Arguments); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/ActiveDirectoryBackOfficeUserPasswordChecker.cs b/src/Umbraco.Core/Security/ActiveDirectoryBackOfficeUserPasswordChecker.cs index 25bf983d29..41028e38b3 100644 --- a/src/Umbraco.Core/Security/ActiveDirectoryBackOfficeUserPasswordChecker.cs +++ b/src/Umbraco.Core/Security/ActiveDirectoryBackOfficeUserPasswordChecker.cs @@ -21,7 +21,7 @@ namespace Umbraco.Core.Security bool isValid; using (var pc = new PrincipalContext(ContextType.Domain, ActiveDirectoryDomain)) { - isValid = pc.ValidateCredentials(user.UserName, password); + isValid = pc.ValidateCredentials(user.UserName, password); } if (isValid && user.HasIdentity == false) diff --git a/src/Umbraco.Core/Security/BackOfficeClaimsIdentityFactory.cs b/src/Umbraco.Core/Security/BackOfficeClaimsIdentityFactory.cs index 0beba534d9..86c9e17447 100644 --- a/src/Umbraco.Core/Security/BackOfficeClaimsIdentityFactory.cs +++ b/src/Umbraco.Core/Security/BackOfficeClaimsIdentityFactory.cs @@ -33,7 +33,7 @@ namespace Umbraco.Core.Security Username = user.UserName, RealName = user.Name, AllowedApplications = user.AllowedSections, - Culture = user.Culture, + Culture = user.Culture, Roles = user.Roles.Select(x => x.RoleId).ToArray(), StartContentNodes = user.CalculatedContentStartNodeIds, StartMediaNodes = user.CalculatedMediaStartNodeIds, diff --git a/src/Umbraco.Core/Security/BackOfficeSignInManager.cs b/src/Umbraco.Core/Security/BackOfficeSignInManager.cs index 79d6d637c9..a6c0ae6b49 100644 --- a/src/Umbraco.Core/Security/BackOfficeSignInManager.cs +++ b/src/Umbraco.Core/Security/BackOfficeSignInManager.cs @@ -103,12 +103,12 @@ namespace Umbraco.Core.Security } var user = await UserManager.FindByNameAsync(userName); - + //if the user is null, create an empty one which can be used for auto-linking - if (user == null) - user = BackOfficeIdentityUser.CreateNew(userName, null, GlobalSettings.DefaultUILanguage); - - //check the password for the user, this will allow a developer to auto-link + if (user == null) + user = BackOfficeIdentityUser.CreateNew(userName, null, GlobalSettings.DefaultUILanguage); + + //check the password for the user, this will allow a developer to auto-link //an account if they have specified an IBackOfficeUserPasswordChecker if (await UserManager.CheckPasswordAsync(user, password)) { @@ -131,7 +131,7 @@ namespace Umbraco.Core.Security if (await UserManager.IsLockedOutAsync(user.Id)) { //at this point we've just locked the user out after too many failed login attempts - + if (requestContext != null) { var backofficeUserManager = requestContext.GetBackOfficeUserManager(); @@ -142,7 +142,7 @@ namespace Umbraco.Core.Security return SignInStatus.LockedOut; } } - + if (requestContext != null) { var backofficeUserManager = requestContext.GetBackOfficeUserManager(); @@ -151,7 +151,7 @@ namespace Umbraco.Core.Security } return SignInStatus.Failure; - } + } /// /// Borrowed from Micorosoft's underlying sign in manager which is not flexible enough to tell it to use a different cookie type diff --git a/src/Umbraco.Core/Security/BackOfficeUserManager.cs b/src/Umbraco.Core/Security/BackOfficeUserManager.cs index bcfcbb49d8..865f3f27cc 100644 --- a/src/Umbraco.Core/Security/BackOfficeUserManager.cs +++ b/src/Umbraco.Core/Security/BackOfficeUserManager.cs @@ -83,7 +83,7 @@ namespace Umbraco.Core.Security manager.InitUserManager(manager, membershipProvider, contentSectionConfig, options); return manager; } - + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Use the overload specifying all dependencies instead")] public static BackOfficeUserManager Create( @@ -118,7 +118,7 @@ namespace Umbraco.Core.Security [Obsolete("Use the overload specifying all dependencies instead")] protected void InitUserManager( BackOfficeUserManager manager, - MembershipProviderBase membershipProvider, + MembershipProviderBase membershipProvider, IdentityFactoryOptions options) { InitUserManager(manager, membershipProvider, UmbracoConfig.For.UmbracoSettings().Content, options); @@ -346,7 +346,7 @@ namespace Umbraco.Core.Security } #region Overrides for password logic - + /// /// Logic used to validate a username and password /// @@ -442,7 +442,7 @@ namespace Umbraco.Core.Security await UpdateSecurityStampInternal(user); return IdentityResult.Success; - + } /// @@ -510,9 +510,9 @@ namespace Umbraco.Core.Security RaiseResetAccessFailedCountEvent(userId); return await UpdateAsync(user); } - - + + public override Task AccessFailedAsync(int userId) { diff --git a/src/Umbraco.Core/Security/BackOfficeUserStore.cs b/src/Umbraco.Core/Security/BackOfficeUserStore.cs index 74839d966a..dd862ea715 100644 --- a/src/Umbraco.Core/Security/BackOfficeUserStore.cs +++ b/src/Umbraco.Core/Security/BackOfficeUserStore.cs @@ -78,7 +78,7 @@ namespace Umbraco.Core.Security if (user == null) throw new ArgumentNullException(nameof(user)); //the password must be 'something' it could be empty if authenticating - // with an external provider so we'll just generate one and prefix it, the + // with an external provider so we'll just generate one and prefix it, the // prefix will help us determine if the password hasn't actually been specified yet. //this will hash the guid with a salt so should be nicely random var aspHasher = new PasswordHasher(); @@ -95,7 +95,7 @@ namespace Umbraco.Core.Security }; UpdateMemberProperties(userEntity, user); - + //TODO: We should deal with Roles --> User Groups here which we currently are not doing _userService.Save(userEntity); @@ -200,7 +200,7 @@ namespace Umbraco.Core.Security return await Task.FromResult(result); } - + /// /// Set the user password hash /// @@ -226,7 +226,7 @@ namespace Umbraco.Core.Security { ThrowIfDisposed(); if (user == null) throw new ArgumentNullException(nameof(user)); - + return Task.FromResult(user.PasswordHash); } @@ -621,7 +621,7 @@ namespace Umbraco.Core.Security private bool UpdateMemberProperties(IUser user, BackOfficeIdentityUser identityUser) { var anythingChanged = false; - + //don't assign anything if nothing has changed as this will trigger the track changes of the model if (identityUser.IsPropertyDirty("LastLoginDateUtc") @@ -633,7 +633,7 @@ namespace Umbraco.Core.Security } if (identityUser.IsPropertyDirty("EmailConfirmed") || (user.EmailConfirmedDate.HasValue && user.EmailConfirmedDate.Value != default(DateTime) && identityUser.EmailConfirmed == false) - || ((user.EmailConfirmedDate.HasValue == false || user.EmailConfirmedDate.Value == default(DateTime)) && identityUser.EmailConfirmed)) + || ((user.EmailConfirmedDate.HasValue == false || user.EmailConfirmedDate.Value == default(DateTime)) && identityUser.EmailConfirmed)) { anythingChanged = true; user.EmailConfirmedDate = identityUser.EmailConfirmed ? (DateTime?)DateTime.Now : null; @@ -736,7 +736,7 @@ namespace Umbraco.Core.Security identityUser.Groups = groups; } } - + //we should re-set the calculated start nodes identityUser.CalculatedMediaStartNodeIds = user.CalculateMediaStartNodeIds(_entityService); identityUser.CalculatedContentStartNodeIds = user.CalculateContentStartNodeIds(_entityService); diff --git a/src/Umbraco.Core/Security/BackOfficeUserValidator.cs b/src/Umbraco.Core/Security/BackOfficeUserValidator.cs index 58319e95a7..dd73d76ec4 100644 --- a/src/Umbraco.Core/Security/BackOfficeUserValidator.cs +++ b/src/Umbraco.Core/Security/BackOfficeUserValidator.cs @@ -1,4 +1,4 @@ -using System.Threading.Tasks; +using System.Threading.Tasks; using Microsoft.AspNet.Identity; using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Models.Identity; @@ -26,4 +26,4 @@ namespace Umbraco.Core.Security return IdentityResult.Success; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/EmailService.cs b/src/Umbraco.Core/Security/EmailService.cs index 51d1b82207..f6e32409cf 100644 --- a/src/Umbraco.Core/Security/EmailService.cs +++ b/src/Umbraco.Core/Security/EmailService.cs @@ -14,7 +14,7 @@ namespace Umbraco.Core.Security { private readonly string _notificationEmailAddress; private readonly IEmailSender _defaultEmailSender; - + public EmailService(string notificationEmailAddress, IEmailSender defaultEmailSender) { _notificationEmailAddress = notificationEmailAddress; diff --git a/src/Umbraco.Core/Security/IBackOfficeUserPasswordChecker.cs b/src/Umbraco.Core/Security/IBackOfficeUserPasswordChecker.cs index ccd4263f67..210e3109ab 100644 --- a/src/Umbraco.Core/Security/IBackOfficeUserPasswordChecker.cs +++ b/src/Umbraco.Core/Security/IBackOfficeUserPasswordChecker.cs @@ -16,10 +16,10 @@ namespace Umbraco.Core.Security /// /// /// - /// This will allow a developer to auto-link a local account which is required if the user queried doesn't exist locally. + /// This will allow a developer to auto-link a local account which is required if the user queried doesn't exist locally. /// The user parameter will always contain the username, if the user doesn't exist locally, the other properties will not be filled in. /// A developer can then create a local account by filling in the properties and using UserManager.CreateAsync /// Task CheckPasswordAsync(BackOfficeIdentityUser user, string password); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/IMembershipProviderPasswordHasher.cs b/src/Umbraco.Core/Security/IMembershipProviderPasswordHasher.cs index 42715d280a..2333f310bc 100644 --- a/src/Umbraco.Core/Security/IMembershipProviderPasswordHasher.cs +++ b/src/Umbraco.Core/Security/IMembershipProviderPasswordHasher.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Identity; +using Microsoft.AspNet.Identity; namespace Umbraco.Core.Security { @@ -9,4 +9,4 @@ namespace Umbraco.Core.Security { MembershipProviderBase MembershipProvider { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/IUserAwarePasswordHasher.cs b/src/Umbraco.Core/Security/IUserAwarePasswordHasher.cs index cea4d5a144..7e1321eec5 100644 --- a/src/Umbraco.Core/Security/IUserAwarePasswordHasher.cs +++ b/src/Umbraco.Core/Security/IUserAwarePasswordHasher.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.AspNet.Identity; namespace Umbraco.Core.Security @@ -15,4 +15,4 @@ namespace Umbraco.Core.Security string HashPassword(TUser user, string password); PasswordVerificationResult VerifyHashedPassword(TUser user, string hashedPassword, string providedPassword); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/MachineKeyGenerator.cs b/src/Umbraco.Core/Security/MachineKeyGenerator.cs index 9dd06f44bd..283ca1ac3a 100644 --- a/src/Umbraco.Core/Security/MachineKeyGenerator.cs +++ b/src/Umbraco.Core/Security/MachineKeyGenerator.cs @@ -36,9 +36,9 @@ namespace Umbraco.Core.Security //See: https://msdn.microsoft.com/en-us/library/vstudio/w8h3skw9%28v=vs.100%29.aspx?f=255&MSPPError=-2147217396 //See: https://msdn.microsoft.com/en-us/library/ff649308.aspx?f=255&MSPPError=-2147217396 /* - key value Specifies a manually assigned key. - The validationKey value must be manually set to a string of hexadecimal - characters to ensure consistent configuration across all servers in a Web farm. + key value Specifies a manually assigned key. + The validationKey value must be manually set to a string of hexadecimal + characters to ensure consistent configuration across all servers in a Web farm. The length of the key depends on the hash algorithm that is used: AES requires a 256-bit key (64 hexadecimal characters). @@ -58,12 +58,12 @@ namespace Umbraco.Core.Security { //See: //See: https://msdn.microsoft.com/en-us/library/vstudio/w8h3skw9%28v=vs.100%29.aspx?f=255&MSPPError=-2147217396 /* - key value Specifies a manually assigned key. - The decryptionKey value must be manually set to a string of - hexadecimal characters to ensure consistent configuration across all servers in a Web farm. - The key should be 64 bits (16 hexadecimal characters) long for DES encryption, or 192 bits - (48 hexadecimal characters) long for 3DES. For AES, the key can be 128 bits (32 characters), - 192 bits (48 characters), or 256 bits (64 characters) long. + key value Specifies a manually assigned key. + The decryptionKey value must be manually set to a string of + hexadecimal characters to ensure consistent configuration across all servers in a Web farm. + The key should be 64 bits (16 hexadecimal characters) long for DES encryption, or 192 bits + (48 hexadecimal characters) long for 3DES. For AES, the key can be 128 bits (32 characters), + 192 bits (48 characters), or 256 bits (64 characters) long. */ //64 in length = 256 bits @@ -83,4 +83,4 @@ namespace Umbraco.Core.Security return sb.ToString(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/MembershipProviderPasswordHasher.cs b/src/Umbraco.Core/Security/MembershipProviderPasswordHasher.cs index f518f99c55..ba2f226750 100644 --- a/src/Umbraco.Core/Security/MembershipProviderPasswordHasher.cs +++ b/src/Umbraco.Core/Security/MembershipProviderPasswordHasher.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Identity; +using Microsoft.AspNet.Identity; namespace Umbraco.Core.Security { @@ -31,4 +31,4 @@ namespace Umbraco.Core.Security } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/MembershipProviderPasswordValidator.cs b/src/Umbraco.Core/Security/MembershipProviderPasswordValidator.cs index 3331116b4e..9a1b3c5ae8 100644 --- a/src/Umbraco.Core/Security/MembershipProviderPasswordValidator.cs +++ b/src/Umbraco.Core/Security/MembershipProviderPasswordValidator.cs @@ -35,4 +35,4 @@ namespace Umbraco.Core.Security return IdentityResult.Success; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs b/src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs index 1341a2ed64..f9f3da77b9 100644 --- a/src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs +++ b/src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs @@ -49,7 +49,7 @@ namespace Umbraco.Core.Security throw new InvalidOperationException("Cannot create a " + typeof(UmbracoBackOfficeIdentity) + " from " + typeof(ClaimsIdentity) + " since there are missing required claims"); int[] startContentIdsAsInt; - int[] startMediaIdsAsInt; + int[] startMediaIdsAsInt; if (startContentId.DetectIsJson() == false || startMediaId.DetectIsJson() == false) throw new InvalidOperationException("Cannot create a " + typeof(UmbracoBackOfficeIdentity) + " from " + typeof(ClaimsIdentity) + " since the data is not formatted correctly - either content or media start Ids are not JSON"); @@ -61,7 +61,7 @@ namespace Umbraco.Core.Security catch (Exception e) { throw new InvalidOperationException("Cannot create a " + typeof(UmbracoBackOfficeIdentity) + " from " + typeof(ClaimsIdentity) + " since the data is not formatted correctly - either content or media start Ids could not be parsed as JSON", e); - } + } var roles = identity.FindAll(x => x.Type == DefaultRoleClaimType).Select(role => role.Value).ToList(); var allowedApps = identity.FindAll(x => x.Type == Constants.Security.AllowedApplicationsClaimType).Select(app => app.Value).ToList(); diff --git a/src/Umbraco.Core/Security/UmbracoEmailMessage.cs b/src/Umbraco.Core/Security/UmbracoEmailMessage.cs index 9ef6205ebf..0a81b2299b 100644 --- a/src/Umbraco.Core/Security/UmbracoEmailMessage.cs +++ b/src/Umbraco.Core/Security/UmbracoEmailMessage.cs @@ -14,4 +14,4 @@ namespace Umbraco.Core.Security MailSender = mailSender; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/UserAwareMembershipProviderPasswordHasher.cs b/src/Umbraco.Core/Security/UserAwareMembershipProviderPasswordHasher.cs index 7d19d72c3c..7fecb30fba 100644 --- a/src/Umbraco.Core/Security/UserAwareMembershipProviderPasswordHasher.cs +++ b/src/Umbraco.Core/Security/UserAwareMembershipProviderPasswordHasher.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.AspNet.Identity; using Umbraco.Core.Models.Identity; @@ -27,4 +27,4 @@ namespace Umbraco.Core.Security return base.VerifyHashedPassword(hashedPassword, providedPassword); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/UserData.cs b/src/Umbraco.Core/Security/UserData.cs index c67c39f811..9f80343ace 100644 --- a/src/Umbraco.Core/Security/UserData.cs +++ b/src/Umbraco.Core/Security/UserData.cs @@ -46,13 +46,13 @@ namespace Umbraco.Core.Security [DataMember(Name = "name")] public string RealName { get; set; } - + /// /// The start nodes on the UserData object for the auth ticket contains all of the user's start nodes including ones assigned to their user groups /// [DataMember(Name = "startContent")] public int[] StartContentNodes { get; set; } - + /// /// The start nodes on the UserData object for the auth ticket contains all of the user's start nodes including ones assigned to their user groups /// diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index 799677ba3d..42f604c9e6 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -973,7 +973,7 @@ namespace Umbraco.Core.Services using (var uow = UowProvider.CreateUnitOfWork(readOnly: true)) { var sql = uow.SqlContext.Sql(@" - SELECT id + SELECT id FROM umbracoNode JOIN cmsDocument ON umbracoNode.id=cmsDocument.nodeId AND cmsDocument.published=@0 WHERE umbracoNode.trashed=@1 AND umbracoNode.id IN (@2)", diff --git a/src/Umbraco.Core/Services/FileService.cs b/src/Umbraco.Core/Services/FileService.cs index 4524af2de5..ec29b7ca38 100644 --- a/src/Umbraco.Core/Services/FileService.cs +++ b/src/Umbraco.Core/Services/FileService.cs @@ -627,12 +627,12 @@ namespace Umbraco.Core.Services uow.Complete(); return; } - + repository.Delete(template); args.CanCancel = false; uow.Events.Dispatch(DeletedTemplate, this, args); - + Audit(uow, AuditType.Delete, "Delete Template performed by user", userId, template.Id); uow.Complete(); } @@ -823,7 +823,7 @@ namespace Umbraco.Core.Services var repository = uow.CreatePartialViewRepository(partialViewType); if (partialViewContent != null) partialView.Content = partialViewContent; repository.AddOrUpdate(partialView); - + newEventArgs.CanCancel = false; uow.Events.Dispatch(CreatedPartialView, this, newEventArgs); diff --git a/src/Umbraco.Core/Services/IContentService.cs b/src/Umbraco.Core/Services/IContentService.cs index b8f6b93ea6..1f1866eadc 100644 --- a/src/Umbraco.Core/Services/IContentService.cs +++ b/src/Umbraco.Core/Services/IContentService.cs @@ -18,7 +18,7 @@ namespace Umbraco.Core.Services { //TODO: Remove this class in v8 - //TODO: There's probably more that needs to be added like the EmptyRecycleBin, etc... + //TODO: There's probably more that needs to be added like the EmptyRecycleBin, etc... /// /// Saves a single object @@ -153,7 +153,7 @@ namespace Umbraco.Core.Services /// Alias of the /// Optional id of the user creating the content /// - IContent CreateContent(string name, Guid parentId, string contentTypeAlias, int userId = 0); + IContent CreateContent(string name, Guid parentId, string contentTypeAlias, int userId = 0); /// /// Creates an object using the alias of the diff --git a/src/Umbraco.Core/Services/IContentTypeService.cs b/src/Umbraco.Core/Services/IContentTypeService.cs index e7a2b60608..3474efa509 100644 --- a/src/Umbraco.Core/Services/IContentTypeService.cs +++ b/src/Umbraco.Core/Services/IContentTypeService.cs @@ -29,7 +29,7 @@ namespace Umbraco.Core.Services /// Returns all content type Ids for the aliases given /// /// - /// + /// IEnumerable GetAllContentTypeIds(string[] aliases); } } diff --git a/src/Umbraco.Core/Services/IEntityService.cs b/src/Umbraco.Core/Services/IEntityService.cs index 3255be1886..5b9fdef86a 100644 --- a/src/Umbraco.Core/Services/IEntityService.cs +++ b/src/Umbraco.Core/Services/IEntityService.cs @@ -28,7 +28,7 @@ namespace Umbraco.Core.Services /// /// /// - Attempt GetIdForKey(Guid key, UmbracoObjectTypes umbracoObjectType); + Attempt GetIdForKey(Guid key, UmbracoObjectTypes umbracoObjectType); /// /// Returns the integer id for a given Udi diff --git a/src/Umbraco.Core/Services/ILocalizationService.cs b/src/Umbraco.Core/Services/ILocalizationService.cs index 98cc167092..4cc66450f8 100644 --- a/src/Umbraco.Core/Services/ILocalizationService.cs +++ b/src/Umbraco.Core/Services/ILocalizationService.cs @@ -136,11 +136,11 @@ namespace Umbraco.Core.Services /// to delete /// Optional id of the user deleting the language void Delete(ILanguage language, int userId = 0); - + /// /// Gets the full dictionary key map. /// /// The full dictionary key map. Dictionary GetDictionaryItemKeyMap(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IMediaService.cs b/src/Umbraco.Core/Services/IMediaService.cs index e8ab4624a8..90b933c411 100644 --- a/src/Umbraco.Core/Services/IMediaService.cs +++ b/src/Umbraco.Core/Services/IMediaService.cs @@ -82,7 +82,7 @@ namespace Umbraco.Core.Services /// Alias of the /// Optional id of the user creating the media item /// - IMedia CreateMedia(string name, Guid parentId, string mediaTypeAlias, int userId = 0); + IMedia CreateMedia(string name, Guid parentId, string mediaTypeAlias, int userId = 0); /// /// Creates an object using the alias of the diff --git a/src/Umbraco.Core/Services/IMemberService.cs b/src/Umbraco.Core/Services/IMemberService.cs index 7dc6d355c0..a9394126f8 100644 --- a/src/Umbraco.Core/Services/IMemberService.cs +++ b/src/Umbraco.Core/Services/IMemberService.cs @@ -95,13 +95,13 @@ namespace Umbraco.Core.Services IMember CreateMemberWithIdentity(string username, string email, string name, IMemberType memberType); /// - /// This is simply a helper method which essentially just wraps the MembershipProvider's ChangePassword method which can be + /// This is simply a helper method which essentially just wraps the MembershipProvider's ChangePassword method which can be /// used during Member creation. /// /// - /// This method exists so that Umbraco developers can use one entry point to create/update + /// This method exists so that Umbraco developers can use one entry point to create/update /// this will not work for updating members in most cases (depends on your membership provider settings) - /// + /// /// It is preferred to use the membership APIs for working with passwords, in the near future this method will be obsoleted /// and the ASP.NET Identity APIs should be used instead. /// diff --git a/src/Umbraco.Core/Services/IMembershipMemberService.cs b/src/Umbraco.Core/Services/IMembershipMemberService.cs index e6f3d62421..23d0fc2765 100644 --- a/src/Umbraco.Core/Services/IMembershipMemberService.cs +++ b/src/Umbraco.Core/Services/IMembershipMemberService.cs @@ -128,7 +128,7 @@ namespace Umbraco.Core.Services /// /// Gets the default MemberType alias /// - /// By default we'll return the 'writer', but we need to check it exists. If it doesn't we'll + /// By default we'll return the 'writer', but we need to check it exists. If it doesn't we'll /// return the first type that is not an admin, otherwise if there's only one we will return that one. /// Alias of the default MemberType string GetDefaultMemberType(); diff --git a/src/Umbraco.Core/Services/IUserService.cs b/src/Umbraco.Core/Services/IUserService.cs index 3694de5b5e..8c22cffff7 100644 --- a/src/Umbraco.Core/Services/IUserService.cs +++ b/src/Umbraco.Core/Services/IUserService.cs @@ -35,8 +35,8 @@ namespace Umbraco.Core.Services /// /// IEnumerable GetAll(long pageIndex, int pageSize, out long totalRecords, - string orderBy, Direction orderDirection, - UserState[] userState = null, + string orderBy, Direction orderDirection, + UserState[] userState = null, string[] includeUserGroups = null, string[] excludeUserGroups = null, IQuery filter = null); @@ -52,7 +52,7 @@ namespace Umbraco.Core.Services /// /// /// A filter to only include user that belong to these user groups - /// + /// /// /// IEnumerable GetAll(long pageIndex, int pageSize, out long totalRecords, @@ -97,7 +97,7 @@ namespace Umbraco.Core.Services /// /// Id of the user to retrieve /// - IUser GetUserById(int id); + IUser GetUserById(int id); /// /// Gets a users by Id @@ -134,7 +134,7 @@ namespace Umbraco.Core.Services /// /// Specifiying nothing will return all permissions for all nodes /// An enumerable list of - EntityPermissionCollection GetPermissions(IUserGroup[] groups, bool fallbackToDefaultPermissions, params int[] nodeIds); + EntityPermissionCollection GetPermissions(IUserGroup[] groups, bool fallbackToDefaultPermissions, params int[] nodeIds); /// /// Gets the implicit/inherited permissions for the user for the given path @@ -155,10 +155,10 @@ namespace Umbraco.Core.Services /// /// Replaces the same permission set for a single group to any number of entities - /// + /// /// Id of the group /// - /// Permissions as enumerable list of , + /// Permissions as enumerable list of , /// if no permissions are specified then all permissions for this node are removed for this group /// /// Specify the nodes to replace permissions for. If nothing is specified all permissions are removed. @@ -187,7 +187,7 @@ namespace Umbraco.Core.Services /// IEnumerable GetAllNotInGroup(int groupId); - #region User groups + #region User groups /// /// Gets all UserGroups or those specified as parameters @@ -195,7 +195,7 @@ namespace Umbraco.Core.Services /// Optional Ids of UserGroups to retrieve /// An enumerable list of IEnumerable GetAllUserGroups(params int[] ids); - + /// /// Gets a UserGroup by its Alias /// @@ -222,10 +222,10 @@ namespace Umbraco.Core.Services /// /// UserGroup to save /// - /// If null than no changes are made to the users who are assigned to this group, however if a value is passed in + /// If null than no changes are made to the users who are assigned to this group, however if a value is passed in /// than all users will be removed from this group and only these users will be added /// - /// Optional parameter to raise events. + /// Optional parameter to raise events. /// Default is True otherwise set to False to not raise events void Save(IUserGroup userGroup, int[] userIds = null, bool raiseEvents = true); diff --git a/src/Umbraco.Core/Services/IdkMap.cs b/src/Umbraco.Core/Services/IdkMap.cs index 3dcfe02983..e293bfe0b0 100644 --- a/src/Umbraco.Core/Services/IdkMap.cs +++ b/src/Umbraco.Core/Services/IdkMap.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading; using Umbraco.Core.Models; @@ -10,7 +10,7 @@ namespace Umbraco.Core.Services { private readonly IScopeUnitOfWorkProvider _uowProvider; private readonly ReaderWriterLockSlim _locker = new ReaderWriterLockSlim(); - + private readonly Dictionary> _id2Key = new Dictionary>(); private readonly Dictionary> _key2Id = new Dictionary>(); @@ -179,7 +179,7 @@ namespace Umbraco.Core.Services { private readonly T _id; private readonly UmbracoObjectTypes _umbracoObjectType; - + public T Id { get { return _id; } @@ -197,4 +197,4 @@ namespace Umbraco.Core.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/MacroService.cs b/src/Umbraco.Core/Services/MacroService.cs index e36483609a..662d7235aa 100644 --- a/src/Umbraco.Core/Services/MacroService.cs +++ b/src/Umbraco.Core/Services/MacroService.cs @@ -127,8 +127,8 @@ namespace Umbraco.Core.Services { using (var uow = UowProvider.CreateUnitOfWork()) { - var saveEventArgs = new SaveEventArgs(macro); - if (uow.Events.DispatchCancelable(Saving, this, saveEventArgs)) + var saveEventArgs = new SaveEventArgs(macro); + if (uow.Events.DispatchCancelable(Saving, this, saveEventArgs)) { uow.Complete(); return; @@ -141,7 +141,7 @@ namespace Umbraco.Core.Services var repository = uow.CreateRepository(); repository.AddOrUpdate(macro); - saveEventArgs.CanCancel = false; + saveEventArgs.CanCancel = false; uow.Events.Dispatch(Saved, this, saveEventArgs); Audit(uow, AuditType.Save, "Save Macro performed by user", userId, -1); diff --git a/src/Umbraco.Core/Services/MediaServiceExtensions.cs b/src/Umbraco.Core/Services/MediaServiceExtensions.cs index 41e0ebe55e..68924bc58b 100644 --- a/src/Umbraco.Core/Services/MediaServiceExtensions.cs +++ b/src/Umbraco.Core/Services/MediaServiceExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Models; @@ -37,4 +37,4 @@ namespace Umbraco.Core.Services return mediaService.CreateMedia(name, parent, mediaTypeAlias, userId); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/PackagingService.cs b/src/Umbraco.Core/Services/PackagingService.cs index 854fac6889..8761434d3d 100644 --- a/src/Umbraco.Core/Services/PackagingService.cs +++ b/src/Umbraco.Core/Services/PackagingService.cs @@ -78,9 +78,9 @@ namespace Umbraco.Core.Services } protected IQuery Query() => _uowProvider.ScopeProvider.SqlContext.Query(); - + #region Content - + /// /// Exports an item to xml as an /// diff --git a/src/Umbraco.Core/Services/UserService.cs b/src/Umbraco.Core/Services/UserService.cs index 309e9a5096..1a76be9e9a 100644 --- a/src/Umbraco.Core/Services/UserService.cs +++ b/src/Umbraco.Core/Services/UserService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data.Common; @@ -191,7 +191,7 @@ namespace Umbraco.Core.Services using (var uow = UowProvider.CreateUnitOfWork(readOnly: true)) { var repository = uow.CreateRepository(); - + try { return repository.GetByUsername(username, includeSecurityData: true); @@ -312,7 +312,7 @@ namespace Umbraco.Core.Services //Now we have to check for backwards compat hacks, we'll need to process any groups //to save first before we update the user since these groups might be new groups. - var explicitUser = entity as User; + var explicitUser = entity as User; if (explicitUser != null && explicitUser.GroupsToSave.Count > 0) { var groupRepository = uow.CreateRepository(); @@ -863,7 +863,7 @@ namespace Umbraco.Core.Services /// /// UserGroup to save /// - /// If null than no changes are made to the users who are assigned to this group, however if a value is passed in + /// If null than no changes are made to the users who are assigned to this group, however if a value is passed in /// than all users will be removed from this group and only these users will be added /// /// Optional parameter to raise events. @@ -1083,8 +1083,8 @@ namespace Umbraco.Core.Services if (byGroup.Value.TryGetValue(pathId, out permissionsForNodeAndGroup) == false) continue; - //In theory there will only be one EntityPermission in this group - // but there's nothing stopping the logic of this method + //In theory there will only be one EntityPermission in this group + // but there's nothing stopping the logic of this method // from having more so we deal with it here foreach (var entityPermission in permissionsForNodeAndGroup) { @@ -1120,7 +1120,7 @@ namespace Umbraco.Core.Services /// Returns the resulting permission set for a group for the path based on all permissions provided for the branch /// /// - /// The collective set of permissions provided to calculate the resulting permissions set for the path + /// The collective set of permissions provided to calculate the resulting permissions set for the path /// based on a single group /// /// Must be ordered deepest to shallowest (right to left) diff --git a/src/Umbraco.Core/StringExtensions.cs b/src/Umbraco.Core/StringExtensions.cs index 14208548ed..752e6d9de9 100644 --- a/src/Umbraco.Core/StringExtensions.cs +++ b/src/Umbraco.Core/StringExtensions.cs @@ -52,7 +52,7 @@ namespace Umbraco.Core .Reverse() .ToArray(); return nodeIds; - } + } /// /// Removes new lines and tabs @@ -1391,14 +1391,14 @@ namespace Umbraco.Core /// /// The namespace for URLs (from RFC 4122, Appendix C). - /// + /// /// See RFC 4122 /// internal static readonly Guid UrlNamespace = new Guid("6ba7b811-9dad-11d1-80b4-00c04fd430c8"); /// /// Creates a name-based UUID using the algorithm from RFC 4122 §4.3. - /// + /// /// See GuidUtility.cs for original implementation. /// /// The ID of the namespace. diff --git a/src/Umbraco.Core/Udi.cs b/src/Umbraco.Core/Udi.cs index b5dede2b2e..c7297b8c09 100644 --- a/src/Umbraco.Core/Udi.cs +++ b/src/Umbraco.Core/Udi.cs @@ -99,7 +99,7 @@ namespace Umbraco.Core /// An Udi instance that contains the value that was parsed. /// /// If is true, and the string could not be parsed because - /// the entity type was not known, the method succeeds but sets udito an + /// the entity type was not known, the method succeeds but sets udito an /// value. /// If is true, assemblies are not scanned for types, /// and therefore only builtin types may be known. Unless scanning already took place. @@ -298,7 +298,7 @@ namespace Umbraco.Core throw new ArgumentException(string.Format("Unknown entity type \"{0}\".", entityType), "entityType"); if (udiType != UdiType.GuidUdi) - throw new InvalidOperationException(string.Format("Entity type \"{0}\" does not have guid udis.", entityType)); + throw new InvalidOperationException(string.Format("Entity type \"{0}\" does not have guid udis.", entityType)); if (id == default(Guid)) throw new ArgumentException("Cannot be an empty guid.", "id"); diff --git a/src/Umbraco.Tests/Migrations/Upgrades/BaseUpgradeTest.cs b/src/Umbraco.Tests/Migrations/Upgrades/BaseUpgradeTest.cs index f2d5504dfb..e619c5dcd3 100644 --- a/src/Umbraco.Tests/Migrations/Upgrades/BaseUpgradeTest.cs +++ b/src/Umbraco.Tests/Migrations/Upgrades/BaseUpgradeTest.cs @@ -30,7 +30,7 @@ namespace Umbraco.Tests.Migrations.Upgrades DatabaseSpecificSetUp(); } - [Test] + [Test] [NUnit.Framework.Ignore("remove in v8")] // fixme remove in v8 public virtual void Can_Upgrade_From_470_To_600() { diff --git a/src/Umbraco.Tests/Misc/HashGeneratorTests.cs b/src/Umbraco.Tests/Misc/HashGeneratorTests.cs index b1c3fedf92..1b79494164 100644 --- a/src/Umbraco.Tests/Misc/HashGeneratorTests.cs +++ b/src/Umbraco.Tests/Misc/HashGeneratorTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Reflection; using NUnit.Framework; @@ -181,4 +181,4 @@ namespace Umbraco.Tests.Misc } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/UserExtensionsTests.cs b/src/Umbraco.Tests/Models/UserExtensionsTests.cs index 14d8bb5f17..60c91a7743 100644 --- a/src/Umbraco.Tests/Models/UserExtensionsTests.cs +++ b/src/Umbraco.Tests/Models/UserExtensionsTests.cs @@ -100,4 +100,4 @@ namespace Umbraco.Tests.Models Assert.Fail("Expected \"" + string.Join(",", expectedA) + "\" but got \"" + string.Join(",", combinedA) + "\"."); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs index da6d96e1ff..35653095aa 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs @@ -77,7 +77,7 @@ namespace Umbraco.Tests.Persistence.Repositories udb.EnableSqlCount = false; udb.EnableSqlCount = true; - //now get by GUID, this won't be cached yet because the default repo key is not a GUID + //now get by GUID, this won't be cached yet because the default repo key is not a GUID found = repository.Get(media.Key); var sqlCount = udb.SqlCount; Assert.Greater(sqlCount, 0); diff --git a/src/Umbraco.Tests/Persistence/Repositories/UserGroupRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/UserGroupRepositoryTest.cs index 7b018a3eb7..591a9085eb 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/UserGroupRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/UserGroupRepositoryTest.cs @@ -423,4 +423,4 @@ namespace Umbraco.Tests.Persistence.Repositories return new IUserGroup[] { userGroup1, userGroup2, userGroup3 }; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Plugins/PluginManagerTests.cs b/src/Umbraco.Tests/Plugins/PluginManagerTests.cs index 5258eb0e86..f1c9de8c9f 100644 --- a/src/Umbraco.Tests/Plugins/PluginManagerTests.cs +++ b/src/Umbraco.Tests/Plugins/PluginManagerTests.cs @@ -204,7 +204,7 @@ AnotherContentFinder //ensure they are all found Assert.IsTrue(plugins.Result.ContainsAll(shouldContain)); } - + [Test] public void Get_Plugins_Hash() { diff --git a/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueConverterTests.cs b/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueConverterTests.cs index aff3291e91..084f180dc5 100644 --- a/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueConverterTests.cs +++ b/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueConverterTests.cs @@ -98,7 +98,7 @@ namespace Umbraco.Tests.PropertyEditors var result = converter.ConvertInterToObject(null, null, PropertyCacheLevel.Unknown, inter, false); Assert.AreEqual(expected, result); - } + } [TestCase("1", 1)] [TestCase("1", 1)] diff --git a/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlTests.cs index b932912242..579ad76be7 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlTests.cs @@ -1,5 +1,5 @@ -using System; -using System.Globalization; +using System; +using System.Globalization; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Tests.TestHelpers; @@ -108,7 +108,7 @@ namespace Umbraco.Tests.Routing { var umbracoContext = GetUmbracoContext(urlString); var facadeRouter = CreateFacadeRouter(); - var frequest = facadeRouter.CreateRequest(umbracoContext); + var frequest = facadeRouter.CreateRequest(umbracoContext); frequest.Domain = new DomainAndUri(new Domain(1, "mysite", -1, CultureInfo.CurrentCulture, false), new Uri("http://mysite/")); var lookup = new ContentFinderByNiceUrl(Logger); SettingsForTests.HideTopLevelNodeFromPath = false; @@ -135,7 +135,7 @@ namespace Umbraco.Tests.Routing { var umbracoContext = GetUmbracoContext(urlString); var facadeRouter = CreateFacadeRouter(); - var frequest = facadeRouter.CreateRequest(umbracoContext); + var frequest = facadeRouter.CreateRequest(umbracoContext); frequest.Domain = new DomainAndUri(new Domain(1, "mysite/æøå", -1, CultureInfo.CurrentCulture, false), new Uri("http://mysite/æøå")); var lookup = new ContentFinderByNiceUrl(Logger); SettingsForTests.HideTopLevelNodeFromPath = false; diff --git a/src/Umbraco.Tests/Services/MemberServiceTests.cs b/src/Umbraco.Tests/Services/MemberServiceTests.cs index a3d740bab0..310302c887 100644 --- a/src/Umbraco.Tests/Services/MemberServiceTests.cs +++ b/src/Umbraco.Tests/Services/MemberServiceTests.cs @@ -37,7 +37,7 @@ namespace Umbraco.Tests.Services ((MemberService)ServiceContext.MemberService).MembershipProvider = provider; } - + [Test] public void Can_Set_Password_On_New_Member() { @@ -50,7 +50,7 @@ namespace Umbraco.Tests.Services Assert.IsTrue(member.RawPasswordValue.StartsWith(Constants.Security.EmptyPasswordPrefix)); ServiceContext.MemberService.SavePassword(member, "hello123456$!"); - + var foundMember = ServiceContext.MemberService.GetById(member.Id); Assert.IsNotNull(foundMember); Assert.AreNotEqual("hello123456$!", foundMember.RawPasswordValue); diff --git a/src/Umbraco.Tests/Services/SectionServiceTests.cs b/src/Umbraco.Tests/Services/SectionServiceTests.cs index 6e6f871dd2..83f8645a04 100644 --- a/src/Umbraco.Tests/Services/SectionServiceTests.cs +++ b/src/Umbraco.Tests/Services/SectionServiceTests.cs @@ -67,4 +67,4 @@ namespace Umbraco.Tests.Services return ServiceContext.UserService.GetUserById(user.Id); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs index c4346ba50c..be64ecbbd6 100644 --- a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs +++ b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs @@ -27,7 +27,7 @@ namespace Umbraco.Tests.Strings var helper = Current.ShortStringHelper; Assert.IsInstanceOf(helper); } - + [TestCase("hello", "world", false)] [TestCase("hello", "hello", true)] [TestCase("hellohellohellohellohellohellohello", "hellohellohellohellohellohellohelloo", false)] diff --git a/src/Umbraco.Tests/TestHelpers/ControllerTesting/AuthenticateEverythingExtensions.cs b/src/Umbraco.Tests/TestHelpers/ControllerTesting/AuthenticateEverythingExtensions.cs index f7d457f0d1..c812eeb41d 100644 --- a/src/Umbraco.Tests/TestHelpers/ControllerTesting/AuthenticateEverythingExtensions.cs +++ b/src/Umbraco.Tests/TestHelpers/ControllerTesting/AuthenticateEverythingExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Owin.Extensions; using Owin; @@ -15,4 +15,4 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting return app; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/ControllerTesting/AuthenticateEverythingMiddleware.cs b/src/Umbraco.Tests/TestHelpers/ControllerTesting/AuthenticateEverythingMiddleware.cs index 0cfcb47ade..b45f25c0eb 100644 --- a/src/Umbraco.Tests/TestHelpers/ControllerTesting/AuthenticateEverythingMiddleware.cs +++ b/src/Umbraco.Tests/TestHelpers/ControllerTesting/AuthenticateEverythingMiddleware.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Microsoft.Owin; using Microsoft.Owin.Security; @@ -31,7 +31,7 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting Roles = new[] { "admin" }, AllowedApplications = new[] { "content", "media", "members" }, Culture = "en-US", - RealName = "Admin", + RealName = "Admin", Username = "admin" }); @@ -52,4 +52,4 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/ControllerTesting/SpecificAssemblyResolver.cs b/src/Umbraco.Tests/TestHelpers/ControllerTesting/SpecificAssemblyResolver.cs index b301952c92..a31637981b 100644 --- a/src/Umbraco.Tests/TestHelpers/ControllerTesting/SpecificAssemblyResolver.cs +++ b/src/Umbraco.Tests/TestHelpers/ControllerTesting/SpecificAssemblyResolver.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Reflection; using System.Web.Http.Dispatcher; @@ -18,4 +18,4 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting return _assemblies; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivator.cs b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivator.cs index 81cdeccbfe..73762d4e91 100644 --- a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivator.cs +++ b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net.Http; using System.Web.Http; using Umbraco.Web; @@ -12,11 +12,11 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting public TestControllerActivator(Func factory) { _factory = factory; - } + } protected override ApiController CreateController(Type controllerType, HttpRequestMessage msg, UmbracoHelper helper) { return _factory(msg, helper); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs index 10f01dad0a..31cec1451a 100644 --- a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs +++ b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -46,7 +46,7 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting return base.Create(request, controllerDescriptor, controllerType); var owinContext = request.TryGetOwinContext().Result; - + var mockedUserService = Mock.Of(); var mockedContentService = Mock.Of(); var mockedMediaService = Mock.Of(); @@ -85,12 +85,12 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting //httpcontext with an auth'd user var httpContext = Mock.Of( http => http.User == owinContext.Authentication.User - //ensure the request exists with a cookies collection + //ensure the request exists with a cookies collection && http.Request == Mock.Of(r => r.Cookies == new HttpCookieCollection()) - //ensure the request exists with an items collection + //ensure the request exists with an items collection && http.Items == Mock.Of()); //chuck it into the props since this is what MS does when hosted and it's needed there - request.Properties["MS_HttpContext"] = httpContext; + request.Properties["MS_HttpContext"] = httpContext; var backofficeIdentity = (UmbracoBackOfficeIdentity) owinContext.Authentication.User.Identity; @@ -118,7 +118,7 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting //mock Validate webSecurity.Setup(x => x.ValidateCurrentUser()) - .Returns(() => true); + .Returns(() => true); webSecurity.Setup(x => x.UserHasSectionAccess(It.IsAny(), It.IsAny())) .Returns(() => true); @@ -140,7 +140,7 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting Mock.Of(section => section.WebRouting == Mock.Of(routingSection => routingSection.UrlProviderMode == UrlProviderMode.Auto.ToString())), Enumerable.Empty(), true); //replace it - + var urlHelper = new Mock(); urlHelper.Setup(provider => provider.GetUrl(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Returns("/hello/world/1234"); @@ -165,4 +165,4 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting protected abstract ApiController CreateController(Type controllerType, HttpRequestMessage msg, UmbracoHelper helper); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestRunner.cs b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestRunner.cs index 5399a87503..f64e8cb545 100644 --- a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestRunner.cs +++ b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestRunner.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net; using System.Net.Http; using System.Net.Http.Headers; @@ -76,4 +76,4 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting Console.Out.WriteLine(result); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestStartup.cs b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestStartup.cs index 0f23de3412..6ba6b672db 100644 --- a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestStartup.cs +++ b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestStartup.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net.Http; using System.Web.Http; using System.Web.Http.Dispatcher; @@ -26,7 +26,7 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting } public void Configuration(IAppBuilder app) - { + { var httpConfig = new HttpConfiguration(); //TODO: Enable this if you can't see the errors produced @@ -42,13 +42,13 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting httpConfig.Services.Replace(typeof (IAssembliesResolver), new SpecificAssemblyResolver(new[] { typeof (UsersController).Assembly })); httpConfig.Services.Replace(typeof (IHttpControllerActivator), new TestControllerActivator(_controllerFactory)); httpConfig.Services.Replace(typeof (IHttpControllerSelector), new NamespaceHttpControllerSelector(httpConfig)); - + //auth everything - app.AuthenticateEverything(); + app.AuthenticateEverything(); _initialize(httpConfig); app.UseWebApi(httpConfig); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TraceExceptionLogger.cs b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TraceExceptionLogger.cs index faf5870cbb..de7bd8fc10 100644 --- a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TraceExceptionLogger.cs +++ b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TraceExceptionLogger.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Web.Http.ExceptionHandling; namespace Umbraco.Tests.TestHelpers.ControllerTesting @@ -13,4 +13,4 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting Trace.TraceError(context.ExceptionContext.Exception.ToString()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedUserGroup.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedUserGroup.cs index 920c84f3c3..9e20133de5 100644 --- a/src/Umbraco.Tests/TestHelpers/Entities/MockedUserGroup.cs +++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedUserGroup.cs @@ -29,4 +29,4 @@ namespace Umbraco.Tests.TestHelpers.Entities return group; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs b/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs index ec1f5e57d0..7c75003378 100644 --- a/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs +++ b/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs @@ -63,7 +63,7 @@ namespace Umbraco.Tests.TestHelpers settings.Setup(x => x.Content.UmbracoLibraryCacheDuration).Returns(1800); settings.Setup(x => x.WebRouting.UrlProviderMode).Returns("AutoLegacy"); settings.Setup(x => x.Templates.DefaultRenderingEngine).Returns(RenderingEngine.Mvc); - settings.Setup(x => x.Providers.DefaultBackOfficeUserProvider).Returns("UsersMembershipProvider"); + settings.Setup(x => x.Providers.DefaultBackOfficeUserProvider).Returns("UsersMembershipProvider"); return settings.Object; } diff --git a/src/Umbraco.Tests/Web/Controllers/UserEditorAuthorizationHelperTests.cs b/src/Umbraco.Tests/Web/Controllers/UserEditorAuthorizationHelperTests.cs index b46e92d553..12e20dd08c 100644 --- a/src/Umbraco.Tests/Web/Controllers/UserEditorAuthorizationHelperTests.cs +++ b/src/Umbraco.Tests/Web/Controllers/UserEditorAuthorizationHelperTests.cs @@ -127,7 +127,7 @@ namespace Umbraco.Tests.Web.Controllers var contentService = new Mock(); contentService.Setup(x => x.GetById(It.IsAny())) - .Returns((int id) => Mock.Of(content => content.Path == nodePaths[id])); + .Returns((int id) => Mock.Of(content => content.Path == nodePaths[id])); var mediaService = new Mock(); var userService = new Mock(); var entityService = new Mock(); @@ -277,8 +277,8 @@ namespace Umbraco.Tests.Web.Controllers var currentUser = Mock.Of(user => user.StartMediaIds == new[] { 9876 }); var savingUser = Mock.Of(); - var contentService = new Mock(); - var mediaService = new Mock(); + var contentService = new Mock(); + var mediaService = new Mock(); mediaService.Setup(x => x.GetById(It.IsAny())) .Returns((int id) => Mock.Of(content => content.Path == nodePaths[id])); var userService = new Mock(); @@ -315,7 +315,7 @@ namespace Umbraco.Tests.Web.Controllers var currentUser = Mock.Of(user => user.StartMediaIds == new[] { 9876 }); var savingUser = Mock.Of(); - var contentService = new Mock(); + var contentService = new Mock(); var mediaService = new Mock(); mediaService.Setup(x => x.GetById(It.IsAny())) .Returns((int id) => Mock.Of(content => content.Path == nodePaths[id])); @@ -353,7 +353,7 @@ namespace Umbraco.Tests.Web.Controllers var currentUser = Mock.Of(user => user.StartMediaIds == new[] { 9876 }); var savingUser = Mock.Of(user => user.StartMediaIds == new[] { 1234 }); - var contentService = new Mock(); + var contentService = new Mock(); var mediaService = new Mock(); mediaService.Setup(x => x.GetById(It.IsAny())) .Returns((int id) => Mock.Of(content => content.Path == nodePaths[id])); @@ -391,7 +391,7 @@ namespace Umbraco.Tests.Web.Controllers var currentUser = Mock.Of(user => user.StartMediaIds == new[] { 9876 }); var savingUser = Mock.Of(user => user.StartMediaIds == new[] { 1234, 4567 }); - var contentService = new Mock(); + var contentService = new Mock(); var mediaService = new Mock(); mediaService.Setup(x => x.GetById(It.IsAny())) .Returns((int id) => Mock.Of(content => content.Path == nodePaths[id])); diff --git a/src/Umbraco.Tests/Web/HttpCookieExtensionsTests.cs b/src/Umbraco.Tests/Web/HttpCookieExtensionsTests.cs index f13b94a669..73b5987407 100644 --- a/src/Umbraco.Tests/Web/HttpCookieExtensionsTests.cs +++ b/src/Umbraco.Tests/Web/HttpCookieExtensionsTests.cs @@ -38,7 +38,7 @@ namespace Umbraco.Tests.Web else { Assert.IsNull(valueFromHeader); - } + } } } } diff --git a/src/Umbraco.Tests/Web/Mvc/HtmlStringUtilitiesTests.cs b/src/Umbraco.Tests/Web/Mvc/HtmlStringUtilitiesTests.cs index c84d578d14..4630a89772 100644 --- a/src/Umbraco.Tests/Web/Mvc/HtmlStringUtilitiesTests.cs +++ b/src/Umbraco.Tests/Web/Mvc/HtmlStringUtilitiesTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Web; namespace Umbraco.Tests.Web.Mvc @@ -11,7 +11,7 @@ namespace Umbraco.Tests.Web.Mvc [SetUp] public virtual void Initialize() { - + _htmlStringUtilities = new HtmlStringUtilities(); } @@ -23,4 +23,4 @@ namespace Umbraco.Tests.Web.Mvc Assert.AreEqual(expected, output); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs b/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs index 794a3d4d66..bebbaa7abe 100644 --- a/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs @@ -52,13 +52,13 @@ namespace Umbraco.Web.Cache var dataTypeCache = CacheHelper.IsolatedRuntimeCache.GetCache(); foreach (var payload in payloads) - { + { if (dataTypeCache) - dataTypeCache.Result.ClearCacheByKeySearch(CacheKeys.DataTypePreValuesCacheKey + "_" + payload.Id); + dataTypeCache.Result.ClearCacheByKeySearch(CacheKeys.DataTypePreValuesCacheKey + "_" + payload.Id); - _idkMap.ClearCache(payload.Id); - NestedContentHelper.ClearCache(payload.Id); // fixme refactor nested content - } + _idkMap.ClearCache(payload.Id); + NestedContentHelper.ClearCache(payload.Id); // fixme refactor nested content + } // fixme - not sure I like these? TagsValueConverter.ClearCaches(); diff --git a/src/Umbraco.Web/Cache/MediaCacheRefresher.cs b/src/Umbraco.Web/Cache/MediaCacheRefresher.cs index 1548dea0f2..5c09e58baf 100644 --- a/src/Umbraco.Web/Cache/MediaCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/MediaCacheRefresher.cs @@ -50,8 +50,8 @@ namespace Umbraco.Web.Cache Current.ApplicationCache.ClearPartialViewCache(); foreach (var payload in payloads) - { - _idkMap.ClearCache(payload.Id); + { + _idkMap.ClearCache(payload.Id); // note: ClearCacheByKeySearch - does StartsWith(...) diff --git a/src/Umbraco.Web/Cache/MemberCacheRefresher.cs b/src/Umbraco.Web/Cache/MemberCacheRefresher.cs index cb6f11194e..2ad938b557 100644 --- a/src/Umbraco.Web/Cache/MemberCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/MemberCacheRefresher.cs @@ -8,7 +8,7 @@ namespace Umbraco.Web.Cache { public sealed class MemberCacheRefresher : TypedCacheRefresherBase { - private readonly IdkMap _idkMap; + private readonly IdkMap _idkMap; public MemberCacheRefresher(CacheHelper cacheHelper, IdkMap idkMap) : base(cacheHelper) @@ -55,7 +55,7 @@ namespace Umbraco.Web.Cache } private void ClearCache(int id) - { + { _idkMap.ClearCache(id); CacheHelper.ClearPartialViewCache(); diff --git a/src/Umbraco.Web/Cache/UserCacheRefresher.cs b/src/Umbraco.Web/Cache/UserCacheRefresher.cs index a3d21bd1de..a780104a66 100644 --- a/src/Umbraco.Web/Cache/UserCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/UserCacheRefresher.cs @@ -42,7 +42,7 @@ namespace Umbraco.Web.Cache var userCache = CacheHelper.IsolatedRuntimeCache.GetCache(); if (userCache) userCache.Result.ClearCacheItem(RepositoryBase.GetCacheIdKey(id)); - + base.Remove(id); } #endregion diff --git a/src/Umbraco.Web/Cache/UserGroupCacheRefresher.cs b/src/Umbraco.Web/Cache/UserGroupCacheRefresher.cs index 682ebf41d5..58d2f2aec5 100644 --- a/src/Umbraco.Web/Cache/UserGroupCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/UserGroupCacheRefresher.cs @@ -69,4 +69,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/UserGroupPermissionsCacheRefresher.cs b/src/Umbraco.Web/Cache/UserGroupPermissionsCacheRefresher.cs index fe511a5be5..bd2ad50ef5 100644 --- a/src/Umbraco.Web/Cache/UserGroupPermissionsCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/UserGroupPermissionsCacheRefresher.cs @@ -28,4 +28,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/AuthenticationController.cs b/src/Umbraco.Web/Editors/AuthenticationController.cs index 4417d03d8b..4ec8e5f10b 100644 --- a/src/Umbraco.Web/Editors/AuthenticationController.cs +++ b/src/Umbraco.Web/Editors/AuthenticationController.cs @@ -167,8 +167,8 @@ namespace Umbraco.Web.Editors } /// - /// When a user is invited they are not approved but we need to resolve the partially logged on (non approved) - /// user. + /// When a user is invited they are not approved but we need to resolve the partially logged on (non approved) + /// user. /// /// /// @@ -215,7 +215,7 @@ namespace Umbraco.Web.Editors { var http = EnsureHttpContext(); - //Sign the user in with username/password, this also gives a chance for developers to + //Sign the user in with username/password, this also gives a chance for developers to //custom verify the credentials and auto-link user accounts with a custom IBackOfficePasswordChecker var result = await SignInManager.PasswordSignInAsync( loginModel.Username, loginModel.Password, isPersistent: true, shouldLockout: true); @@ -223,7 +223,7 @@ namespace Umbraco.Web.Editors switch (result) { case SignInStatus.Success: - + //get the user var user = Services.UserService.GetByUsername(loginModel.Username); UserManager.RaiseLoginSuccessEvent(user.Id); diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index b9f77b7c45..430eae64a4 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -241,7 +241,7 @@ namespace Umbraco.Web.Editors return new JsonNetResult { Data = gridConfig.EditorsConfig.Editors, Formatting = Formatting.Indented }; } - + /// /// Returns the JavaScript object representing the static server variables javascript object @@ -264,7 +264,7 @@ namespace Umbraco.Web.Editors return JavaScript(result); } - + [HttpPost] public ActionResult ExternalLogin(string provider, string redirectUrl = null) @@ -461,7 +461,7 @@ namespace Umbraco.Web.Editors { autoLinkUser.AddRole(userGroup.Alias); } - + //call the callback if one is assigned if (autoLinkOptions.OnAutoLinking != null) { diff --git a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs index 1b249cf68c..af2e5d348c 100644 --- a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs +++ b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Configuration; @@ -407,4 +407,4 @@ namespace Umbraco.Web.Editors : string.Empty; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index 543abb1c02..529fd902e4 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -89,7 +89,7 @@ namespace Umbraco.Web.Editors var content = Services.ContentService.GetById(saveModel.ContentId); if (content == null) throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound)); - + //current permissions explicitly assigned to this content item var contentPermissions = Services.ContentService.GetPermissionsForEntity(content) .ToDictionary(x => x.UserGroupId, x => x); @@ -125,10 +125,10 @@ namespace Umbraco.Web.Editors //if they are different we need to update, otherwise there's nothing to update else if (contentPermissions.ContainsKey(userGroup.Id) == false || contentPermissions[userGroup.Id].AssignedPermissions.UnsortedSequenceEqual(groupPermissionCodes) == false) { - + Services.UserService.ReplaceUserGroupPermissions(userGroup.Id, groupPermissionCodes.Select(x => x[0]), content.Id); - } - } + } + } } return GetDetailedPermissions(content, allUserGroups); @@ -147,7 +147,7 @@ namespace Umbraco.Web.Editors { if (contentId <= 0) throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound)); var content = Services.ContentService.GetById(contentId); - if (content == null) throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound)); + if (content == null) throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound)); //TODO: Should non-admins be able to see detailed permissions? @@ -184,9 +184,9 @@ namespace Umbraco.Web.Editors permission.Checked = false; permission.Checked = assignedGroupPermission.AssignedPermissions.Contains(permission.PermissionCode, StringComparer.InvariantCulture); } - + } - + return defaultPermissionsByGroup; } @@ -456,7 +456,7 @@ namespace Umbraco.Web.Editors } /// - /// Creates a blueprint from a content item + /// Creates a blueprint from a content item /// /// The content id to copy /// The name of the blueprint @@ -528,7 +528,7 @@ namespace Umbraco.Web.Editors [ModelBinder(typeof(ContentItemBinder))] ContentItemSave contentItem) { - return PostSaveInternal(contentItem, + return PostSaveInternal(contentItem, content => Services.ContentService.WithResult().Save(contentItem.PersistedContent, Security.CurrentUser.Id)); } @@ -1060,7 +1060,7 @@ namespace Umbraco.Web.Editors { throw new HttpResponseException(HttpStatusCode.NotFound); } - + var hasPathAccess = (nodeId == Constants.System.Root) ? user.HasContentRootAccess(entityService) : (nodeId == Constants.System.RecycleBinContent) @@ -1085,7 +1085,7 @@ namespace Umbraco.Web.Editors var allowed = true; foreach (var p in permissionsToCheck) { - if (permission == null + if (permission == null || permission.GetAllPermissions().Contains(p.ToString(CultureInfo.InvariantCulture)) == false) { allowed = false; diff --git a/src/Umbraco.Web/Editors/ContentPostValidateAttribute.cs b/src/Umbraco.Web/Editors/ContentPostValidateAttribute.cs index cc46b6da19..e150966910 100644 --- a/src/Umbraco.Web/Editors/ContentPostValidateAttribute.cs +++ b/src/Umbraco.Web/Editors/ContentPostValidateAttribute.cs @@ -27,7 +27,7 @@ namespace Umbraco.Web.Editors public ContentPostValidateAttribute() { } - + // fixme wtf is this? public ContentPostValidateAttribute(IContentService contentService, IUserService userService, IEntityService entityService, WebSecurity security) { @@ -36,22 +36,22 @@ namespace Umbraco.Web.Editors _entityService = entityService ?? throw new ArgumentNullException(nameof(entityService)); _security = security ?? throw new ArgumentNullException(nameof(security)); } - - // fixme all these should be injected properties - private IContentService ContentService + // fixme all these should be injected properties + + private IContentService ContentService => _contentService ?? Current.Services.ContentService; - private WebSecurity Security + private WebSecurity Security => _security ?? UmbracoContext.Current.Security; - private IUserService UserService + private IUserService UserService => _userService ?? Current.Services.UserService; - private IEntityService EntityService + private IEntityService EntityService => _entityService ?? Current.Services.EntityService; - public override bool AllowMultiple + public override bool AllowMultiple => true; public override void OnActionExecuting(HttpActionContext actionContext) @@ -85,7 +85,7 @@ namespace Umbraco.Web.Editors case ContentSaveAction.SaveNew: //Save new requires ActionNew - permissionToCheck.Add(ActionNew.Instance.Letter); + permissionToCheck.Add(ActionNew.Instance.Letter); if (contentItem.ParentId != Constants.System.Root) { @@ -114,7 +114,7 @@ namespace Umbraco.Web.Editors break; case ContentSaveAction.PublishNew: //Publish new requires both ActionNew AND ActionPublish - //TODO: Shoudn't publish also require ActionUpdate since it will definitely perform an update to publish but maybe that's just implied + //TODO: Shoudn't publish also require ActionUpdate since it will definitely perform an update to publish but maybe that's just implied permissionToCheck.Add(ActionNew.Instance.Letter); permissionToCheck.Add(ActionPublish.Instance.Letter); diff --git a/src/Umbraco.Web/Editors/DashboardController.cs b/src/Umbraco.Web/Editors/DashboardController.cs index e0c43a085e..d23e262412 100644 --- a/src/Umbraco.Web/Editors/DashboardController.cs +++ b/src/Umbraco.Web/Editors/DashboardController.cs @@ -124,7 +124,7 @@ namespace Umbraco.Web.Editors public IEnumerable> GetDashboard(string section) { var dashboardHelper = new DashboardHelper(Services.SectionService); - return dashboardHelper.GetDashboard(section, Security.CurrentUser); + return dashboardHelper.GetDashboard(section, Security.CurrentUser); } } } diff --git a/src/Umbraco.Web/Editors/DashboardHelper.cs b/src/Umbraco.Web/Editors/DashboardHelper.cs index 8b43335ebe..28df8cf526 100644 --- a/src/Umbraco.Web/Editors/DashboardHelper.cs +++ b/src/Umbraco.Web/Editors/DashboardHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core; @@ -93,4 +93,4 @@ namespace Umbraco.Web.Editors return tabs; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/IsCurrentUserModelFilterAttribute.cs b/src/Umbraco.Web/Editors/IsCurrentUserModelFilterAttribute.cs index a7164b3c65..a791be7aed 100644 --- a/src/Umbraco.Web/Editors/IsCurrentUserModelFilterAttribute.cs +++ b/src/Umbraco.Web/Editors/IsCurrentUserModelFilterAttribute.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Net.Http; using System.Web.Http.Filters; using Umbraco.Web.Models.ContentEditing; @@ -52,4 +52,4 @@ namespace Umbraco.Web.Editors base.OnActionExecuted(actionExecutedContext); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/MediaPostValidateAttribute.cs b/src/Umbraco.Web/Editors/MediaPostValidateAttribute.cs index 71bedea030..bdf35718a9 100644 --- a/src/Umbraco.Web/Editors/MediaPostValidateAttribute.cs +++ b/src/Umbraco.Web/Editors/MediaPostValidateAttribute.cs @@ -26,7 +26,7 @@ namespace Umbraco.Web.Editors public MediaPostValidateAttribute() { } - + // fixme wtf is this? public MediaPostValidateAttribute(IMediaService mediaService, IEntityService entityService, WebSecurity security) { @@ -36,14 +36,14 @@ namespace Umbraco.Web.Editors } // fixme all these should be injected properties - - private IMediaService MediaService + + private IMediaService MediaService => _mediaService ?? Current.Services.MediaService; - private IEntityService EntityService + private IEntityService EntityService => _entityService ?? Current.Services.EntityService; - private WebSecurity Security + private WebSecurity Security => _security ?? UmbracoContext.Current.Security; public override void OnActionExecuting(HttpActionContext actionContext) @@ -83,7 +83,7 @@ namespace Umbraco.Web.Editors if (MediaController.CheckPermissions( actionContext.Request.Properties, Security.CurrentUser, - MediaService, EntityService, + MediaService, EntityService, contentIdToCheck, contentToCheck) == false) { throw new HttpResponseException(actionContext.Request.CreateUserNoAccessResponse()); diff --git a/src/Umbraco.Web/Editors/MediaTypeController.cs b/src/Umbraco.Web/Editors/MediaTypeController.cs index 00a5def3b9..914524d26f 100644 --- a/src/Umbraco.Web/Editors/MediaTypeController.cs +++ b/src/Umbraco.Web/Editors/MediaTypeController.cs @@ -155,7 +155,7 @@ namespace Umbraco.Web.Editors public HttpResponseMessage PostRenameContainer(int id, string name) { - + var result = Services.MediaTypeService.RenameContainer(id, name, Security.CurrentUser.Id); return result diff --git a/src/Umbraco.Web/Editors/MemberController.cs b/src/Umbraco.Web/Editors/MemberController.cs index 90b9768190..1546f6c4a6 100644 --- a/src/Umbraco.Web/Editors/MemberController.cs +++ b/src/Umbraco.Web/Editors/MemberController.cs @@ -205,7 +205,7 @@ namespace Umbraco.Web.Editors throw new HttpResponseException(HttpStatusCode.NotFound); } - var provider = Core.Security.MembershipProviderExtensions.GetMembersMembershipProvider(); + var provider = Core.Security.MembershipProviderExtensions.GetMembersMembershipProvider(); emptyContent = new Member(contentType); emptyContent.AdditionalData["NewPassword"] = Membership.GeneratePassword(provider.MinRequiredPasswordLength, provider.MinRequiredNonAlphanumericCharacters); diff --git a/src/Umbraco.Web/Editors/PackageInstallController.cs b/src/Umbraco.Web/Editors/PackageInstallController.cs index 94647079be..475085b8f8 100644 --- a/src/Umbraco.Web/Editors/PackageInstallController.cs +++ b/src/Umbraco.Web/Editors/PackageInstallController.cs @@ -540,7 +540,7 @@ namespace Umbraco.Web.Editors //set a restarting marker and reset the app pool Current.RestartAppPool(Request.TryGetHttpContext().Result); - + model.IsRestarting = true; return model; diff --git a/src/Umbraco.Web/Editors/PasswordChanger.cs b/src/Umbraco.Web/Editors/PasswordChanger.cs index d52ebe10d0..7b99023ec4 100644 --- a/src/Umbraco.Web/Editors/PasswordChanger.cs +++ b/src/Umbraco.Web/Editors/PasswordChanger.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; using System.Web; @@ -96,7 +96,7 @@ namespace Umbraco.Web.Editors _logger.Warn($"Could not reset user password {errors}"); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not reset password, errors: " + errors, new[] { "resetPassword" }) }); } - + return Attempt.Succeed(new PasswordChangedModel()); } @@ -285,4 +285,4 @@ namespace Umbraco.Web.Editors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/SectionController.cs b/src/Umbraco.Web/Editors/SectionController.cs index 0a0e8397cb..d2fd5f3231 100644 --- a/src/Umbraco.Web/Editors/SectionController.cs +++ b/src/Umbraco.Web/Editors/SectionController.cs @@ -40,7 +40,7 @@ namespace Umbraco.Web.Editors IEnumerable> dashboardsForSection; if (dashboards.TryGetValue(section.Alias, out dashboardsForSection)) { - if (dashboardsForSection.Any()) + if (dashboardsForSection.Any()) hasDashboards = true; } @@ -48,8 +48,8 @@ namespace Umbraco.Web.Editors { //get the first tree in the section and get it's root node route path var sectionTrees = appTreeController.GetApplicationTrees(section.Alias, null, null).Result; - section.RoutePath = sectionTrees.IsContainer == false - ? sectionTrees.RoutePath + section.RoutePath = sectionTrees.IsContainer == false + ? sectionTrees.RoutePath : sectionTrees.Children[0].RoutePath; } } diff --git a/src/Umbraco.Web/Editors/UserEditorAuthorizationHelper.cs b/src/Umbraco.Web/Editors/UserEditorAuthorizationHelper.cs index 5dcd5572e4..e0e9a8ed55 100644 --- a/src/Umbraco.Web/Editors/UserEditorAuthorizationHelper.cs +++ b/src/Umbraco.Web/Editors/UserEditorAuthorizationHelper.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Umbraco.Core; using Umbraco.Core.Models; @@ -23,7 +23,7 @@ namespace Umbraco.Web.Editors } /// - /// Checks if the current user has access to save the user data + /// Checks if the current user has access to save the user data /// /// The current user trying to save user data /// The user instance being saved (can be null if it's a new user) @@ -41,7 +41,7 @@ namespace Umbraco.Web.Editors // a) A non-admin cannot save an admin if (savingUser != null) - { + { if (savingUser.IsAdmin() && currentIsAdmin == false) return Attempt.Fail("The current user is not an administrator so cannot save another administrator"); } @@ -65,9 +65,9 @@ namespace Umbraco.Web.Editors var pathResult = AuthorizePath(currentUser, changedStartContentIds, changedStartMediaIds); if (pathResult == false) return pathResult; - + // c) an admin can manage any group or section access - + if (currentIsAdmin) return Attempt.Succeed(); @@ -91,16 +91,16 @@ namespace Umbraco.Web.Editors // d) A user cannot assign a group to another user that they do not belong to var currentUserGroups = currentUser.Groups.Select(x => x.Alias).ToArray(); - + foreach (var group in newGroups) { if (currentUserGroups.Contains(group) == false) { return Attempt.Fail("Cannot assign the group " + group + ", the current user is not a member"); } - } + } } - } + } return Attempt.Succeed(); } @@ -145,11 +145,11 @@ namespace Umbraco.Web.Editors var hasAccess = currentUser.HasPathAccess(media, _entityService); if (hasAccess == false) return Attempt.Fail("The current user does not have access to the media path " + media.Path); - } - } + } + } } return Attempt.Succeed(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/UserGroupAuthorizationAttribute.cs b/src/Umbraco.Web/Editors/UserGroupAuthorizationAttribute.cs index 00297fc2cd..6b0bac0d69 100644 --- a/src/Umbraco.Web/Editors/UserGroupAuthorizationAttribute.cs +++ b/src/Umbraco.Web/Editors/UserGroupAuthorizationAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Net; using System.Net.Http; @@ -43,7 +43,7 @@ namespace Umbraco.Web.Editors { var umbCtx = GetUmbracoContext(); var currentUser = umbCtx.Security.CurrentUser; - + var queryString = actionContext.Request.GetQueryNameValuePairs(); var ids = queryString.Where(x => x.Key == _paramName).ToArray(); @@ -56,7 +56,7 @@ namespace Umbraco.Web.Editors Current.Services.ContentService, Current.Services.MediaService, Current.Services.EntityService); - return authHelper.AuthorizeGroupAccess(currentUser, intIds); + return authHelper.AuthorizeGroupAccess(currentUser, intIds); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/UserGroupEditorAuthorizationHelper.cs b/src/Umbraco.Web/Editors/UserGroupEditorAuthorizationHelper.cs index 6bc39b376d..26dfb9fb1f 100644 --- a/src/Umbraco.Web/Editors/UserGroupEditorAuthorizationHelper.cs +++ b/src/Umbraco.Web/Editors/UserGroupEditorAuthorizationHelper.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Umbraco.Core; using Umbraco.Core.Models; @@ -119,4 +119,4 @@ namespace Umbraco.Web.Editors return Attempt.Succeed(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/UserGroupValidateAttribute.cs b/src/Umbraco.Web/Editors/UserGroupValidateAttribute.cs index 0e4362ebe9..b3bc59554d 100644 --- a/src/Umbraco.Web/Editors/UserGroupValidateAttribute.cs +++ b/src/Umbraco.Web/Editors/UserGroupValidateAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net; using System.Net.Http; using System.Web.Http.Controllers; @@ -79,4 +79,4 @@ namespace Umbraco.Web.Editors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/UserGroupsController.cs b/src/Umbraco.Web/Editors/UserGroupsController.cs index 0922d36dbe..83f5db08ad 100644 --- a/src/Umbraco.Web/Editors/UserGroupsController.cs +++ b/src/Umbraco.Web/Editors/UserGroupsController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; @@ -52,7 +52,7 @@ namespace Umbraco.Web.Editors //save the group Services.UserService.Save(userGroupSave.PersistedUserGroup, userGroupSave.Users.ToArray()); - + //deal with permissions //remove ones that have been removed @@ -148,4 +148,4 @@ namespace Umbraco.Web.Editors Services.TextService.Localize("speechBubbles/deleteUserGroupSuccess", new[] {userGroups[0].Name})); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/UsersController.cs b/src/Umbraco.Web/Editors/UsersController.cs index 368967b138..44df2b928a 100644 --- a/src/Umbraco.Web/Editors/UsersController.cs +++ b/src/Umbraco.Web/Editors/UsersController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -544,7 +544,7 @@ namespace Umbraco.Web.Editors { userMgr.RaisePasswordChangedEvent(intId.Result); } - + //need to re-get the user found = Services.UserService.GetUserById(intId.Result); } @@ -694,4 +694,4 @@ namespace Umbraco.Web.Editors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckController.cs b/src/Umbraco.Web/HealthCheck/HealthCheckController.cs index 7a7a62e218..d051bcd6a3 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheckController.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheckController.cs @@ -60,7 +60,7 @@ namespace Umbraco.Web.HealthCheck public object GetStatus(Guid id) { var check = GetCheckById(id); - + try { //Core.Logging.LogHelper.Debug("Running health check: " + check.Name); diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckNotificationMethodAttribute.cs b/src/Umbraco.Web/HealthCheck/HealthCheckNotificationMethodAttribute.cs index 5aa231f96b..d9da271d58 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheckNotificationMethodAttribute.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheckNotificationMethodAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Web.HealthCheck { @@ -15,4 +15,4 @@ namespace Umbraco.Web.HealthCheck public string Alias { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckNotificationMethodCollectionBuilder.cs b/src/Umbraco.Web/HealthCheck/HealthCheckNotificationMethodCollectionBuilder.cs index 40b253e4e4..4f958da9a0 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheckNotificationMethodCollectionBuilder.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheckNotificationMethodCollectionBuilder.cs @@ -12,4 +12,4 @@ namespace Umbraco.Web.HealthCheck protected override HealthCheckNotificationMethodCollectionBuilder This => this; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HtmlStringUtilities.cs b/src/Umbraco.Web/HtmlStringUtilities.cs index c0c4efe96d..17ee58ef93 100644 --- a/src/Umbraco.Web/HtmlStringUtilities.cs +++ b/src/Umbraco.Web/HtmlStringUtilities.cs @@ -29,7 +29,7 @@ namespace Umbraco.Web { var doc = new HtmlDocument(); doc.LoadHtml("

" + html + "

"); - + var targets = new List(); var nodes = doc.DocumentNode.FirstChild.SelectNodes(".//*"); diff --git a/src/Umbraco.Web/HttpCookieExtensions.cs b/src/Umbraco.Web/HttpCookieExtensions.cs index 29c82955ea..60c807ed66 100644 --- a/src/Umbraco.Web/HttpCookieExtensions.cs +++ b/src/Umbraco.Web/HttpCookieExtensions.cs @@ -23,7 +23,7 @@ namespace Umbraco.Web /// /// /// - /// Adapted from: https://stackoverflow.com/a/29057304/5018 because there's an issue with .NET WebApi cookie parsing logic + /// Adapted from: https://stackoverflow.com/a/29057304/5018 because there's an issue with .NET WebApi cookie parsing logic /// when using requestHeaders.GetCookies() when an invalid cookie name is present. /// public static string GetCookieValue(this HttpRequestHeaders requestHeaders, string cookieName) @@ -32,7 +32,7 @@ namespace Umbraco.Web { if (header.Key.Equals("Cookie", StringComparison.InvariantCultureIgnoreCase) == false) continue; - + var cookiesHeaderValue = header.Value.FirstOrDefault(); if (cookiesHeaderValue == null) return null; @@ -48,7 +48,7 @@ namespace Umbraco.Web } return null; - } + } /// /// Removes the cookie from the request and the response if it exists diff --git a/src/Umbraco.Web/Install/InstallSteps/ConfigureMachineKey.cs b/src/Umbraco.Web/Install/InstallSteps/ConfigureMachineKey.cs index aee6b688be..de53fd60cf 100644 --- a/src/Umbraco.Web/Install/InstallSteps/ConfigureMachineKey.cs +++ b/src/Umbraco.Web/Install/InstallSteps/ConfigureMachineKey.cs @@ -58,4 +58,4 @@ namespace Umbraco.Web.Install.InstallSteps return HasMachineKey() == false; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/AssignedContentPermissions.cs b/src/Umbraco.Web/Models/ContentEditing/AssignedContentPermissions.cs index dc071052cc..655a984da0 100644 --- a/src/Umbraco.Web/Models/ContentEditing/AssignedContentPermissions.cs +++ b/src/Umbraco.Web/Models/ContentEditing/AssignedContentPermissions.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing @@ -18,4 +18,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "permissions")] public IDictionary> AssignedPermissions { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/AssignedUserGroupPermissions.cs b/src/Umbraco.Web/Models/ContentEditing/AssignedUserGroupPermissions.cs index 5428de883f..13366a9596 100644 --- a/src/Umbraco.Web/Models/ContentEditing/AssignedUserGroupPermissions.cs +++ b/src/Umbraco.Web/Models/ContentEditing/AssignedUserGroupPermissions.cs @@ -35,4 +35,4 @@ namespace Umbraco.Web.Models.ContentEditing return result; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs index 695455be5d..e5562ba22d 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs @@ -49,8 +49,8 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataMember(Name = "allowedActions")] public IEnumerable AllowedActions { get; set; } - + [DataMember(Name = "isBlueprint")] public bool IsBlueprint { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs b/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs index f1514afbac..93747cd131 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs @@ -22,7 +22,7 @@ namespace Umbraco.Web.Models.ContentEditing public ContentTypeBasic() { Blueprints = new Dictionary(); - } + } /// /// Overridden to apply our own validation attributes since this is not always required for other classes diff --git a/src/Umbraco.Web/Models/ContentEditing/Permission.cs b/src/Umbraco.Web/Models/ContentEditing/Permission.cs index 9c40dc0aa6..7b444e5959 100644 --- a/src/Umbraco.Web/Models/ContentEditing/Permission.cs +++ b/src/Umbraco.Web/Models/ContentEditing/Permission.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing @@ -35,4 +35,4 @@ namespace Umbraco.Web.Models.ContentEditing return this.MemberwiseClone(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/SearchResultItem.cs b/src/Umbraco.Web/Models/ContentEditing/SearchResultItem.cs index f7062e679f..c82838d9d3 100644 --- a/src/Umbraco.Web/Models/ContentEditing/SearchResultItem.cs +++ b/src/Umbraco.Web/Models/ContentEditing/SearchResultItem.cs @@ -10,6 +10,6 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataMember(Name = "score")] public float Score { get; set; } - + } } diff --git a/src/Umbraco.Web/Models/ContentEditing/TreeSearchResult.cs b/src/Umbraco.Web/Models/ContentEditing/TreeSearchResult.cs index 1da9d61c98..964ed62c88 100644 --- a/src/Umbraco.Web/Models/ContentEditing/TreeSearchResult.cs +++ b/src/Umbraco.Web/Models/ContentEditing/TreeSearchResult.cs @@ -17,8 +17,8 @@ namespace Umbraco.Web.Models.ContentEditing public string TreeAlias { get; set; } /// - /// This is optional but if specified should be the name of an angular service to format the search result. - /// + /// This is optional but if specified should be the name of an angular service to format the search result. + /// [DataMember(Name = "jsSvc")] public string JsFormatterService { get; set; } @@ -32,4 +32,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "results")] public IEnumerable Results { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/UserDetail.cs b/src/Umbraco.Web/Models/ContentEditing/UserDetail.cs index 70a3a41133..6b819325e5 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserDetail.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserDetail.cs @@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing -{ +{ /// /// Represents information for the current user /// @@ -29,25 +29,25 @@ namespace Umbraco.Web.Models.ContentEditing [Obsolete("This should not be used it exists for legacy reasons only, use user groups instead, it will be removed in future versions")] [EditorBrowsable(EditorBrowsableState.Never)] [ReadOnly(true)] - [DataMember(Name = "userType")] + [DataMember(Name = "userType")] public string UserType { get; set; } [ReadOnly(true)] - [DataMember(Name = "userGroups")] - public string[] UserGroups { get; set; } + [DataMember(Name = "userGroups")] + public string[] UserGroups { get; set; } /// /// Gets/sets the number of seconds for the user's auth ticket to expire /// [DataMember(Name = "remainingAuthSeconds")] public double SecondsUntilTimeout { get; set; } - + /// /// The user's calculated start nodes based on the start nodes they have assigned directly to them and via the groups they're assigned to /// [DataMember(Name = "startContentIds")] public int[] StartContentIds { get; set; } - + /// /// The user's calculated start nodes based on the start nodes they have assigned directly to them and via the groups they're assigned to /// @@ -58,7 +58,7 @@ namespace Umbraco.Web.Models.ContentEditing /// Returns a list of different size avatars ///
[DataMember(Name = "avatars")] - public string[] Avatars { get; set; } + public string[] Avatars { get; set; } /// /// A list of sections the user is allowed to view. diff --git a/src/Umbraco.Web/Models/ContentEditing/UserDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/UserDisplay.cs index 8a79344c8e..017f1ea218 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserDisplay.cs @@ -19,14 +19,14 @@ namespace Umbraco.Web.Models.ContentEditing StartContentIds = new List(); StartMediaIds = new List(); } - + /// /// Gets the available cultures (i.e. to populate a drop down) /// The key is the culture stored in the database, the value is the Name /// [DataMember(Name = "availableCultures")] public IDictionary AvailableCultures { get; set; } - + [DataMember(Name = "startContentIds")] public IEnumerable StartContentIds { get; set; } @@ -75,4 +75,4 @@ namespace Umbraco.Web.Models.ContentEditing public DateTime UpdateDate { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/UserGroupBasic.cs b/src/Umbraco.Web/Models/ContentEditing/UserGroupBasic.cs index b52a653497..0457711c6c 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserGroupBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserGroupBasic.cs @@ -34,4 +34,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "userCount")] public int UserCount { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/UserGroupDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/UserGroupDisplay.cs index ea8eaa4b6c..62f1df305b 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserGroupDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserGroupDisplay.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; @@ -28,4 +28,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "assignedPermissions")] public IEnumerable AssignedPermissions { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/UserGroupPermissionsSave.cs b/src/Umbraco.Web/Models/ContentEditing/UserGroupPermissionsSave.cs index b38a6d75e3..e61f9debfa 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserGroupPermissionsSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserGroupPermissionsSave.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; @@ -27,7 +27,7 @@ namespace Umbraco.Web.Models.ContentEditing /// A dictionary of permissions to assign, the key is the user group id /// [DataMember(Name = "permissions")] - public IDictionary> AssignedPermissions { get; set; } + public IDictionary> AssignedPermissions { get; set; } public IEnumerable Validate(ValidationContext validationContext) { @@ -37,4 +37,4 @@ namespace Umbraco.Web.Models.ContentEditing } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/UserGroupSave.cs b/src/Umbraco.Web/Models/ContentEditing/UserGroupSave.cs index 872834988d..4172033188 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserGroupSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserGroupSave.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; @@ -21,11 +21,11 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "action", IsRequired = true)] [Required] public ContentSaveAction Action { get; set; } - + [DataMember(Name = "alias", IsRequired = true)] [Required] public override string Alias { get; set; } - + [DataMember(Name = "sections")] public IEnumerable Sections { get; set; } @@ -74,7 +74,7 @@ namespace Umbraco.Web.Models.ContentEditing yield return new ValidationResult("A permission value cannot be null or empty", new[] { "AssignedPermissions" }); } } - + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/UserInvite.cs b/src/Umbraco.Web/Models/ContentEditing/UserInvite.cs index 368067814d..cb85f0f3db 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserInvite.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserInvite.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; @@ -22,7 +22,7 @@ namespace Umbraco.Web.Models.ContentEditing [EmailAddress] public string Email { get; set; } - [DataMember(Name = "username")] + [DataMember(Name = "username")] public string Username { get; set; } [DataMember(Name = "message")] @@ -37,4 +37,4 @@ namespace Umbraco.Web.Models.ContentEditing yield return new ValidationResult("A username cannot be empty", new[] { "Username" }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/UserProfile.cs b/src/Umbraco.Web/Models/ContentEditing/UserProfile.cs index eca28e1408..12b6e2a627 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserProfile.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserProfile.cs @@ -14,7 +14,7 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "id", IsRequired = true)] [Required] public int UserId { get; set; } - + [DataMember(Name = "name", IsRequired = true)] [Required] public string Name { get; set; } @@ -25,4 +25,4 @@ namespace Umbraco.Web.Models.ContentEditing return String.Compare(Name, ((UserProfile)obj).Name, StringComparison.Ordinal); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/UserSave.cs b/src/Umbraco.Web/Models/ContentEditing/UserSave.cs index 1b6a76ae99..2533ebb105 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserSave.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; @@ -44,7 +44,7 @@ namespace Umbraco.Web.Models.ContentEditing public int[] StartContentIds { get; set; } [DataMember(Name = "startMediaIds")] - public int[] StartMediaIds { get; set; } + public int[] StartMediaIds { get; set; } public IEnumerable Validate(ValidationContext validationContext) { @@ -52,4 +52,4 @@ namespace Umbraco.Web.Models.ContentEditing yield return new ValidationResult("A user must be assigned to at least one group", new[] { "UserGroups" }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/LoginModel.cs b/src/Umbraco.Web/Models/LoginModel.cs index 5e6b2e5c18..a48ed4a0bb 100644 --- a/src/Umbraco.Web/Models/LoginModel.cs +++ b/src/Umbraco.Web/Models/LoginModel.cs @@ -10,7 +10,7 @@ namespace Umbraco.Web.Models public string Username { get; set; } [Required] - [DataMember(Name = "password", IsRequired = true)] + [DataMember(Name = "password", IsRequired = true)] [StringLength(maximumLength:256)] public string Password { get; set; } diff --git a/src/Umbraco.Web/Models/Mapping/ContentTypeProfileExtensions.cs b/src/Umbraco.Web/Models/Mapping/ContentTypeProfileExtensions.cs index c03e556ad9..0f9830c834 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentTypeProfileExtensions.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentTypeProfileExtensions.cs @@ -28,7 +28,7 @@ namespace Umbraco.Web.Models.Mapping .IgnoreEntityCommonProperties() .ForMember(dest => dest.Id, map => map.Condition(src => src.Id > 0)) .ForMember(dest => dest.Key, map => map.Ignore()) - .ForMember(dest => dest.HasIdentity, map => map.Ignore()) + .ForMember(dest => dest.HasIdentity, map => map.Ignore()) .ForMember(dest => dest.DeletedDate, map => map.Ignore()) .ForMember(dest => dest.PropertyTypes, map => map.Ignore()); } @@ -164,7 +164,7 @@ namespace Umbraco.Web.Models.Mapping .ForMember(dest => dest.Id, opt => opt.MapFrom(src => Convert.ToInt32(src.Id))) //These get persisted as part of the saving procedure, nothing to do with the display model - .IgnoreDeletableEntityCommonProperties() + .IgnoreDeletableEntityCommonProperties() .ForMember(dest => dest.AllowedAsRoot, opt => opt.MapFrom(src => src.AllowAsRoot)) .ForMember(dest => dest.CreatorId, opt => opt.Ignore()) diff --git a/src/Umbraco.Web/Models/Mapping/EntityProfileExtensions.cs b/src/Umbraco.Web/Models/Mapping/EntityProfileExtensions.cs index c2a29f0d60..209e1365b8 100644 --- a/src/Umbraco.Web/Models/Mapping/EntityProfileExtensions.cs +++ b/src/Umbraco.Web/Models/Mapping/EntityProfileExtensions.cs @@ -1,4 +1,4 @@ -using AutoMapper; +using AutoMapper; using Umbraco.Core.Models.EntityBase; namespace Umbraco.Web.Models.Mapping @@ -35,4 +35,4 @@ namespace Umbraco.Web.Models.Mapping .ForMember(dest => dest.UpdateDate, opt => opt.Ignore()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs b/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs index e3b8b2dfca..879433ab02 100644 --- a/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using AutoMapper; @@ -101,9 +101,9 @@ namespace Umbraco.Web.Models.Mapping } //now add the user props - contentProps.AddRange(currProps); + contentProps.AddRange(currProps); - //callback + //callback onGenericPropertiesMapped?.Invoke(contentProps); //re-assign @@ -166,7 +166,7 @@ namespace Umbraco.Web.Models.Mapping var listViewConfig = editor.PreValueEditor.ConvertDbToEditor(editor.DefaultPreValues, preVals); //add the entity type to the config - listViewConfig["entityType"] = entityType; + listViewConfig["entityType"] = entityType; //Override Tab Label if tabName is provided if (listViewConfig.ContainsKey("tabName")) @@ -174,7 +174,7 @@ namespace Umbraco.Web.Models.Mapping var configTabName = listViewConfig["tabName"]; if (configTabName != null && string.IsNullOrWhiteSpace(configTabName.ToString()) == false) listViewTab.Label = configTabName.ToString(); - } + } var listViewProperties = new List(); listViewProperties.Add(new ContentPropertyDisplay diff --git a/src/Umbraco.Web/Models/Mapping/UserGroupDefaultPermissionsResolver.cs b/src/Umbraco.Web/Models/Mapping/UserGroupDefaultPermissionsResolver.cs index 98cdacec60..89144084e2 100644 --- a/src/Umbraco.Web/Models/Mapping/UserGroupDefaultPermissionsResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/UserGroupDefaultPermissionsResolver.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -51,4 +51,4 @@ namespace Umbraco.Web.Models.Mapping return result; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/ControllerExtensions.cs b/src/Umbraco.Web/Mvc/ControllerExtensions.cs index 1f06bc6ca7..85fdb5f34b 100644 --- a/src/Umbraco.Web/Mvc/ControllerExtensions.cs +++ b/src/Umbraco.Web/Mvc/ControllerExtensions.cs @@ -102,11 +102,11 @@ namespace Umbraco.Web.Mvc using (var sw = new StringWriter()) { - var viewResult = isPartial == false + var viewResult = isPartial == false ? ViewEngines.Engines.FindView(controller.ControllerContext, viewName, null) : ViewEngines.Engines.FindPartialView(controller.ControllerContext, viewName); - if (viewResult.View == null) - throw new InvalidOperationException("No view could be found by name " + viewName); + if (viewResult.View == null) + throw new InvalidOperationException("No view could be found by name " + viewName); var viewContext = new ViewContext(controller.ControllerContext, viewResult.View, controller.ViewData, controller.TempData, sw); viewResult.View.Render(viewContext, sw); viewResult.ViewEngine.ReleaseView(controller.ControllerContext, viewResult.View); @@ -125,7 +125,7 @@ namespace Umbraco.Web.Mvc /// true if it is a Partial view, otherwise false for a normal view /// internal static string RenderViewToString( - this RequestContext requestContext, + this RequestContext requestContext, ViewDataDictionary viewData, TempDataDictionary tempData, string viewName, object model, bool isPartial = false) @@ -142,9 +142,9 @@ namespace Umbraco.Web.Mvc requestContext.HttpContext, routeData, new FakeController { - ViewData = viewData + ViewData = viewData }); - + using (var sw = new StringWriter()) { var viewResult = isPartial == false diff --git a/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs index 98d113f737..b1a2ae5d44 100644 --- a/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs @@ -58,9 +58,9 @@ namespace Umbraco.Web.PropertyEditors } internal class ListViewPreValueEditor : PreValueEditor - { + { [PreValueField("tabName", "Tab Name", "textstring", Description = "The name of the listview tab (default if empty: 'Child Items')")] - public int TabName { get; set; } + public int TabName { get; set; } [PreValueField("displayAtTabNumber", "Display At Tab Number", "number", Description = "Which tab position that the list of child items will be displayed")] public int DisplayAtTabNumber { get; set; } diff --git a/src/Umbraco.Web/PropertyEditors/NestedContentHelper.cs b/src/Umbraco.Web/PropertyEditors/NestedContentHelper.cs index 37f0095327..32f8bd1b38 100644 --- a/src/Umbraco.Web/PropertyEditors/NestedContentHelper.cs +++ b/src/Umbraco.Web/PropertyEditors/NestedContentHelper.cs @@ -75,7 +75,7 @@ namespace Umbraco.Web.PropertyEditors var preValueContentTypes = JArray.Parse(preValuesAsDictionary[ContentTypesPreValueKey]); if (preValueContentTypes.Any()) { - // the only thing we can really do is assume that the item is the first available content type + // the only thing we can really do is assume that the item is the first available content type item[NestedContentPropertyEditor.ContentTypeAliasPropertyKey] = preValueContentTypes.First().Value("ncAlias"); } } diff --git a/src/Umbraco.Web/PropertyEditors/TextAreaPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/TextAreaPropertyEditor.cs index 591691c5df..d74e30fb06 100644 --- a/src/Umbraco.Web/PropertyEditors/TextAreaPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/TextAreaPropertyEditor.cs @@ -13,7 +13,7 @@ namespace Umbraco.Web.PropertyEditors public TextAreaPropertyEditor(ILogger logger) : base(logger) { } - + protected override PropertyValueEditor CreateValueEditor() { return new TextOnlyValueEditor(base.CreateValueEditor()); diff --git a/src/Umbraco.Web/PropertyEditors/TextOnlyValueEditor.cs b/src/Umbraco.Web/PropertyEditors/TextOnlyValueEditor.cs index 7222ee13e4..935f045092 100644 --- a/src/Umbraco.Web/PropertyEditors/TextOnlyValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/TextOnlyValueEditor.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; @@ -6,7 +6,7 @@ using Umbraco.Core.Services; namespace Umbraco.Web.PropertyEditors { /// - /// Custom value editor which ensures that the value stored is just plain text and that + /// Custom value editor which ensures that the value stored is just plain text and that /// no magic json formatting occurs when translating it to and from the database values /// public class TextOnlyValueEditor : PropertyValueEditorWrapper @@ -32,15 +32,15 @@ namespace Umbraco.Web.PropertyEditors switch (GetDatabaseType()) { case DataTypeDatabaseType.Ntext: - case DataTypeDatabaseType.Nvarchar: + case DataTypeDatabaseType.Nvarchar: return property.Value.ToString(); case DataTypeDatabaseType.Integer: - case DataTypeDatabaseType.Decimal: - case DataTypeDatabaseType.Date: + case DataTypeDatabaseType.Decimal: + case DataTypeDatabaseType.Date: default: throw new InvalidOperationException("The " + typeof(TextOnlyValueEditor) + " can only be used with string based property editors"); } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/TextboxPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/TextboxPropertyEditor.cs index 46bb037624..036fbff847 100644 --- a/src/Umbraco.Web/PropertyEditors/TextboxPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/TextboxPropertyEditor.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; @@ -19,7 +19,7 @@ namespace Umbraco.Web.PropertyEditors public TextboxPropertyEditor(ILogger logger) : base(logger) { } - + protected override PropertyValueEditor CreateValueEditor() { return new TextOnlyValueEditor(base.CreateValueEditor()); diff --git a/src/Umbraco.Web/PublishedContentQuery.cs b/src/Umbraco.Web/PublishedContentQuery.cs index 3200f4ad84..2e48bf1c55 100644 --- a/src/Umbraco.Web/PublishedContentQuery.cs +++ b/src/Umbraco.Web/PublishedContentQuery.cs @@ -66,7 +66,7 @@ namespace Umbraco.Web ? ItemById(udi.Guid, _contentCache) : _query.Content(udi.Guid); } - + public IPublishedContent ContentSingleAtXPath(string xpath, params XPathVariable[] vars) { return _query == null @@ -134,7 +134,7 @@ namespace Umbraco.Web ? ItemById(udi.Guid, _mediaCache) : _query.Media(udi.Guid); } - + public IEnumerable Media(IEnumerable ids) { return _query == null diff --git a/src/Umbraco.Web/Scheduling/HealthCheckNotifier.cs b/src/Umbraco.Web/Scheduling/HealthCheckNotifier.cs index 397b3d35fb..68e306462f 100644 --- a/src/Umbraco.Web/Scheduling/HealthCheckNotifier.cs +++ b/src/Umbraco.Web/Scheduling/HealthCheckNotifier.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using System.Threading; using System.Threading.Tasks; using Umbraco.Core; @@ -81,4 +81,4 @@ namespace Umbraco.Web.Scheduling public override bool IsAsync => true; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Search/SearchableApplicationTree.cs b/src/Umbraco.Web/Search/SearchableApplicationTree.cs index ec9cbf914f..997d8ce8e8 100644 --- a/src/Umbraco.Web/Search/SearchableApplicationTree.cs +++ b/src/Umbraco.Web/Search/SearchableApplicationTree.cs @@ -1,4 +1,4 @@ -using Umbraco.Web.Trees; +using Umbraco.Web.Trees; namespace Umbraco.Web.Search { @@ -13,6 +13,6 @@ namespace Umbraco.Web.Search public string AppAlias { get; } public string TreeAlias { get; } - public ISearchableTree SearchableTree { get; } + public ISearchableTree SearchableTree { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Search/SearchableTreeAttribute.cs b/src/Umbraco.Web/Search/SearchableTreeAttribute.cs index 15263165f6..6c44b8946d 100644 --- a/src/Umbraco.Web/Search/SearchableTreeAttribute.cs +++ b/src/Umbraco.Web/Search/SearchableTreeAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Exceptions; namespace Umbraco.Web.Search @@ -33,4 +33,4 @@ namespace Umbraco.Web.Search public string MethodName { get; } public string ServiceName { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Search/SearchableTreeCollection.cs b/src/Umbraco.Web/Search/SearchableTreeCollection.cs index 0ac59ef559..d9368c973e 100644 --- a/src/Umbraco.Web/Search/SearchableTreeCollection.cs +++ b/src/Umbraco.Web/Search/SearchableTreeCollection.cs @@ -41,4 +41,4 @@ namespace Umbraco.Web.Search public SearchableApplicationTree this[string key] => _dictionary[key]; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Search/UmbracoTreeSearcher.cs b/src/Umbraco.Web/Search/UmbracoTreeSearcher.cs index a32f6a0497..917df00c4c 100644 --- a/src/Umbraco.Web/Search/UmbracoTreeSearcher.cs +++ b/src/Umbraco.Web/Search/UmbracoTreeSearcher.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -332,4 +332,4 @@ namespace Umbraco.Web.Search } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/BackOfficeCookieManager.cs b/src/Umbraco.Web/Security/Identity/BackOfficeCookieManager.cs index c2e7ff72e6..c5ad3d121c 100644 --- a/src/Umbraco.Web/Security/Identity/BackOfficeCookieManager.cs +++ b/src/Umbraco.Web/Security/Identity/BackOfficeCookieManager.cs @@ -96,7 +96,7 @@ namespace Umbraco.Web.Security.Identity if (//check the explicit flag (checkForceAuthTokens && owinContext.Get(Constants.Security.ForceReAuthFlag) != null) - || (checkForceAuthTokens && httpContext.Success && httpContext.Result.Items[Constants.Security.ForceReAuthFlag] != null) + || (checkForceAuthTokens && httpContext.Success && httpContext.Result.Items[Constants.Security.ForceReAuthFlag] != null) //check back office || request.Uri.IsBackOfficeRequest(HttpRuntime.AppDomainAppVirtualPath) //check installer diff --git a/src/Umbraco.Web/Security/MembershipHelper.cs b/src/Umbraco.Web/Security/MembershipHelper.cs index 21de4cbe9d..0413fb4561 100644 --- a/src/Umbraco.Web/Security/MembershipHelper.cs +++ b/src/Umbraco.Web/Security/MembershipHelper.cs @@ -89,7 +89,7 @@ namespace Umbraco.Web.Security if (umbracoContext == null) throw new ArgumentNullException(nameof(umbracoContext)); if (membershipProvider == null) throw new ArgumentNullException(nameof(membershipProvider)); if (roleProvider == null) throw new ArgumentNullException(nameof(roleProvider)); - + _httpContext = umbracoContext.HttpContext; _umbracoContext = umbracoContext; _membershipProvider = membershipProvider; @@ -145,19 +145,19 @@ namespace Umbraco.Web.Security /// /// This will check if the member has access to this path /// - /// + /// /// /// /// - /// This is essentially the same as the PublicAccessServiceExtensions.HasAccess however this will use the PCR cache + /// This is essentially the same as the PublicAccessServiceExtensions.HasAccess however this will use the PCR cache /// of the already looked up roles for the member so this doesn't need to happen more than once. - /// This does a safety check in case of things like unit tests where there is no PCR and if that is the case it will use + /// This does a safety check in case of things like unit tests where there is no PCR and if that is the case it will use /// lookup the roles directly. /// private bool HasAccess(string path, RoleProvider roleProvider) { return _umbracoContext.PublishedContentRequest == null - ? PublicAccessService.HasAccess(path, CurrentUserName, roleProvider.GetRolesForUser) + ? PublicAccessService.HasAccess(path, CurrentUserName, roleProvider.GetRolesForUser) : PublicAccessService.HasAccess(path, CurrentUserName, Router.GetRolesForLogin); } @@ -712,7 +712,7 @@ namespace Umbraco.Web.Security { throw new InvalidOperationException("Could not find provider with name " + membershipProviderName); } - + return ChangePassword(username, passwordModel, provider); } diff --git a/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs b/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs index 20526a6208..04df63a41f 100644 --- a/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs +++ b/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs @@ -457,14 +457,14 @@ namespace Umbraco.Web.Security.Providers throw new ProviderException(string.Format("No member with the username '{0}' found", username)); } - // Non need to update + // Non need to update if (member.IsLockedOut == false) return true; member.IsLockedOut = false; member.FailedPasswordAttempts = 0; MemberService.Save(member); - + return true; } @@ -585,7 +585,7 @@ namespace Umbraco.Web.Security.Providers string.Format( "Login attempt failed for username {0} from IP address {1}, the user is now locked out, max invalid password attempts exceeded", username, - GetCurrentRequestIpAddress())); + GetCurrentRequestIpAddress())); } else { @@ -610,7 +610,7 @@ namespace Umbraco.Web.Security.Providers string.Format( "Login attempt succeeded for username {0} from IP address {1}", username, - GetCurrentRequestIpAddress())); + GetCurrentRequestIpAddress())); } //don't raise events for this! It just sets the member dates, if we do raise events this will diff --git a/src/Umbraco.Web/Security/Providers/UsersMembershipProvider.cs b/src/Umbraco.Web/Security/Providers/UsersMembershipProvider.cs index 51aec7d729..56cbb0be2b 100644 --- a/src/Umbraco.Web/Security/Providers/UsersMembershipProvider.cs +++ b/src/Umbraco.Web/Security/Providers/UsersMembershipProvider.cs @@ -73,7 +73,7 @@ namespace Umbraco.Web.Security.Providers base.Initialize(name, config); if (config == null) { throw new ArgumentNullException("config"); } - + _allowManuallyChangingPassword = config.GetValue("allowManuallyChangingPassword", false); _enablePasswordReset = config.GetValue("enablePasswordReset", false); @@ -89,7 +89,7 @@ namespace Umbraco.Web.Security.Providers } } if (_hasDefaultMember == false && config["defaultUserGroupAlias"] != null) - { + { if (config["defaultUserGroupAlias"].IsNullOrWhiteSpace() == false) { _defaultMemberTypeAlias = config["defaultUserGroupAlias"]; @@ -120,7 +120,7 @@ namespace Umbraco.Web.Security.Providers return _defaultMemberTypeAlias; } } - + /// /// Overridden in order to call the BackOfficeUserManager.UnlockUser method in order to raise the user audit events /// @@ -136,7 +136,7 @@ namespace Umbraco.Web.Security.Providers if (userManager != null) { userManager.RaiseAccountUnlockedEvent(member.Id); - } + } } return result; } @@ -169,7 +169,7 @@ namespace Umbraco.Web.Security.Providers { //we have successfully logged in, if the failed password attempts was modified it means it was reset if (result.Member.WasPropertyDirty("FailedPasswordAttempts")) - { + { userManager.RaiseResetAccessFailedCountEvent(result.Member.Id); } } @@ -185,4 +185,4 @@ namespace Umbraco.Web.Security.Providers : HttpContext.Current.GetOwinContext().GetBackOfficeUserManager(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/ValidateRequestAttempt.cs b/src/Umbraco.Web/Security/ValidateRequestAttempt.cs index 8fc6ff225a..207ceb54c5 100644 --- a/src/Umbraco.Web/Security/ValidateRequestAttempt.cs +++ b/src/Umbraco.Web/Security/ValidateRequestAttempt.cs @@ -2,7 +2,7 @@ { public enum ValidateRequestAttempt { - Success = 0, + Success = 0, FailedNoPrivileges = 100, diff --git a/src/Umbraco.Web/Security/WebSecurity.cs b/src/Umbraco.Web/Security/WebSecurity.cs index 1da336c932..b640e4cb69 100644 --- a/src/Umbraco.Web/Security/WebSecurity.cs +++ b/src/Umbraco.Web/Security/WebSecurity.cs @@ -255,7 +255,7 @@ namespace Umbraco.Web.Security public virtual bool ValidateCurrentUser() { return ValidateCurrentUser(false, true) == ValidateRequestAttempt.Success; - } + } /// /// Validates the current user assigned to the request and ensures the stored user data is valid diff --git a/src/Umbraco.Web/Trees/ContentBlueprintTreeController.cs b/src/Umbraco.Web/Trees/ContentBlueprintTreeController.cs index ebf78c2069..735dc8815b 100644 --- a/src/Umbraco.Web/Trees/ContentBlueprintTreeController.cs +++ b/src/Umbraco.Web/Trees/ContentBlueprintTreeController.cs @@ -1,118 +1,118 @@ -using System.Linq; -using System.Net.Http.Formatting; -using Umbraco.Core; -using Umbraco.Core.Services; -using Umbraco.Core.Models; -using Umbraco.Core.Models.EntityBase; -using Umbraco.Web.Models.Trees; -using Umbraco.Web.Mvc; -using Umbraco.Web.WebApi.Filters; -using Umbraco.Web._Legacy.Actions; -using Constants = Umbraco.Core.Constants; +using System.Linq; +using System.Net.Http.Formatting; +using Umbraco.Core; +using Umbraco.Core.Services; +using Umbraco.Core.Models; +using Umbraco.Core.Models.EntityBase; +using Umbraco.Web.Models.Trees; +using Umbraco.Web.Mvc; +using Umbraco.Web.WebApi.Filters; +using Umbraco.Web._Legacy.Actions; +using Constants = Umbraco.Core.Constants; -namespace Umbraco.Web.Trees -{ - /// - /// The content blueprint tree controller - /// - /// - /// This authorizes based on access to the content section even though it exists in the settings - /// - [UmbracoApplicationAuthorize(Constants.Applications.Content)] - [Tree(Constants.Applications.Settings, Constants.Trees.ContentBlueprints, null, sortOrder: 8)] - [PluginController("UmbracoTrees")] - [CoreTree] - public class ContentBlueprintTreeController : TreeController - { +namespace Umbraco.Web.Trees +{ + /// + /// The content blueprint tree controller + /// + /// + /// This authorizes based on access to the content section even though it exists in the settings + /// + [UmbracoApplicationAuthorize(Constants.Applications.Content)] + [Tree(Constants.Applications.Settings, Constants.Trees.ContentBlueprints, null, sortOrder: 8)] + [PluginController("UmbracoTrees")] + [CoreTree] + public class ContentBlueprintTreeController : TreeController + { - protected override TreeNode CreateRootNode(FormDataCollection queryStrings) - { - var root = base.CreateRootNode(queryStrings); + protected override TreeNode CreateRootNode(FormDataCollection queryStrings) + { + var root = base.CreateRootNode(queryStrings); - //this will load in a custom UI instead of the dashboard for the root node - root.RoutePath = string.Format("{0}/{1}/{2}", Constants.Applications.Settings, Constants.Trees.ContentBlueprints, "intro"); + //this will load in a custom UI instead of the dashboard for the root node + root.RoutePath = string.Format("{0}/{1}/{2}", Constants.Applications.Settings, Constants.Trees.ContentBlueprints, "intro"); - return root; - } - protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings) - { - var nodes = new TreeNodeCollection(); + return root; + } + protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings) + { + var nodes = new TreeNodeCollection(); - //get all blueprints - var entities = Services.EntityService.GetChildren(Constants.System.Root, UmbracoObjectTypes.DocumentBlueprint).ToArray(); + //get all blueprints + var entities = Services.EntityService.GetChildren(Constants.System.Root, UmbracoObjectTypes.DocumentBlueprint).ToArray(); - //check if we're rendering the root in which case we'll render the content types that have blueprints - if (id == Constants.System.Root.ToInvariantString()) - { - //get all blueprint content types - var contentTypeAliases = entities.Select(x => ((UmbracoEntity) x).ContentTypeAlias).Distinct(); - //get the ids - var contentTypeIds = Services.ContentTypeService.GetAllContentTypeIds(contentTypeAliases.ToArray()).ToArray(); + //check if we're rendering the root in which case we'll render the content types that have blueprints + if (id == Constants.System.Root.ToInvariantString()) + { + //get all blueprint content types + var contentTypeAliases = entities.Select(x => ((UmbracoEntity) x).ContentTypeAlias).Distinct(); + //get the ids + var contentTypeIds = Services.ContentTypeService.GetAllContentTypeIds(contentTypeAliases.ToArray()).ToArray(); - //now get the entities ... it's a bit round about but still smaller queries than getting all document types - var docTypeEntities = contentTypeIds.Length == 0 - ? new IUmbracoEntity[0] - : Services.EntityService.GetAll(UmbracoObjectTypes.DocumentType, contentTypeIds).ToArray(); + //now get the entities ... it's a bit round about but still smaller queries than getting all document types + var docTypeEntities = contentTypeIds.Length == 0 + ? new IUmbracoEntity[0] + : Services.EntityService.GetAll(UmbracoObjectTypes.DocumentType, contentTypeIds).ToArray(); - nodes.AddRange(docTypeEntities - .Select(entity => - { - var treeNode = CreateTreeNode(entity, Constants.ObjectTypes.DocumentBlueprint, id, queryStrings, "icon-item-arrangement", true); - treeNode.Path = string.Format("-1,{0}", entity.Id); - treeNode.NodeType = "document-type-blueprints"; - //TODO: This isn't the best way to ensure a noop process for clicking a node but it works for now. - treeNode.AdditionalData["jsClickCallback"] = "javascript:void(0);"; - return treeNode; - })); + nodes.AddRange(docTypeEntities + .Select(entity => + { + var treeNode = CreateTreeNode(entity, Constants.ObjectTypes.DocumentBlueprint, id, queryStrings, "icon-item-arrangement", true); + treeNode.Path = string.Format("-1,{0}", entity.Id); + treeNode.NodeType = "document-type-blueprints"; + //TODO: This isn't the best way to ensure a noop process for clicking a node but it works for now. + treeNode.AdditionalData["jsClickCallback"] = "javascript:void(0);"; + return treeNode; + })); - return nodes; - } + return nodes; + } - var intId = id.TryConvertTo(); - //Get the content type - var ct = Services.ContentTypeService.Get(intId.Result); - if (ct == null) return nodes; + var intId = id.TryConvertTo(); + //Get the content type + var ct = Services.ContentTypeService.Get(intId.Result); + if (ct == null) return nodes; - var blueprintsForDocType = entities.Where(x => ct.Alias == ((UmbracoEntity) x).ContentTypeAlias); - nodes.AddRange(blueprintsForDocType - .Select(entity => - { - var treeNode = CreateTreeNode(entity, Constants.ObjectTypes.DocumentBlueprint, id, queryStrings, "icon-blueprint", false); - treeNode.Path = $"-1,{ct.Id},{entity.Id}"; - return treeNode; - })); + var blueprintsForDocType = entities.Where(x => ct.Alias == ((UmbracoEntity) x).ContentTypeAlias); + nodes.AddRange(blueprintsForDocType + .Select(entity => + { + var treeNode = CreateTreeNode(entity, Constants.ObjectTypes.DocumentBlueprint, id, queryStrings, "icon-blueprint", false); + treeNode.Path = $"-1,{ct.Id},{entity.Id}"; + return treeNode; + })); - return nodes; - } + return nodes; + } - protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings) - { - var menu = new MenuItemCollection(); + protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings) + { + var menu = new MenuItemCollection(); - if (id == Constants.System.Root.ToInvariantString()) + if (id == Constants.System.Root.ToInvariantString()) { // root actions - menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionNew.Instance.Alias))); - menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true); - return menu; - } - var cte = Services.EntityService.Get(int.Parse(id), UmbracoObjectTypes.DocumentType); - //only refresh & create if it's a content type - if (cte != null) - { - var ct = Services.ContentTypeService.Get(cte.Id); - var createItem = menu.Items.Add(Services.TextService.Localize($"actions/{ActionCreateBlueprintFromContent.Instance.Alias}")); - createItem.NavigateToRoute("/settings/contentBlueprints/edit/-1?create=true&doctype=" + ct.Alias); + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionNew.Instance.Alias))); + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true); + return menu; + } + var cte = Services.EntityService.Get(int.Parse(id), UmbracoObjectTypes.DocumentType); + //only refresh & create if it's a content type + if (cte != null) + { + var ct = Services.ContentTypeService.Get(cte.Id); + var createItem = menu.Items.Add(Services.TextService.Localize($"actions/{ActionCreateBlueprintFromContent.Instance.Alias}")); + createItem.NavigateToRoute("/settings/contentBlueprints/edit/-1?create=true&doctype=" + ct.Alias); - menu.Items.Add(Services.TextService.Localize($"actions/{ActionRefresh.Instance.Alias}"), true); + menu.Items.Add(Services.TextService.Localize($"actions/{ActionRefresh.Instance.Alias}"), true); - return menu; - } + return menu; + } - menu.Items.Add(Services.TextService.Localize($"actions/{ActionDelete.Instance.Alias}")); + menu.Items.Add(Services.TextService.Localize($"actions/{ActionDelete.Instance.Alias}")); - return menu; - } + return menu; + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/Trees/ContentTreeController.cs b/src/Umbraco.Web/Trees/ContentTreeController.cs index cc5c5ebfbd..1ed3fb74a0 100644 --- a/src/Umbraco.Web/Trees/ContentTreeController.cs +++ b/src/Umbraco.Web/Trees/ContentTreeController.cs @@ -35,7 +35,7 @@ namespace Umbraco.Web.Trees public class ContentTreeController : ContentTreeControllerBase, ISearchableTree { private readonly UmbracoTreeSearcher _treeSearcher = new UmbracoTreeSearcher(); - + protected override int RecycleBinId => Constants.System.RecycleBinContent; protected override bool RecycleBinSmells => Services.ContentService.RecycleBinSmells(); @@ -98,7 +98,7 @@ namespace Umbraco.Web.Trees if (id == Constants.System.Root.ToInvariantString()) { var menu = new MenuItemCollection(); - + // if the user's start node is not the root then the only menu item to display is refresh if (UserStartNodes.Contains(Constants.System.Root) == false) { @@ -246,7 +246,7 @@ namespace Umbraco.Web.Trees var menuItem = menu.Items.Add(Services.TextService.Localize("actions", Current.Actions.GetAction().Alias), hasSeparator); if (convert) menuItem.ConvertLegacyMenuItem(item, "content", "content"); } - + public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null) { return _treeSearcher.ExamineSearch(Umbraco, query, UmbracoEntityTypes.Document, pageSize, pageIndex, out totalFound, searchFrom); diff --git a/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs b/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs index b0f76aba00..33374e2060 100644 --- a/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs +++ b/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs @@ -74,7 +74,7 @@ namespace Umbraco.Web.Trees protected abstract TreeNode GetSingleTreeNode(IUmbracoEntity e, string parentId, FormDataCollection queryStrings); /// - /// Returns a for the and + /// Returns a for the and /// attaches some meta data to the node if the user doesn't have start node access to it when in dialog mode /// /// @@ -88,7 +88,7 @@ namespace Umbraco.Web.Trees if (entityIsAncestorOfStartNodes == false) return null; - var treeNode = GetSingleTreeNode(e, parentId, queryStrings); + var treeNode = GetSingleTreeNode(e, parentId, queryStrings); if (hasPathAccess == false) { treeNode.AdditionalData["noAccess"] = true; @@ -110,7 +110,7 @@ namespace Umbraco.Web.Trees /// Returns the user's start node for this tree /// protected abstract int[] UserStartNodes { get; } - + protected virtual TreeNodeCollection PerformGetTreeNodes(string id, FormDataCollection queryStrings) { var nodes = new TreeNodeCollection(); @@ -167,7 +167,7 @@ namespace Umbraco.Web.Trees if (int.TryParse(pathParts[1], out siteNodeId) == false) continue; - //we'll look up this + //we'll look up this siteNodeIds.Add(siteNodeId); } var siteNodes = Services.EntityService.GetAll(UmbracoObjectType, siteNodeIds.ToArray()) @@ -176,13 +176,13 @@ namespace Umbraco.Web.Trees //add site nodes nodes.AddRange(siteNodes.Select(e => GetSingleTreeNodeWithAccessCheck(e, id, queryStrings)).Where(node => node != null)); - + return nodes; } nodes.AddRange(entities.Select(e => GetSingleTreeNodeWithAccessCheck(e, id, queryStrings)).Where(node => node != null)); return nodes; - } + } protected abstract MenuItemCollection PerformGetMenuForNode(string id, FormDataCollection queryStrings); @@ -353,7 +353,7 @@ namespace Umbraco.Web.Trees var permission = Services.UserService.GetPermissions(Security.CurrentUser, dd.Path); var actions = global::Umbraco.Web._Legacy.Actions.Action.FromEntityPermission(permission) .ToList(); - + // A user is allowed to delete their own stuff if (dd.CreatorId == Security.GetUserId() && actions.Contains(ActionDelete.Instance) == false) actions.Add(ActionDelete.Instance); @@ -397,7 +397,7 @@ namespace Umbraco.Web.Trees { var guidUdi = idUdi as GuidUdi; if (guidUdi != null) - return new Tuple(guidUdi.Guid, null); + return new Tuple(guidUdi.Guid, null); } return null; diff --git a/src/Umbraco.Web/Trees/ContentTypeTreeController.cs b/src/Umbraco.Web/Trees/ContentTypeTreeController.cs index 4b26f8d065..18a2108dc2 100644 --- a/src/Umbraco.Web/Trees/ContentTypeTreeController.cs +++ b/src/Umbraco.Web/Trees/ContentTypeTreeController.cs @@ -104,7 +104,7 @@ namespace Umbraco.Web.Trees } menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true); - + } else { diff --git a/src/Umbraco.Web/Trees/ISearchableTree.cs b/src/Umbraco.Web/Trees/ISearchableTree.cs index ac733539b2..6e52b054b4 100644 --- a/src/Umbraco.Web/Trees/ISearchableTree.cs +++ b/src/Umbraco.Web/Trees/ISearchableTree.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Web.Models.ContentEditing; namespace Umbraco.Web.Trees @@ -23,4 +23,4 @@ namespace Umbraco.Web.Trees /// IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs index 19978fc3db..4ab67224df 100644 --- a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs +++ b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs @@ -36,7 +36,7 @@ namespace Umbraco.Web.Trees { Current.Logger.Warn("Cannot render tree: " + appTree.Alias + ". Cannot render a " + typeof(TreeController) + " tree type with the legacy web services."); return null; - + //var legacyAtt = controllerAttempt.Result.GetCustomAttribute(false); //if (legacyAtt == null) //{ @@ -228,7 +228,7 @@ namespace Umbraco.Web.Trees new LegacyUrlAction( "dialogs/sort.aspx?id=" + nodeId + "&nodeType=" + nodeType + "&app=" + currentSection + "&rnd=" + DateTime.UtcNow.Ticks, Current.Services.TextService.Localize("actions/sort"))); - + case "UmbClientMgr.appActions().actionProtect()": return Attempt.Succeed( new LegacyUrlAction( @@ -274,7 +274,7 @@ namespace Umbraco.Web.Trees new LegacyUrlAction( "dialogs/sendToTranslation.aspx?id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, Current.Services.TextService.Localize("actions/sendToTranslate"))); - + case "UmbClientMgr.appActions().actionImport()": return Attempt.Succeed( new LegacyUrlAction( @@ -290,7 +290,7 @@ namespace Umbraco.Web.Trees new LegacyUrlAction( "dialogs/viewAuditTrail.aspx?nodeId=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, Current.Services.TextService.Localize("actions/auditTrail"))); - + } return Attempt.Fail(); } diff --git a/src/Umbraco.Web/Trees/MediaTreeController.cs b/src/Umbraco.Web/Trees/MediaTreeController.cs index 7a3a557216..f2c6a93ed0 100644 --- a/src/Umbraco.Web/Trees/MediaTreeController.cs +++ b/src/Umbraco.Web/Trees/MediaTreeController.cs @@ -33,7 +33,7 @@ namespace Umbraco.Web.Trees public class MediaTreeController : ContentTreeControllerBase, ISearchableTree { private readonly UmbracoTreeSearcher _treeSearcher = new UmbracoTreeSearcher(); - + protected override int RecycleBinId => Constants.System.RecycleBinMedia; protected override bool RecycleBinSmells => Services.MediaService.RecycleBinSmells(); diff --git a/src/Umbraco.Web/Trees/UserTreeController.cs b/src/Umbraco.Web/Trees/UserTreeController.cs index 2027908657..3f7a6f8ce7 100644 --- a/src/Umbraco.Web/Trees/UserTreeController.cs +++ b/src/Umbraco.Web/Trees/UserTreeController.cs @@ -42,4 +42,4 @@ namespace Umbraco.Web.Trees return menu; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/Pages/UmbracoEnsuredPage.cs b/src/Umbraco.Web/UI/Pages/UmbracoEnsuredPage.cs index f2c109bd6c..5eb26a4644 100644 --- a/src/Umbraco.Web/UI/Pages/UmbracoEnsuredPage.cs +++ b/src/Umbraco.Web/UI/Pages/UmbracoEnsuredPage.cs @@ -42,10 +42,10 @@ namespace Umbraco.Web.UI.Pages /// protected void CheckPathAndPermissions(int entityId, UmbracoObjectTypes objectType, IAction actionToCheck) { - if (objectType != UmbracoObjectTypes.Document && objectType != UmbracoObjectTypes.Media) - return; + if (objectType != UmbracoObjectTypes.Document && objectType != UmbracoObjectTypes.Media) + return; - //check path access + //check path access var entity = entityId == Constants.System.Root ? UmbracoEntity.Root diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index 2fb7b46aa7..48755a78be 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -985,7 +985,7 @@ namespace Umbraco.Web { return StringUtilities.Truncate(html, length, addElipsis, treatTagsAsContent); } - + #region Truncate by Words /// @@ -1027,9 +1027,9 @@ namespace Umbraco.Web return Truncate(html, length, addElipsis, false); } - + #endregion - + #endregion #region If diff --git a/src/Umbraco.Web/UrlHelperRenderExtensions.cs b/src/Umbraco.Web/UrlHelperRenderExtensions.cs index b3c601b90f..100881241f 100644 --- a/src/Umbraco.Web/UrlHelperRenderExtensions.cs +++ b/src/Umbraco.Web/UrlHelperRenderExtensions.cs @@ -365,4 +365,4 @@ namespace Umbraco.Web return null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/AngularJsonMediaTypeFormatter.cs b/src/Umbraco.Web/WebApi/AngularJsonMediaTypeFormatter.cs index dfa3622795..0e7cf6453a 100644 --- a/src/Umbraco.Web/WebApi/AngularJsonMediaTypeFormatter.cs +++ b/src/Umbraco.Web/WebApi/AngularJsonMediaTypeFormatter.cs @@ -39,9 +39,9 @@ namespace Umbraco.Web.WebApi var effectiveEncoding = SelectCharacterEncoding(content == null ? null : content.Headers); - using (var streamWriter = new StreamWriter(writeStream, effectiveEncoding, + using (var streamWriter = new StreamWriter(writeStream, effectiveEncoding, //we are only writing a few chars so we don't need to allocate a large buffer - 128, + 128, //this is important! We don't want to close the stream, the base class is in charge of stream management, we just want to write to it. leaveOpen:true)) { @@ -50,7 +50,7 @@ namespace Umbraco.Web.WebApi streamWriter.Write(XsrfPrefix); streamWriter.Flush(); await base.WriteToStreamAsync(type, value, writeStream, content, transportContext); - } + } } } diff --git a/src/Umbraco.Web/WebApi/EnableDetailedErrorsAttribute.cs b/src/Umbraco.Web/WebApi/EnableDetailedErrorsAttribute.cs index 1d35d19134..a62df6b5e4 100644 --- a/src/Umbraco.Web/WebApi/EnableDetailedErrorsAttribute.cs +++ b/src/Umbraco.Web/WebApi/EnableDetailedErrorsAttribute.cs @@ -14,4 +14,4 @@ namespace Umbraco.Web.WebApi actionContext.ControllerContext.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/AngularAntiForgeryHelper.cs b/src/Umbraco.Web/WebApi/Filters/AngularAntiForgeryHelper.cs index 6eed3c095d..92589fc370 100644 --- a/src/Umbraco.Web/WebApi/Filters/AngularAntiForgeryHelper.cs +++ b/src/Umbraco.Web/WebApi/Filters/AngularAntiForgeryHelper.cs @@ -115,6 +115,6 @@ namespace Umbraco.Web.WebApi.Filters cookieToken == null ? null : cookieToken, out failedReason); } - + } } diff --git a/src/Umbraco.Web/WebApi/Filters/AppendUserModifiedHeaderAttribute.cs b/src/Umbraco.Web/WebApi/Filters/AppendUserModifiedHeaderAttribute.cs index 77fee75693..3b2ee30aa0 100644 --- a/src/Umbraco.Web/WebApi/Filters/AppendUserModifiedHeaderAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/AppendUserModifiedHeaderAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Http.Filters; using Umbraco.Core; using Umbraco.Core.Models; @@ -50,7 +50,7 @@ namespace Umbraco.Web.WebApi.Filters var actionContext = actionExecutedContext.ActionContext; if (actionContext.ActionArguments[_userIdParameter] == null) { - throw new InvalidOperationException("No argument found for the current action with the name: " + _userIdParameter); + throw new InvalidOperationException("No argument found for the current action with the name: " + _userIdParameter); } var user = UmbracoContext.Current.Security.CurrentUser; @@ -73,4 +73,4 @@ namespace Umbraco.Web.WebApi.Filters throw new InvalidOperationException("The id type: " + parameterValue.GetType() + " is not a supported id"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/CheckIfUserTicketDataIsStaleAttribute.cs b/src/Umbraco.Web/WebApi/Filters/CheckIfUserTicketDataIsStaleAttribute.cs index 4b44bd4a95..d2781dbd2d 100644 --- a/src/Umbraco.Web/WebApi/Filters/CheckIfUserTicketDataIsStaleAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/CheckIfUserTicketDataIsStaleAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -33,7 +33,7 @@ namespace Umbraco.Web.WebApi.Filters //we need new tokens and append the custom header if changes have been made if (actionExecutedContext.ActionContext.Request.Properties.ContainsKey(typeof(CheckIfUserTicketDataIsStaleAttribute).Name)) - { + { var tokenFilter = new SetAngularAntiForgeryTokensAttribute(); tokenFilter.OnActionExecuted(actionExecutedContext); @@ -65,7 +65,7 @@ namespace Umbraco.Web.WebApi.Filters var user = Current.Services.UserService.GetUserById(userId.Result); if (user == null) return; - + //a list of checks to execute, if any of them pass then we resync var checks = new Func[] { @@ -74,7 +74,7 @@ namespace Umbraco.Web.WebApi.Filters { var culture = UserExtensions.GetUserCulture(user, Current.Services.TextService); return culture != null && culture.ToString() != identity.Culture; - }, + }, () => user.AllowedSections.UnsortedSequenceEqual(identity.AllowedApplications) == false, () => user.Groups.Select(x => x.Alias).UnsortedSequenceEqual(identity.Roles) == false, () => @@ -91,7 +91,7 @@ namespace Umbraco.Web.WebApi.Filters if (checks.Any(check => check())) { - await ReSync(user, actionContext); + await ReSync(user, actionContext); } } @@ -115,8 +115,8 @@ namespace Umbraco.Web.WebApi.Filters await signInManager.SignInAsync(backOfficeIdentityUser, isPersistent: true, rememberBrowser: false); //flag that we've made changes - actionContext.Request.Properties[typeof(CheckIfUserTicketDataIsStaleAttribute).Name] = true; + actionContext.Request.Properties[typeof(CheckIfUserTicketDataIsStaleAttribute).Name] = true; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs b/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs index 7a9d2c8775..f82d4ae7b8 100644 --- a/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs @@ -91,8 +91,8 @@ namespace Umbraco.Web.WebApi.Filters actionContext.Request.Properties, UmbracoContext.Current.Security.CurrentUser, Current.Services.UserService, - Current.Services.ContentService, - Current.Services.EntityService, + Current.Services.ContentService, + Current.Services.EntityService, nodeId, _permissionToCheck.HasValue ? new[]{_permissionToCheck.Value}: null)) { base.OnActionExecuting(actionContext); diff --git a/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs b/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs index 2e3c075f50..e0702a71ab 100644 --- a/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs @@ -120,7 +120,7 @@ namespace Umbraco.Web.WebApi.Filters actionContext.Request.Properties, UmbracoContext.Current.Security.CurrentUser, Current.Services.MediaService, - Current.Services.EntityService, + Current.Services.EntityService, nodeId)) { base.OnActionExecuting(actionContext); diff --git a/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingContentAttribute.cs b/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingContentAttribute.cs index 42a1353c7e..59dd55304e 100644 --- a/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingContentAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingContentAttribute.cs @@ -22,7 +22,7 @@ namespace Umbraco.Web.WebApi.Filters private readonly IEntityService _entityService; private readonly char _permissionToCheck; - public FilterAllowedOutgoingContentAttribute(Type outgoingType) + public FilterAllowedOutgoingContentAttribute(Type outgoingType) : this(outgoingType, Current.Services.UserService, Current.Services.EntityService) { _permissionToCheck = ActionBrowse.Instance.Letter; diff --git a/src/Umbraco.Web/WebApi/HttpRequestMessageExtensions.cs b/src/Umbraco.Web/WebApi/HttpRequestMessageExtensions.cs index 6486bb2cba..e260277093 100644 --- a/src/Umbraco.Web/WebApi/HttpRequestMessageExtensions.cs +++ b/src/Umbraco.Web/WebApi/HttpRequestMessageExtensions.cs @@ -19,10 +19,10 @@ namespace Umbraco.Web.WebApi /// /// internal static Attempt TryGetOwinContext(this HttpRequestMessage request) - { + { // occurs in unit tests? if (request.Properties.TryGetValue("MS_OwinContext", out var o) && o is IOwinContext owinContext) - return Attempt.Succeed(owinContext); + return Attempt.Succeed(owinContext); var httpContext = request.TryGetHttpContext(); try diff --git a/src/Umbraco.Web/WebApi/UmbracoAuthorizeAttribute.cs b/src/Umbraco.Web/WebApi/UmbracoAuthorizeAttribute.cs index a183314086..6099366690 100644 --- a/src/Umbraco.Web/WebApi/UmbracoAuthorizeAttribute.cs +++ b/src/Umbraco.Web/WebApi/UmbracoAuthorizeAttribute.cs @@ -42,7 +42,7 @@ namespace Umbraco.Web.WebApi public UmbracoAuthorizeAttribute() : this(true) { } - + public UmbracoAuthorizeAttribute(bool requireApproval) { _requireApproval = requireApproval; diff --git a/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs b/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs index 0b43f41120..a93d41a490 100644 --- a/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs +++ b/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs @@ -23,7 +23,7 @@ namespace Umbraco.Web.WebApi { private BackOfficeUserManager _userManager; private bool _userisValidated = false; - + protected BackOfficeUserManager UserManager => _userManager ?? (_userManager = TryGetOwinContext().Result.GetBackOfficeUserManager()); @@ -35,7 +35,7 @@ namespace Umbraco.Web.WebApi protected User UmbracoUser { get - { + { //throw exceptions if not valid (true) if (!_userisValidated) { diff --git a/src/Umbraco.Web/WebApi/UnhandedExceptionLoggerConfigurationAttribute.cs b/src/Umbraco.Web/WebApi/UnhandedExceptionLoggerConfigurationAttribute.cs index 51c43b0821..6dc1a49eb1 100644 --- a/src/Umbraco.Web/WebApi/UnhandedExceptionLoggerConfigurationAttribute.cs +++ b/src/Umbraco.Web/WebApi/UnhandedExceptionLoggerConfigurationAttribute.cs @@ -15,7 +15,7 @@ namespace Umbraco.Web.WebApi /// /// /// Important to note that the will only be called if the controller has an ExceptionFilter applied - /// to it, so to kill two birds with one stone, this class inherits from ExceptionFilterAttribute purely to force webapi to use the + /// to it, so to kill two birds with one stone, this class inherits from ExceptionFilterAttribute purely to force webapi to use the /// IExceptionLogger (strange) /// public class UnhandedExceptionLoggerConfigurationAttribute : ExceptionFilterAttribute, IControllerConfiguration @@ -24,6 +24,6 @@ namespace Umbraco.Web.WebApi { controllerSettings.Services.Add(typeof(IExceptionLogger), new UnhandledExceptionLogger()); } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/UnhandledExceptionLogger.cs b/src/Umbraco.Web/WebApi/UnhandledExceptionLogger.cs index 2bb0e33212..7c289889c2 100644 --- a/src/Umbraco.Web/WebApi/UnhandledExceptionLogger.cs +++ b/src/Umbraco.Web/WebApi/UnhandledExceptionLogger.cs @@ -30,8 +30,8 @@ namespace Umbraco.Web.WebApi && context.Exception != null) { _logger.Error(context.ExceptionContext.ActionContext.ControllerContext.Controller.GetType(), "Unhandled controller exception occurred", context.Exception); - } + } } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/library.cs b/src/Umbraco.Web/umbraco.presentation/library.cs index 7e856b67c4..8db1e5e246 100644 --- a/src/Umbraco.Web/umbraco.presentation/library.cs +++ b/src/Umbraco.Web/umbraco.presentation/library.cs @@ -413,7 +413,7 @@ namespace umbraco } /// - /// Generates a hash based on the text string passed in. This method will detect the + /// Generates a hash based on the text string passed in. This method will detect the /// security requirements (is FIPS enabled) and return an appropriate hash. /// /// The text to create a hash from diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs index 8477585116..2187acb520 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs @@ -88,7 +88,7 @@ namespace umbraco.cms.presentation.developer { macroName.Text = macro.Name; macroAlias.Text = macro.Alias; - macroKey.Text = macro.Key.ToString(); + macroKey.Text = macro.Key.ToString(); macroXslt.Text = macro.XsltPath; cachePeriod.Text = macro.CacheDuration.ToInvariantString(); macroRenderContent.Checked = macro.DontRender == false; @@ -403,14 +403,14 @@ namespace umbraco.cms.presentation.developer ///
protected global::System.Web.UI.WebControls.TextBox macroAlias; - /// - /// macroAlias control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label macroKey; + /// + /// macroAlias control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label macroKey; /// /// Pane1_2 control. diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/RelationTypesWebService.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/RelationTypesWebService.asmx.cs index 6fdd3b54a3..555176aaec 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/RelationTypesWebService.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/RelationTypesWebService.asmx.cs @@ -24,7 +24,7 @@ namespace umbraco.cms.presentation.developer.RelationTypes { var user = UmbracoContext.Current.Security.CurrentUser; - if (user.IsAdmin()) + if (user.IsAdmin()) { var relationService = Current.Services.RelationService; var relationType = relationService.GetRelationTypeById(relationTypeId); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.cs index ea1ff391e5..51f1b4f114 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.cs @@ -37,7 +37,7 @@ namespace umbraco.dialogs pane_domains.Visible = false; p_buttons.Visible = false; return; - } + } pane_language.Title = Services.TextService.Localize("assignDomain/setLanguage"); pane_domains.Title = Services.TextService.Localize("assignDomain/setDomains"); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs index 4717bc48e3..20a4e2ba54 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs @@ -79,7 +79,7 @@ namespace umbraco.presentation.dialogs foreach (var word in words) operation = operation.And().GroupedOr(new[] { "__nodeName" }, new[] { word }); - // ensure the user can only find nodes they are allowed to see + // ensure the user can only find nodes they are allowed to see // fixme BORKED because we don't deal with all start nodes if (Security.CurrentUser.StartContentIds.FirstOrDefault() > 0) { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs index d329147ddb..78f9a8ec9e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs @@ -68,7 +68,7 @@ namespace umbraco.cms.presentation var app = Request.GetItemAsString("app"); var icon = "../images/umbraco/doc.gif"; - + if (ParentIdAsInt.HasValue) { if (app == Constants.Applications.Media)