From 0272f3616145b7eddd84bbc2089b369e19650984 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 8 Feb 2004 04:15:50 +0000 Subject: [PATCH] Remove the cross-wiki mode. Not only is it implementation-specific and possibly insecure, but it created an extra layer of red tape on Wikipedia which is not acceptable. --- includes/SpecialMakesysop.php | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/includes/SpecialMakesysop.php b/includes/SpecialMakesysop.php index 10122bff9f..39500d9a3e 100644 --- a/includes/SpecialMakesysop.php +++ b/includes/SpecialMakesysop.php @@ -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 ) ); -- 2.20.1