X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FUserRightsProxy.php;h=e3655ceddb7756ffc8adb20fe20dc5f92444d64e;hb=72462041c030caa32a71f579d1e1d8c165da01de;hp=56bb73f8fcb0691394e2f7c9df55aa5ae9764a6e;hpb=d8cb9695c6971975692808bb7cdc991e2abda0ab;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/UserRightsProxy.php b/includes/UserRightsProxy.php index 56bb73f8fc..e3655ceddb 100644 --- a/includes/UserRightsProxy.php +++ b/includes/UserRightsProxy.php @@ -31,10 +31,10 @@ class UserRightsProxy { * * @see newFromId() * @see newFromName() - * @param $db DatabaseBase: db connection - * @param string $database database name - * @param string $name user name - * @param $id Integer: user ID + * @param DatabaseBase $db Db connection + * @param string $database Database name + * @param string $name User name + * @param int $id User ID */ private function __construct( $db, $database, $name, $id ) { $this->db = $db; @@ -47,7 +47,7 @@ class UserRightsProxy { /** * Accessor for $this->database * - * @return String: database name + * @return string Database name */ public function getDBName() { return $this->database; @@ -56,8 +56,8 @@ class UserRightsProxy { /** * Confirm the selected database name is a valid local interwiki database name. * - * @param string $database database name - * @return Boolean + * @param string $database Database name + * @return bool */ public static function validDatabase( $database ) { global $wgLocalDatabases; @@ -67,10 +67,10 @@ class UserRightsProxy { /** * Same as User::whoIs() * - * @param string $database database name - * @param $id Integer: user ID - * @param $ignoreInvalidDB Boolean: if true, don't check if $database is in $wgLocalDatabases - * @return String: user name or false if the user doesn't exist + * @param string $database Database name + * @param int $id User ID + * @param bool $ignoreInvalidDB If true, don't check if $database is in $wgLocalDatabases + * @return string User name or false if the user doesn't exist */ public static function whoIs( $database, $id, $ignoreInvalidDB = false ) { $user = self::newFromId( $database, $id, $ignoreInvalidDB ); @@ -84,10 +84,10 @@ class UserRightsProxy { /** * Factory function; get a remote user entry by ID number. * - * @param string $database database name - * @param $id Integer: user ID - * @param $ignoreInvalidDB Boolean: if true, don't check if $database is in $wgLocalDatabases - * @return UserRightsProxy or null if doesn't exist + * @param string $database Database name + * @param int $id User ID + * @param bool $ignoreInvalidDB If true, don't check if $database is in $wgLocalDatabases + * @return UserRightsProxy|null If doesn't exist */ public static function newFromId( $database, $id, $ignoreInvalidDB = false ) { return self::newFromLookup( $database, 'user_id', intval( $id ), $ignoreInvalidDB ); @@ -96,20 +96,20 @@ class UserRightsProxy { /** * Factory function; get a remote user entry by name. * - * @param string $database database name - * @param string $name user name - * @param $ignoreInvalidDB Boolean: if true, don't check if $database is in $wgLocalDatabases - * @return UserRightsProxy or null if doesn't exist + * @param string $database Database name + * @param string $name User name + * @param bool $ignoreInvalidDB If true, don't check if $database is in $wgLocalDatabases + * @return UserRightsProxy|null If doesn't exist */ public static function newFromName( $database, $name, $ignoreInvalidDB = false ) { return self::newFromLookup( $database, 'user_name', $name, $ignoreInvalidDB ); } /** - * @param $database - * @param $field - * @param $value - * @param $ignoreInvalidDB bool + * @param string $database + * @param string $field + * @param string $value + * @param bool $ignoreInvalidDB * @return null|UserRightsProxy */ private static function newFromLookup( $database, $field, $value, $ignoreInvalidDB = false ) { @@ -132,13 +132,13 @@ class UserRightsProxy { * Open a database connection to work on for the requested user. * This may be a new connection to another database for remote users. * - * @param $database String - * @param $ignoreInvalidDB Boolean: if true, don't check if $database is in $wgLocalDatabases - * @return DatabaseBase or null if invalid selection + * @param string $database + * @param bool $ignoreInvalidDB If true, don't check if $database is in $wgLocalDatabases + * @return DatabaseBase|null If invalid selection */ public static function getDB( $database, $ignoreInvalidDB = false ) { global $wgDBname; - if ( self::validDatabase( $database ) ) { + if ( $ignoreInvalidDB || self::validDatabase( $database ) ) { if ( $database == $wgDBname ) { // Hmm... this shouldn't happen though. :) return wfGetDB( DB_MASTER ); @@ -166,7 +166,7 @@ class UserRightsProxy { /** * Same as User::getName() * - * @return String + * @return string */ public function getName() { return $this->name . '@' . $this->database; @@ -175,7 +175,7 @@ class UserRightsProxy { /** * Same as User::getUserPage() * - * @return Title object + * @return Title */ public function getUserPage() { return Title::makeTitle( NS_USER, $this->getName() ); @@ -199,6 +199,7 @@ class UserRightsProxy { /** * Replaces User::addUserGroup() + * @param string $group */ function addGroup( $group ) { $this->db->insert( 'user_groups', @@ -212,6 +213,7 @@ class UserRightsProxy { /** * Replaces User::removeUserGroup() + * @param string $group */ function removeGroup( $group ) { $this->db->delete( 'user_groups', @@ -224,6 +226,8 @@ class UserRightsProxy { /** * Replaces User::setOption() + * @param string $option + * @param mixed $value */ public function setOption( $option, $value ) { $this->newOptions[$option] = $value;