PasswordsettingsAction aligned with FormAction

Also made some changes in the password "munging" function call
common_munge_password to accept a profile instead of user ID (which
was only there because stoneage StatusNet used the ID to generate a
not-very-random salt, but nowadays we primarily use AuthCrypt plugin).
This commit is contained in:
Mikael Nordfeldth
2015-07-17 01:47:43 +02:00
parent 47ef917f62
commit cfaaf3c13c
9 changed files with 47 additions and 71 deletions

View File

@@ -138,6 +138,18 @@ class Profile extends Managed_DataObject
return true;
}
// Returns false if the user has no password (which will always
// be the case for remote users). This can be the case for OpenID
// logins or other mechanisms which don't store a password hash.
public function hasPassword()
{
try {
return !empty($this->getUser()->hasPassword());
} catch (NoSuchUserException $e) {
return false;
}
}
public function getObjectType()
{
// FIXME: More types... like peopletags and whatever