X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FUserRightsProxy.php;h=53c69d817a918578791ecc1151d57b4ca72dd675;hb=5e2c34fec35ac2863c4cba40ad49e47837ccd4e6;hp=e3655ceddb7756ffc8adb20fe20dc5f92444d64e;hpb=bd2a78a159ce6d9f7b27fd75d05570228b44c3cb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/UserRightsProxy.php b/includes/UserRightsProxy.php index e3655ceddb..53c69d817a 100644 --- a/includes/UserRightsProxy.php +++ b/includes/UserRightsProxy.php @@ -113,12 +113,23 @@ class UserRightsProxy { * @return null|UserRightsProxy */ private static function newFromLookup( $database, $field, $value, $ignoreInvalidDB = false ) { + global $wgSharedDB, $wgSharedTables; + // If the user table is shared, perform the user query on it, but don't pass it to the UserRightsProxy, + // as user rights are normally not shared. + if ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) { + $userdb = self::getDB( $wgSharedDB, $ignoreInvalidDB ); + } else { + $userdb = self::getDB( $database, $ignoreInvalidDB ); + } + $db = self::getDB( $database, $ignoreInvalidDB ); - if ( $db ) { - $row = $db->selectRow( 'user', + + if ( $db && $userdb ) { + $row = $userdb->selectRow( 'user', array( 'user_id', 'user_name' ), array( $field => $value ), __METHOD__ ); + if ( $row !== false ) { return new UserRightsProxy( $db, $database, $row->user_name,