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 ){
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 ) );