Remove the cross-wiki mode. Not only is it implementation-specific and possibly insec...
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 8 Feb 2004 04:15:50 +0000 (04:15 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 8 Feb 2004 04:15:50 +0000 (04:15 +0000)
includes/SpecialMakesysop.php

index 10122bf..39500d9 100644 (file)
@@ -81,18 +81,10 @@ class MakesysopForm {
                global $wgOut, $wgUser, $wgLang, $wpMakesysopUser, $wpSetBureaucrat;
                global $wgDBname, $wgMemc;
                
-               $parts = explode( "@", $wpMakesysopUser );
-               if( count( $parts ) == 2){
-                       $username = addslashes( $parts[0] );
-                       $usertable = $parts[1] . "wiki.user";
-                       $dbName = $parts[1] . "wiki";
-               } else {
-                       $username = addslashes( $wpMakesysopUser );
-                       $usertable = "user";
-                       $dbName = $wgDBname;
-               }
+               $username = addslashes( $wpMakesysopUser );
+
                $prev = wfIgnoreSQLErrors( TRUE );
-               $res = wfQuery("SELECT user_id, user_rights FROM $usertable WHERE user_name = '{$username}'", DB_WRITE);
+               $res = wfQuery("SELECT user_id, user_rights FROM user WHERE user_name = '{$username}'", DB_WRITE);
                wfIgnoreSQLErrors( $prev );
 
                if( wfLastErrno() || ! $username || wfNumRows( $res ) == 0 ){
@@ -127,9 +119,9 @@ class MakesysopForm {
                if ( count( $rightsNotation ) == 0 ) {
                        $this->showFail();
                } else {
-                       $sql = "UPDATE $usertable SET user_rights = '{$newrights}' WHERE user_id = $id LIMIT 1";
+                       $sql = "UPDATE user SET user_rights = '{$newrights}' WHERE user_id = $id LIMIT 1";
                        wfQuery($sql, DB_WRITE);
-                       $wgMemc->delete( "$dbName:user:id:$id" );
+                       $wgMemc->delete( "$wgDBname:user:id:$id" );
                        
                        $bureaucratLog = wfMsg( "bureaucratlog" );
                        $action = wfMsg( "bureaucratlogentry", $wpMakesysopUser, implode( " ", $rightsNotation ) );