From: Brion Vibber Date: Sun, 8 Feb 2004 04:15:50 +0000 (+0000) Subject: Remove the cross-wiki mode. Not only is it implementation-specific and possibly insec... X-Git-Tag: 1.3.0beta1~1011 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=0272f3616145b7eddd84bbc2089b369e19650984;p=lhc%2Fweb%2Fwiklou.git 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. --- 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 ) );