From 99ae94a82f5a948c8a5d452088654d9a0672518a Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 20 Nov 2013 16:40:30 +1100 Subject: [PATCH 01/18] Ensures that members are auto-approved if creating a member via the legacy members API. --- .../members/MembersMembershipProvider.cs | 39 ++++++++++++++++++- .../umbraco.providers.csproj | 4 ++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/umbraco.providers/members/MembersMembershipProvider.cs b/src/umbraco.providers/members/MembersMembershipProvider.cs index b9dc4872a7..40c5564040 100644 --- a/src/umbraco.providers/members/MembersMembershipProvider.cs +++ b/src/umbraco.providers/members/MembersMembershipProvider.cs @@ -880,7 +880,16 @@ namespace umbraco.providers.members string approveStatus = GetMemberProperty(m, m_ApprovedPropertyTypeAlias, true); if (!String.IsNullOrEmpty(approveStatus)) { - bool.TryParse(approveStatus, out isApproved); + //try parsing as bool first (just in case) + if (bool.TryParse(approveStatus, out isApproved) == false) + { + int intStatus; + //if that fails, try parsing as int (since its normally stored as 0 or 1) + if (int.TryParse(approveStatus, out intStatus)) + { + isApproved = intStatus != 0; + } + } } } } @@ -1019,4 +1028,32 @@ namespace umbraco.providers.members #endregion } + + /// + /// Adds some event handling + /// + public class MembershipEventHandler : ApplicationEventHandler + { + protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) + { + Member.New += Member_New; + } + + void Member_New(Member sender, NewEventArgs e) + { + //This is a bit of a hack to ensure that the member is approved when created since many people will be using + // this old api to create members on the front-end and they need to be approved - which is based on whether or not + // the Umbraco membership provider is configured. + var provider = Membership.Provider as UmbracoMembershipProvider; + if (provider != null) + { + var approvedField = provider.ApprovedPropertyTypeAlias; + var property = sender.getProperty(approvedField); + if (property != null) + { + property.Value = 1; + } + } + } + } } diff --git a/src/umbraco.providers/umbraco.providers.csproj b/src/umbraco.providers/umbraco.providers.csproj index 7c6f3892eb..2a8c4503be 100644 --- a/src/umbraco.providers/umbraco.providers.csproj +++ b/src/umbraco.providers/umbraco.providers.csproj @@ -105,6 +105,10 @@ {C7CB79F0-1C97-4B33-BFA7-00731B579AE2} umbraco.datalayer + + {511F6D8D-7717-440A-9A57-A507E9A8B27F} + umbraco.interfaces + From b13c3aa3b976a62f3feef3cd5109f9b4ce52a76c Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 20 Nov 2013 16:59:41 +1100 Subject: [PATCH 02/18] Fixes: U4-3610 When adding another tab to a member type no members will load and result in a YSOD Conflicts: src/Umbraco.Core/Persistence/Relators/PropertyTypePropertyGroupRelator.cs --- .../Relators/PropertyTypePropertyGroupRelator.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Persistence/Relators/PropertyTypePropertyGroupRelator.cs b/src/Umbraco.Core/Persistence/Relators/PropertyTypePropertyGroupRelator.cs index f02ca8e1b1..a1b226d65b 100644 --- a/src/Umbraco.Core/Persistence/Relators/PropertyTypePropertyGroupRelator.cs +++ b/src/Umbraco.Core/Persistence/Relators/PropertyTypePropertyGroupRelator.cs @@ -19,11 +19,17 @@ namespace Umbraco.Core.Persistence.Relators // Is this the same MemberTypeReadOnlyDto as the current one we're processing if (Current != null && Current.UniqueId == a.UniqueId) { - // Yes, just add this PropertyTypeReadOnlyDto to the current MemberTypeReadOnlyDto's collection - Current.PropertyTypes.Add(p); - + //This property may already be added so we need to check for that + if (p.Id.HasValue && Current.PropertyTypes.Any(x => x.Id == p.Id.Value) == false) + { + // Add this PropertyTypeReadOnlyDto to the current MemberTypeReadOnlyDto's collection + Current.PropertyTypes.Add(p); + } + if (g.Id.HasValue && Current.PropertyTypeGroups != null && Current.PropertyTypeGroups.Any(x => x.Id == g.Id.Value) == false) + { Current.PropertyTypeGroups.Add(g); + } // Return null to indicate we're not done with this MemberTypeReadOnlyDto yet return null; @@ -46,7 +52,9 @@ namespace Umbraco.Core.Persistence.Relators Current.PropertyTypeGroups = new List(); if (g.Id.HasValue) + { Current.PropertyTypeGroups.Add(g); + } // Return the now populated previous MemberTypeReadOnlyDto (or null if first time through) return prev; From 416a9ed064c4e0aefb1d6e09bcb65756236e6842 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 20 Nov 2013 17:10:15 +1100 Subject: [PATCH 03/18] Comments out backported code - need to wait till we merge in the custom membership branch. --- .../members/MembersMembershipProvider.cs | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/src/umbraco.providers/members/MembersMembershipProvider.cs b/src/umbraco.providers/members/MembersMembershipProvider.cs index 40c5564040..b18f3f0583 100644 --- a/src/umbraco.providers/members/MembersMembershipProvider.cs +++ b/src/umbraco.providers/members/MembersMembershipProvider.cs @@ -1029,31 +1029,33 @@ namespace umbraco.providers.members #endregion } - /// - /// Adds some event handling - /// - public class MembershipEventHandler : ApplicationEventHandler - { - protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) - { - Member.New += Member_New; - } + //TODO: We need to re-enable this in 6.2, but need to back port most of the membership provider changes (still in a custom branch atm) - void Member_New(Member sender, NewEventArgs e) - { - //This is a bit of a hack to ensure that the member is approved when created since many people will be using - // this old api to create members on the front-end and they need to be approved - which is based on whether or not - // the Umbraco membership provider is configured. - var provider = Membership.Provider as UmbracoMembershipProvider; - if (provider != null) - { - var approvedField = provider.ApprovedPropertyTypeAlias; - var property = sender.getProperty(approvedField); - if (property != null) - { - property.Value = 1; - } - } - } - } + ///// + ///// Adds some event handling + ///// + //public class MembershipEventHandler : ApplicationEventHandler + //{ + // protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) + // { + // Member.New += Member_New; + // } + + // void Member_New(Member sender, NewEventArgs e) + // { + // //This is a bit of a hack to ensure that the member is approved when created since many people will be using + // // this old api to create members on the front-end and they need to be approved - which is based on whether or not + // // the Umbraco membership provider is configured. + // var provider = Membership.Provider as UmbracoMembershipProvider; + // if (provider != null) + // { + // var approvedField = provider.ApprovedPropertyTypeAlias; + // var property = sender.getProperty(approvedField); + // if (property != null) + // { + // property.Value = 1; + // } + // } + // } + //} } From 5a928aa459b5cd926633b2d85018daca8e5846ae Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 20 Nov 2013 17:28:33 +1100 Subject: [PATCH 04/18] FIxes installer when duplicate conflicts: U4-3612 Cannot install Txt starter kit in the back office Conflicts: src/umbraco.cms/businesslogic/Packager/Installer.cs --- .../businesslogic/Packager/Installer.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/umbraco.cms/businesslogic/Packager/Installer.cs b/src/umbraco.cms/businesslogic/Packager/Installer.cs index d099849b0f..4c9b2587e9 100644 --- a/src/umbraco.cms/businesslogic/Packager/Installer.cs +++ b/src/umbraco.cms/businesslogic/Packager/Installer.cs @@ -857,9 +857,14 @@ namespace umbraco.cms.businesslogic.packager { var m = new Macro(alias); this._containsMacroConflict = true; - this._conflictingMacroAliases.Add(m.Name, alias); + + if (_conflictingMacroAliases.ContainsKey(m.Name) == false) + { + _conflictingMacroAliases.Add(m.Name, alias); + } } catch (IndexOutOfRangeException) { } //thrown when the alias doesn't exist in the DB, ie - macro not there + } } } @@ -872,7 +877,10 @@ namespace umbraco.cms.businesslogic.packager if (t != null) { this._containsTemplateConflict = true; - this._conflictingTemplateAliases.Add(t.Text, alias); + if (_conflictingTemplateAliases.ContainsKey(t.Text) == false) + { + _conflictingTemplateAliases.Add(t.Text, alias); + } } } } @@ -886,7 +894,10 @@ namespace umbraco.cms.businesslogic.packager if (s != null) { this._containsStyleSheetConflict = true; - this._conflictingStyleSheetNames.Add(s.Text, alias); + if (_conflictingStyleSheetNames.ContainsKey(s.Text) == false) + { + _conflictingStyleSheetNames.Add(s.Text, alias); + } } } } From 369f6ac935439691e76994831ccfa28689dbe870 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 20 Nov 2013 18:15:11 +1100 Subject: [PATCH 05/18] fixes merge issue --- src/umbraco.cms/businesslogic/Packager/Installer.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/umbraco.cms/businesslogic/Packager/Installer.cs b/src/umbraco.cms/businesslogic/Packager/Installer.cs index 4c9b2587e9..dc73fd9f10 100644 --- a/src/umbraco.cms/businesslogic/Packager/Installer.cs +++ b/src/umbraco.cms/businesslogic/Packager/Installer.cs @@ -860,11 +860,12 @@ namespace umbraco.cms.businesslogic.packager if (_conflictingMacroAliases.ContainsKey(m.Name) == false) { - _conflictingMacroAliases.Add(m.Name, alias); + _conflictingMacroAliases.Add(m.Name, alias); } } - catch (IndexOutOfRangeException) { } //thrown when the alias doesn't exist in the DB, ie - macro not there - } + catch (IndexOutOfRangeException) + { + } //thrown when the alias doesn't exist in the DB, ie - macro not there } } From 474dcd07548e6643d53d449955b878c6cf5fdff3 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 20 Nov 2013 18:24:44 +1100 Subject: [PATCH 06/18] Fixes: U4-3587 Can't delete a member when there is a group assigned Conflicts: src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs --- src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs index b8024939b0..d52526aa5b 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs @@ -165,6 +165,7 @@ namespace Umbraco.Core.Persistence.Repositories "DELETE FROM umbracoRelation WHERE childId = @Id", "DELETE FROM cmsTagRelationship WHERE nodeId = @Id", "DELETE FROM cmsPropertyData WHERE contentNodeId = @Id", + "DELETE FROM cmsMember2MemberGroup WHERE Member = @Id", "DELETE FROM cmsMember WHERE nodeId = @Id", "DELETE FROM cmsContentVersion WHERE ContentId = @Id", "DELETE FROM cmsContentXml WHERE nodeID = @Id", From e6ae88c016fed481746fc82fdfa2e5a33c3e2555 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 21 Nov 2013 14:45:52 +1100 Subject: [PATCH 07/18] Fixes hash generation and checking with the trees.config file - since this is changed during startup our plugin cache was never active :( --- src/Umbraco.Core/PluginManager.cs | 39 ++++++++++++++++++------- src/Umbraco.Tests/PluginManagerTests.cs | 8 ++--- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/Umbraco.Core/PluginManager.cs b/src/Umbraco.Core/PluginManager.cs index 485602f23f..84d45dc220 100644 --- a/src/Umbraco.Core/PluginManager.cs +++ b/src/Umbraco.Core/PluginManager.cs @@ -171,17 +171,18 @@ namespace Umbraco.Core if (_currentAssembliesHash != -1) return _currentAssembliesHash; - _currentAssembliesHash = GetAssembliesHash( - new FileSystemInfo[] + _currentAssembliesHash = GetFileHash( + new List> { //add the bin folder and everything in it - new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Bin)), + new Tuple(new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Bin)), false), //add the app code folder and everything in it - new DirectoryInfo(IOHelper.MapPath("~/App_Code")), + new Tuple(new DirectoryInfo(IOHelper.MapPath("~/App_Code")), false), //add the global.asax (the app domain also monitors this, if it changes will do a full restart) - new FileInfo(IOHelper.MapPath("~/global.asax")), - //add the trees.config - new FileInfo(IOHelper.MapPath(SystemDirectories.Config + "/trees.config")) + new Tuple(new FileInfo(IOHelper.MapPath("~/global.asax")), false), + + //add the trees.config - use the contents to create the has since this gets resaved on every app startup! + new Tuple(new FileInfo(IOHelper.MapPath(SystemDirectories.Config + "/trees.config")), true) } ); return _currentAssembliesHash; @@ -200,18 +201,34 @@ namespace Umbraco.Core /// /// Returns a unique hash for the combination of FileInfo objects passed in /// - /// + /// + /// A collection of files and whether or not to use their file contents to determine the hash or the file's properties + /// (true will make a hash based on it's contents) + /// /// - internal static long GetAssembliesHash(IEnumerable filesAndFolders) + internal static long GetFileHash(IEnumerable> filesAndFolders) { using (DisposableTimer.TraceDuration("Determining hash of code files on disk", "Hash determined")) { var hashCombiner = new HashCodeCombiner(); - //add each unique folder to the hash - foreach (var i in filesAndFolders.DistinctBy(x => x.FullName)) + + //get the file info's to check + var fileInfos = filesAndFolders.Where(x => x.Item2 == false).ToArray(); + var fileContents = filesAndFolders.Except(fileInfos); + + //add each unique folder/file to the hash + foreach (var i in fileInfos.Select(x => x.Item1).DistinctBy(x => x.FullName)) { hashCombiner.AddFileSystemItem(i); } + + //add each unique file's contents to the hash + foreach (var i in fileContents.Select(x => x.Item1).DistinctBy(x => x.FullName)) + { + var content = File.ReadAllText(i.FullName).Replace("\r\n", string.Empty).Replace("\n", string.Empty).Replace("\r", string.Empty); + hashCombiner.AddCaseInsensitiveString(content); + } + return ConvertPluginsHashFromHex(hashCombiner.GetCombinedHashCode()); } } diff --git a/src/Umbraco.Tests/PluginManagerTests.cs b/src/Umbraco.Tests/PluginManagerTests.cs index 861b598c1e..a67ce74627 100644 --- a/src/Umbraco.Tests/PluginManagerTests.cs +++ b/src/Umbraco.Tests/PluginManagerTests.cs @@ -242,16 +242,16 @@ namespace Umbraco.Tests var list3 = new[] { f1, f3, f5, f7 }; //Act - var hash1 = PluginManager.GetAssembliesHash(list1); - var hash2 = PluginManager.GetAssembliesHash(list2); - var hash3 = PluginManager.GetAssembliesHash(list3); + var hash1 = PluginManager.GetFileHash(list1); + var hash2 = PluginManager.GetFileHash(list2); + var hash3 = PluginManager.GetFileHash(list3); //Assert Assert.AreNotEqual(hash1, hash2); Assert.AreNotEqual(hash1, hash3); Assert.AreNotEqual(hash2, hash3); - Assert.AreEqual(hash1, PluginManager.GetAssembliesHash(list1)); + Assert.AreEqual(hash1, PluginManager.GetFileHash(list1)); } [Test] From f41f82adc544a423709f481d0dcad2b88315a622 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 21 Nov 2013 14:46:18 +1100 Subject: [PATCH 08/18] Changes locker to be static --- src/Umbraco.Core/PluginManager.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/PluginManager.cs b/src/Umbraco.Core/PluginManager.cs index 84d45dc220..b8c4ca6ff4 100644 --- a/src/Umbraco.Core/PluginManager.cs +++ b/src/Umbraco.Core/PluginManager.cs @@ -233,6 +233,21 @@ namespace Umbraco.Core } } + internal static long GetFileHash(IEnumerable filesAndFolders) + { + using (DisposableTimer.TraceDuration("Determining hash of code files on disk", "Hash determined")) + { + var hashCombiner = new HashCodeCombiner(); + + //add each unique folder/file to the hash + foreach (var i in filesAndFolders.DistinctBy(x => x.FullName)) + { + hashCombiner.AddFileSystemItem(i); + } + return ConvertPluginsHashFromHex(hashCombiner.GetCombinedHashCode()); + } + } + /// /// Converts the hash value of current plugins to long from string /// @@ -435,7 +450,7 @@ namespace Umbraco.Core #endregion - private readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim(); + private static readonly ReaderWriterLockSlim Locker = new ReaderWriterLockSlim(); private readonly HashSet _types = new HashSet(); private IEnumerable _assemblies; @@ -609,7 +624,7 @@ namespace Umbraco.Core TypeResolutionKind resolutionType, bool cacheResult) { - using (var readLock = new UpgradeableReadLock(_lock)) + using (var readLock = new UpgradeableReadLock(Locker)) { var typesFound = new List(); From d04f2a98b9bf39d9311458d4110a2c6f0fa6cf67 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 21 Nov 2013 17:47:57 +1100 Subject: [PATCH 09/18] Fixes tests --- src/Umbraco.Core/PluginManager.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/PluginManager.cs b/src/Umbraco.Core/PluginManager.cs index b8c4ca6ff4..705a2bae2a 100644 --- a/src/Umbraco.Core/PluginManager.cs +++ b/src/Umbraco.Core/PluginManager.cs @@ -225,8 +225,12 @@ namespace Umbraco.Core //add each unique file's contents to the hash foreach (var i in fileContents.Select(x => x.Item1).DistinctBy(x => x.FullName)) { - var content = File.ReadAllText(i.FullName).Replace("\r\n", string.Empty).Replace("\n", string.Empty).Replace("\r", string.Empty); - hashCombiner.AddCaseInsensitiveString(content); + if (File.Exists(i.FullName)) + { + var content = File.ReadAllText(i.FullName).Replace("\r\n", string.Empty).Replace("\n", string.Empty).Replace("\r", string.Empty); + hashCombiner.AddCaseInsensitiveString(content); + } + } return ConvertPluginsHashFromHex(hashCombiner.GetCombinedHashCode()); From 20813ef20789392a2cff46ef6f78bb6213c3b4a6 Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 25 Nov 2013 13:25:01 +1100 Subject: [PATCH 10/18] Fixes: U4-3673 Creating content with Services API always sets created by to admin Conflicts: src/Umbraco.Tests/Services/ContentServiceTests.cs --- src/Umbraco.Core/Services/ContentService.cs | 8 +++++++ .../Services/ContentServiceTests.cs | 22 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index 616b528024..d3b38ebb67 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -1602,6 +1602,10 @@ namespace Umbraco.Core.Services using (var repository = _repositoryFactory.CreateContentRepository(uow)) { //Since this is the Save and Publish method, the content should be saved even though the publish fails or isn't allowed + if (content.HasIdentity == false) + { + content.CreatorId = userId; + } content.WriterId = userId; repository.AddOrUpdate(content); @@ -1662,6 +1666,10 @@ namespace Umbraco.Core.Services var uow = _uowProvider.GetUnitOfWork(); using (var repository = _repositoryFactory.CreateContentRepository(uow)) { + if (content.HasIdentity == false) + { + content.CreatorId = userId; + } content.WriterId = userId; //Only change the publish state if the "previous" version was actually published or marked as unpublished diff --git a/src/Umbraco.Tests/Services/ContentServiceTests.cs b/src/Umbraco.Tests/Services/ContentServiceTests.cs index e15f05817d..047fc202ed 100644 --- a/src/Umbraco.Tests/Services/ContentServiceTests.cs +++ b/src/Umbraco.Tests/Services/ContentServiceTests.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading; using NUnit.Framework; using Umbraco.Core.Models; +using Umbraco.Core.Models.Membership; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; @@ -78,6 +79,27 @@ namespace Umbraco.Tests.Services Assert.That(content.CreatorId, Is.EqualTo(0));//Default to zero/administrator } + [Test] + public void Can_Save_New_Content_With_Explicit_User() + { + var user = new User(ServiceContext.UserService.GetUserTypeByAlias("admin")) + { + Name = "Test", + Email = "test@test.com", + Username = "test", + Password = "test" + }; + ServiceContext.UserService.SaveUser(user); + var content = new Content("Test", -1, ServiceContext.ContentTypeService.GetContentType("umbTextpage")); + + // Act + ServiceContext.ContentService.Save(content, (int)user.Id); + + // Assert + Assert.That(content.CreatorId, Is.EqualTo(user.Id)); + Assert.That(content.WriterId, Is.EqualTo(user.Id)); + } + [Test] public void Cannot_Create_Content_With_Non_Existing_ContentType_Alias() { From 58fc51ae939129ab372cf780d8ba9aad09502a8e Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 28 Nov 2013 09:30:50 +1100 Subject: [PATCH 11/18] Fixes: U4-3736 Unit test Can_Get_File_Dates() now testing correctly, disregarding local (nont-UTC) time. --- src/Umbraco.Tests/IO/AbstractFileSystemTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Tests/IO/AbstractFileSystemTests.cs b/src/Umbraco.Tests/IO/AbstractFileSystemTests.cs index 0121e128e1..120b1f9a4f 100644 --- a/src/Umbraco.Tests/IO/AbstractFileSystemTests.cs +++ b/src/Umbraco.Tests/IO/AbstractFileSystemTests.cs @@ -122,11 +122,11 @@ namespace Umbraco.Tests.IO Assert.AreEqual(DateTime.Today.Year, created.Year); Assert.AreEqual(DateTime.Today.Month, created.Month); - Assert.AreEqual(DateTime.Today.Date, created.Date); + Assert.AreEqual(DateTime.UtcNow.Date, created.Date); Assert.AreEqual(DateTime.Today.Year, modified.Year); Assert.AreEqual(DateTime.Today.Month, modified.Month); - Assert.AreEqual(DateTime.Today.Date, modified.Date); + Assert.AreEqual(DateTime.UtcNow.Date, modified.Date); _fileSystem.DeleteFile("test.txt"); } From af29f614786a4eec91b1af7c7b18fa77e11d4360 Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 29 Nov 2013 11:10:25 +1100 Subject: [PATCH 12/18] Fixes csrf issue --- .../config/ClientDependency.config | 2 +- src/Umbraco.Web.UI/install/Default.aspx.cs | 4 +++- src/Umbraco.Web.UI/umbraco/logout.aspx | 17 +++----------- src/Umbraco.Web.UI/umbraco/umbraco.aspx | 13 +++++++---- .../Application/UmbracoApplicationActions.js | 21 +++++++++++------ .../UI/Pages/UmbracoEnsuredPage.cs | 4 ++-- .../install/LegacyClasses.cs | 2 +- .../umbraco/logout.aspx.cs | 23 ++++++++++++++----- .../BasePages/BasePage.cs | 12 ++++++++++ .../BasePages/UmbracoEnsuredPage.cs | 4 ++-- src/umbraco.cms/Actions/ActionQuit.cs | 1 + 11 files changed, 65 insertions(+), 38 deletions(-) diff --git a/src/Umbraco.Web.UI/config/ClientDependency.config b/src/Umbraco.Web.UI/config/ClientDependency.config index a95c67b06d..3b80c0d7dd 100644 --- a/src/Umbraco.Web.UI/config/ClientDependency.config +++ b/src/Umbraco.Web.UI/config/ClientDependency.config @@ -10,7 +10,7 @@ NOTES: * Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config * A new version will invalidate both client and server cache and create new persisted files --> - +