I am new to umbraco. So far I've found the version 5 to be rather full of bugs. But this one really made me laugh. In the latest source code, the ResetPassword BackOfficeMembershipProvider actually deletes the user. Rather sure that isn't meant to be:
publicoverridestring ResetPassword(string username, string answer)
{
using (var uow = _hive.Create())
{
var user = GetUmbracoUser(_appContext, uow, username, false);
if (user == null) returnnull;
if (Membership.RequiresQuestionAndAnswer && string.IsNullOrWhiteSpace(answer))
thrownew InvalidOperationException("Invalid answer entered!");
if (Membership.RequiresQuestionAndAnswer && !string.IsNullOrWhiteSpace(answer) && !user.PasswordAnswer.Equals(answer, StringComparison.OrdinalIgnoreCase))
thrownew InvalidOperationException("Invalid answer entered!");
// Generate random passwordvar newPassword = newbyte[16];
var rng = RandomNumberGenerator.Create();
rng.GetBytes(newPassword);
var newPasswordString = Convert.ToBase64String(newPassword);
var salt = string.Empty;
user.Password = TransformPassword(newPasswordString, ref salt);
user.PasswordSalt = salt;
uow.Repositories.Delete<User>(user.Id);
uow.Complete();
return newPasswordString;
}
}
Umbraco 5, ResetPassword bug
Hi,
I am new to umbraco. So far I've found the version 5 to be rather full of bugs. But this one really made me laugh. In the latest source code, the ResetPassword BackOfficeMembershipProvider actually deletes the user. Rather sure that isn't meant to be:
is working on a reply...