X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FProfile.php;h=09f9ca71d109933db6509cb883ec1bee866d222c;hb=6f62adedfc44306e1df2a63e030f8b29e334f3a2;hp=b5ba00caa9e24dc625e61efb88ab85e5962baedf;hpb=882ce56cf464572fa5ff314115e29a81939490c7;p=quix0rs-gnu-social.git diff --git a/classes/Profile.php b/classes/Profile.php index b5ba00caa9..09f9ca71d1 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -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 @@ -242,6 +254,11 @@ class Profile extends Managed_DataObject return null; } + function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) + { + return Reply::stream($this->getID(), $offset, $limit, $since_id, $before_id); + } + function getTaggedNotices($tag, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0) { $stream = new TaggedProfileNoticeStream($this, $tag); @@ -860,6 +877,11 @@ class Profile extends Managed_DataObject function delete($useWhere=false) { + // just in case it hadn't been done before... (usually set before adding deluser to queue handling!) + if (!$this->hasRole(Profile_role::DELETED)) { + $this->grantRole(Profile_role::DELETED); + } + $this->_deleteNotices(); $this->_deleteSubscriptions(); $this->_deleteTags(); @@ -1390,6 +1412,11 @@ class Profile extends Managed_DataObject return $this->fullname; } + public function getHomepage() + { + return $this->homepage; + } + public function getDescription() { return $this->bio; @@ -1566,6 +1593,11 @@ class Profile extends Managed_DataObject return $this; } + public function sameAs(Profile $other) + { + return $this->getID() === $other->getID(); + } + /** * This will perform shortenLinks with the connected User object. * @@ -1613,4 +1645,9 @@ class Profile extends Managed_DataObject public function setPref($namespace, $topic, $data) { return Profile_prefs::setData($this, $namespace, $topic, $data); } + + public function getConnectedApps($offset=0, $limit=null) + { + return $this->getUser()->getConnectedApps($offset, $limit); + } }