X-Git-Url: http://git.cyclocoop.org//%27http:/jquery.khurshid.com/ifixpng.php/%27?a=blobdiff_plain;f=includes%2Fuser%2FUserIdentityValue.php;h=800ac760a5f48f8bddc654ceb697186255c48ff0;hb=8e0ef3e187b4b8ebe847dbc8ae1ec2b96ed58ae0;hp=120f31f24d3e9d7cd2746111c98eb2f66e1a72f2;hpb=8269ed4dfd5e4395e25945b1fa2ed391684606ed;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/UserIdentityValue.php b/includes/user/UserIdentityValue.php index 120f31f24d..800ac760a5 100644 --- a/includes/user/UserIdentityValue.php +++ b/includes/user/UserIdentityValue.php @@ -82,4 +82,25 @@ class UserIdentityValue implements UserIdentity { return $this->actor; } + /** + * @since 1.32 + * + * @param UserIdentity $user + * @return bool + */ + public function equals( UserIdentity $user ) { + // XXX it's not clear whether central ID providers are supposed to obey this + return $this->getName() === $user->getName(); + } + + /** + * @since 1.34 + * + * @return bool True if user is registered on this wiki, i.e., has a user ID. False if user is + * anonymous or has no local account (which can happen when importing). This is equivalent to + * getId() != 0 and is provided for code readability. + */ + public function isRegistered() { + return $this->getId() != 0; + } }