https://www.mediawiki.org/wiki/Special:Code/MediaWiki/111830

Revision: 111830
Author:   reedy
Date:     2012-02-18 15:11:49 +0000 (Sat, 18 Feb 2012)
Log Message:
-----------
MFT r111814

Modified Paths:
--------------
    branches/wmf/1.19wmf1/extensions/AntiSpoof/SpoofUser.php
    
branches/wmf/1.19wmf1/extensions/CentralAuth/AntiSpoof/CentralAuthSpoofUser.php

Property Changed:
----------------
    branches/wmf/1.19wmf1/extensions/


Property changes on: branches/wmf/1.19wmf1/extensions
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/JSTesting/extensions:100352-107913
/branches/REL1_15/phase3/extensions:51646
/branches/REL1_17/phase3/extensions:81445,81448
/branches/new-installer/phase3/extensions:43664-66004
/branches/sqlite/extensions:58211-58321
/branches/wmf/1.18wmf1/extensions:97508
/trunk/extensions:111043,111199,111218,111484,111575,111659-111661,111668,111670,111688,111690,111713,111715
/trunk/phase3/extensions:111002,111029,111034,111062,111067,111076,111085,111128,111144,111251
   + /branches/JSTesting/extensions:100352-107913
/branches/REL1_15/phase3/extensions:51646
/branches/REL1_17/phase3/extensions:81445,81448
/branches/new-installer/phase3/extensions:43664-66004
/branches/sqlite/extensions:58211-58321
/branches/wmf/1.18wmf1/extensions:97508
/trunk/extensions:111043,111199,111218,111484,111575,111659-111661,111668,111670,111688,111690,111713,111715,111814
/trunk/phase3/extensions:111002,111029,111034,111062,111067,111076,111085,111128,111144,111251

Modified: branches/wmf/1.19wmf1/extensions/AntiSpoof/SpoofUser.php
===================================================================
--- branches/wmf/1.19wmf1/extensions/AntiSpoof/SpoofUser.php    2012-02-18 
14:35:14 UTC (rev 111829)
+++ branches/wmf/1.19wmf1/extensions/AntiSpoof/SpoofUser.php    2012-02-18 
15:11:49 UTC (rev 111830)
@@ -43,6 +43,20 @@
        }
 
        /**
+        * @return string
+        */
+       protected function getTableName() {
+               return 'user';
+       }
+
+       /**
+        * @return string
+        */
+       protected function getUserColumn() {
+               return 'user_name';
+       }
+
+       /**
         * Does the username pass Unicode legality and script-mixing checks?
         *
         * @return array empty if no conflict, or array containing conflicting 
usernames
@@ -53,11 +67,11 @@
                // Join against the user table to ensure that we skip stray
                // entries left after an account is renamed or otherwise munged.
                $spoofedUsers = $dbr->select(
-                       array( 'spoofuser', 'user' ),
-                       array( 'user_name' ),
+                       array( 'spoofuser', $this->getTableName() ),
+                       array( 'su_name' ), // Same thing due to the join. 
Saves extra variableness
                        array(
                                'su_normalized' => $this->mNormalized,
-                               'su_name=user_name',
+                               'su_name = ' . $this->getUserColumn(),
                        ),
                        __METHOD__,
                        array(
@@ -66,7 +80,7 @@
 
                $spoofs = array();
                foreach ( $spoofedUsers as $row ) {
-                       array_push( $spoofs, $row->user_name );
+                       array_push( $spoofs, $row->su_name );
                }
                return $spoofs;
        }

Modified: 
branches/wmf/1.19wmf1/extensions/CentralAuth/AntiSpoof/CentralAuthSpoofUser.php
===================================================================
--- 
branches/wmf/1.19wmf1/extensions/CentralAuth/AntiSpoof/CentralAuthSpoofUser.php 
    2012-02-18 14:35:14 UTC (rev 111829)
+++ 
branches/wmf/1.19wmf1/extensions/CentralAuth/AntiSpoof/CentralAuthSpoofUser.php 
    2012-02-18 15:11:49 UTC (rev 111830)
@@ -14,4 +14,18 @@
        protected static function getDBMaster() {
                return CentralAuthUser::getCentralDB();
        }
+
+       /**
+        * @return string
+        */
+       protected function getTableName() {
+               return 'globaluser';
+       }
+
+       /**
+        * @return string
+        */
+       protected function getUserColumn() {
+               return 'gu_name';
+       }
 }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to