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 $this->getUser()->hasPassword();
+ } catch (NoSuchUserException $e) {
+ return false;
+ }
+ }
+
public function getObjectType()
{
// FIXME: More types... like peopletags and whatever
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();
return $this->fullname;
}
+ public function getHomepage()
+ {
+ return $this->homepage;
+ }
+
public function getDescription()
{
return $this->bio;
return $this;
}
- public function sameAs(Profile $other)
+ /**
+ * Test whether the given profile is the same as the current class,
+ * for testing identities.
+ *
+ * @param Profile $other The other profile, usually from Action's $this->scoped
+ *
+ * @return boolean
+ */
+ public function sameAs(Profile $other=null)
{
+ if (is_null($other)) {
+ // In case $this->scoped is null or something, i.e. not a current/legitimate profile.
+ return false;
+ }
return $this->getID() === $other->getID();
}
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);
+ }
}