X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUserrights.php;h=94b8184d5fb5edef5271d07d8ac5d39678f461cf;hb=f96c988f19824c9bb22fb07b55aa5e295f227394;hp=c82a943c4b21c3103b8ea3a37d80ccbd886b50f2;hpb=e3cfa25e71fab040a5ecf7784493b0ecd11579aa;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index c82a943c4b..94b8184d5f 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -170,9 +170,11 @@ class UserrightsPage extends SpecialPage { $targetUser->clearInstanceCache(); // T40989 } - if ( $request->getVal( 'conflictcheck-originalgroups' ) - !== implode( ',', $targetUser->getGroups() ) - ) { + $conflictCheck = $request->getVal( 'conflictcheck-originalgroups' ); + $conflictCheck = ( $conflictCheck === '' ) ? [] : explode( ',', $conflictCheck ); + $userGroups = $targetUser->getGroups(); + + if ( $userGroups !== $conflictCheck ) { $out->addWikiMsg( 'userrights-conflict' ); } else { $status = $this->saveUserGroups( @@ -497,18 +499,18 @@ class UserrightsPage extends SpecialPage { $parts = explode( $this->getConfig()->get( 'UserrightsInterwikiDelimiter' ), $username ); if ( count( $parts ) < 2 ) { $name = trim( $username ); - $database = ''; + $wikiId = ''; } else { - list( $name, $database ) = array_map( 'trim', $parts ); + list( $name, $wikiId ) = array_map( 'trim', $parts ); - if ( $database == wfWikiID() ) { - $database = ''; + if ( WikiMap::isCurrentWikiId( $wikiId ) ) { + $wikiId = ''; } else { if ( $writing && !$this->getUser()->isAllowed( 'userrights-interwiki' ) ) { return Status::newFatal( 'userrights-no-interwiki' ); } - if ( !UserRightsProxy::validDatabase( $database ) ) { - return Status::newFatal( 'userrights-nodatabase', $database ); + if ( !UserRightsProxy::validDatabase( $wikiId ) ) { + return Status::newFatal( 'userrights-nodatabase', $wikiId ); } } } @@ -522,10 +524,10 @@ class UserrightsPage extends SpecialPage { // We'll do a lookup for the name internally. $id = intval( substr( $name, 1 ) ); - if ( $database == '' ) { + if ( $wikiId == '' ) { $name = User::whoIs( $id ); } else { - $name = UserRightsProxy::whoIs( $database, $id ); + $name = UserRightsProxy::whoIs( $wikiId, $id ); } if ( !$name ) { @@ -539,10 +541,10 @@ class UserrightsPage extends SpecialPage { } } - if ( $database == '' ) { + if ( $wikiId == '' ) { $user = User::newFromName( $name ); } else { - $user = UserRightsProxy::newFromName( $database, $name ); + $user = UserRightsProxy::newFromName( $wikiId, $name ); } if ( !$user || $user->isAnon() ) {