Merge "Enable/disable Special:Block widgets according to block parameters"
[lhc/web/wiklou.git] / includes / specials / SpecialUserrights.php
index 0f9ded3..540754f 100644 (file)
@@ -170,11 +170,12 @@ class UserrightsPage extends SpecialPage {
                                $targetUser->clearInstanceCache(); // T40989
                        }
 
-                       $checkValue = explode( ',', $request->getVal( 'conflictcheck-originalgroups' ) );
+                       $conflictCheck = $request->getVal( 'conflictcheck-originalgroups' );
+                       $conflictCheck = ( $conflictCheck === '' ) ? [] : explode( ',', $conflictCheck );
                        $userGroups = $targetUser->getGroups();
 
-                       if ( $userGroups !== $checkValue ) {
-                               $out->addWikiMsg( 'userrights-conflict' );
+                       if ( $userGroups !== $conflictCheck ) {
+                               $out->wrapWikiMsg( '<span class="error">$1</span>', 'userrights-conflict' );
                        } else {
                                $status = $this->saveUserGroups(
                                        $this->mTarget,
@@ -386,9 +387,6 @@ class UserrightsPage extends SpecialPage {
                // update groups in external authentication database
                Hooks::run( 'UserGroupsChanged', [ $user, $add, $remove, $this->getUser(),
                        $reason, $oldUGMs, $newUGMs ] );
-               MediaWiki\Auth\AuthManager::callLegacyAuthPlugin(
-                       'updateExternalDBGroups', [ $user, $add, $remove ]
-               );
 
                wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) . "\n" );
                wfDebug( 'newGroups: ' . print_r( $newGroups, true ) . "\n" );
@@ -713,8 +711,6 @@ class UserrightsPage extends SpecialPage {
                                ->rawParams( $userToolLinks )->parse()
                );
                if ( $canChangeAny ) {
-                       $conf = $this->getConfig();
-                       $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD;
                        $this->getOutput()->addHTML(
                                $this->msg( 'userrights-groups-help', $user->getName() )->parse() .
                                $grouplist .
@@ -729,8 +725,8 @@ class UserrightsPage extends SpecialPage {
                                                                'id' => 'wpReason',
                                                                // HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
                                                                // (e.g. emojis) count for two each. This limit is overridden in JS to instead count
-                                                               // Unicode codepoints (or 255 UTF-8 bytes for old schema).
-                                                               'maxlength' => $oldCommentSchema ? 255 : CommentStore::COMMENT_CHARACTER_LIMIT,
+                                                               // Unicode codepoints.
+                                                               'maxlength' => CommentStore::COMMENT_CHARACTER_LIMIT,
                                                        ] ) .
                                                "</td>
                                        </tr>