]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Profile.php
PasswordsettingsAction aligned with FormAction
[quix0rs-gnu-social.git] / classes / Profile.php
index 384eaa07263e7414056ee7c8445ecaff5bdf0964..5709a15d01060513b7b63b956d63f227edafdf56 100644 (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