fixes up some merge issues

This commit is contained in:
Shannon
2013-12-03 18:14:04 +11:00
parent 2a05687c8b
commit cb8dbf9da5
4 changed files with 36 additions and 80 deletions

View File

@@ -223,27 +223,6 @@ namespace Umbraco.Tests.Services
Assert.That(content.WriterId, Is.EqualTo(user.Id));
}
[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()
{

View File

@@ -13,7 +13,6 @@ using System.Security.Cryptography;
using System.Web.Util;
using System.Collections.Specialized;
using System.Configuration.Provider;
using umbraco.cms.businesslogic;
using System.Security;
using System.Security.Permissions;
using System.Runtime.CompilerServices;
@@ -1024,62 +1023,4 @@ namespace umbraco.providers.members
#endregion
}
/// <summary>
/// Adds some event handling
/// </summary>
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;
}
}
}
}
//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)
///// <summary>
///// Adds some event handling
///// </summary>
//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;
// }
// }
// }
//}
}

View File

@@ -0,0 +1,35 @@
using System.Web.Security;
using Umbraco.Core;
using umbraco.cms.businesslogic;
using umbraco.cms.businesslogic.member;
namespace umbraco.providers.members
{
/// <summary>
/// Adds some event handling
/// </summary>
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;
}
}
}
}
}

View File

@@ -81,6 +81,7 @@
<Link>Properties\SolutionInfo.cs</Link>
</Compile>
<Compile Include="members\Helper.cs" />
<Compile Include="members\MembershipEventHandler.cs" />
<Compile Include="members\MembersMembershipProvider.cs" />
<Compile Include="members\MembersProfileProvider.cs" />
<Compile Include="members\MembersRoleProvider.cs" />