If you haven't logged in since 2004, then you're not getting your legacy
password updated. Sorry kid. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2611 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -106,26 +106,6 @@ public class User
|
|||||||
setModified("siteId");
|
setModified("siteId");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts a legacy password.
|
|
||||||
*
|
|
||||||
* @return true if a conversion took place, false if not.
|
|
||||||
*/
|
|
||||||
public boolean updateLegacyPassword (String password)
|
|
||||||
{
|
|
||||||
// we may have an old crypt() encrypted password
|
|
||||||
if (this.password.length() == 13) {
|
|
||||||
// check both the case sensitive and insensitive versions for further legacy reasons
|
|
||||||
if (this.password.equals(UserUtil.legacyEncrypt(username, password, false)) ||
|
|
||||||
this.password.equals(UserUtil.legacyEncrypt(username, password, true))) {
|
|
||||||
// update our password with the new encryption method
|
|
||||||
setPassword(password);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares the supplied password with the password associated with this user record.
|
* Compares the supplied password with the password associated with this user record.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -251,13 +251,6 @@ public class UserManager
|
|||||||
throw new NoSuchUserException("error.no_such_user");
|
throw new NoSuchUserException("error.no_such_user");
|
||||||
}
|
}
|
||||||
|
|
||||||
// potentially convert the user's legacy password
|
|
||||||
if (password != null && password.getCleartext() != null &&
|
|
||||||
user.updateLegacyPassword(password.getCleartext())) {
|
|
||||||
log.info("Updated legacy password " + user.username + ".");
|
|
||||||
_repository.updateUser(user);
|
|
||||||
}
|
|
||||||
|
|
||||||
// run the user through the authentication gamut
|
// run the user through the authentication gamut
|
||||||
auth.authenticateUser(user, username, password);
|
auth.authenticateUser(user, username, password);
|
||||||
|
|
||||||
@@ -290,13 +283,6 @@ public class UserManager
|
|||||||
throw new NoSuchUserException("error.no_such_user");
|
throw new NoSuchUserException("error.no_such_user");
|
||||||
}
|
}
|
||||||
|
|
||||||
// potentially convert the user's legacy password
|
|
||||||
if (password != null && password.getCleartext() != null &&
|
|
||||||
user.updateLegacyPassword(password.getCleartext())) {
|
|
||||||
log.info("Updated legacy password " + user.username + ".");
|
|
||||||
_repository.updateUser(user);
|
|
||||||
}
|
|
||||||
|
|
||||||
// run the user through the authentication gamut
|
// run the user through the authentication gamut
|
||||||
auth.authenticateUser(user, username, password);
|
auth.authenticateUser(user, username, password);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user