Unbreak interwiki user rights granting
authorKunal Mehta <legoktm@gmail.com>
Wed, 4 Feb 2015 02:27:28 +0000 (18:27 -0800)
committerTim Starling <tstarling@wikimedia.org>
Wed, 4 Feb 2015 02:37:13 +0000 (02:37 +0000)
UserRightsProxy does not have an equals method, nor does
CentralAuthGroupMembershipProxy.

This reverts the problematic part of 80ca508ed117bbf547 which
caused fatal errors.

Bug: T88505
Change-Id: I6c1dfe14bc08193c33f86482c8f835500c0dc21c

includes/specials/SpecialUserrights.php

index 3bf75a0..a5edcb0 100644 (file)
@@ -218,7 +218,7 @@ class UserrightsPage extends SpecialPage {
        /**
         * Save user groups changes in the database.
         *
-        * @param User $user
+        * @param User|UserRightsProxy $user
         * @param array $add Array of groups to add
         * @param array $remove Array of groups to remove
         * @param string $reason Reason for group change
@@ -228,7 +228,7 @@ class UserrightsPage extends SpecialPage {
                global $wgAuth;
 
                // Validate input set...
-               $isself = $user->equals( $this->getUser() );
+               $isself = $user->getName() == $this->getUser()->getName();
                $groups = $user->getGroups();
                $changeable = $this->changeableGroups();
                $addable = array_merge( $changeable['add'], $isself ? $changeable['add-self'] : array() );