fixes test
This commit is contained in:
@@ -521,7 +521,9 @@ namespace Umbraco.Core.Security
|
||||
|
||||
public override string ResetPassword(string username, string answer)
|
||||
{
|
||||
var canReset = this.CanResetPassword(ApplicationContext.Current.Services.UserService);
|
||||
var userService = ApplicationContext.Current == null ? null : ApplicationContext.Current.Services.UserService;
|
||||
|
||||
var canReset = this.CanResetPassword(userService);
|
||||
|
||||
if (canReset == false)
|
||||
{
|
||||
|
||||
@@ -26,10 +26,11 @@ namespace Umbraco.Core.Security
|
||||
internal static bool CanResetPassword(this MembershipProvider provider, IUserService userService)
|
||||
{
|
||||
if (provider == null) throw new ArgumentNullException("provider");
|
||||
if (userService == null) throw new ArgumentNullException("userService");
|
||||
|
||||
|
||||
var canReset = provider.EnablePasswordReset;
|
||||
|
||||
if (userService == null) return canReset;
|
||||
|
||||
//we need to check for the special case in which a user is an admin - in which acse they can reset the password even if EnablePasswordReset == false
|
||||
if (provider.EnablePasswordReset == false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user