mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 01:57:55 +08:00
Forwarding ChangePassword from asp.net provider to IMembershipService. Also fixing an error handling issue in forms auth service.
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4040941
This commit is contained in:
@@ -65,6 +65,7 @@ namespace Orchard.Security.Providers {
|
||||
int userId;
|
||||
if (!int.TryParse(userData, out userId)) {
|
||||
Logger.Fatal("User id not a parsable integer");
|
||||
return null;
|
||||
}
|
||||
return _modelManager.Get(userId).As<IUser>();
|
||||
}
|
||||
|
@@ -51,7 +51,11 @@ namespace Orchard.Security.Providers {
|
||||
}
|
||||
|
||||
public override bool ChangePassword(string username, string oldPassword, string newPassword) {
|
||||
throw new NotImplementedException();
|
||||
var service = GetService();
|
||||
var user = service.ValidateUser(username, oldPassword);
|
||||
if (user == null)
|
||||
return false;
|
||||
service.SetPassword(user, newPassword);
|
||||
}
|
||||
|
||||
public override string ResetPassword(string username, string answer) {
|
||||
|
Reference in New Issue
Block a user