Special:Userrights should set isself on page view, not just on submit
authorHuji Lee <huji.huji@gmail.com>
Wed, 7 Dec 2016 19:15:52 +0000 (14:15 -0500)
committerHuji Lee <huji.huji@gmail.com>
Wed, 7 Dec 2016 21:18:10 +0000 (16:18 -0500)
Partially reverts I57e9ca4f20fe557e4024c4f5a4865170f02ebb45

Bringing back lines that were incorrectly removed

Bug: T152600
Change-Id: I5e1171be4cb75a6d7cce5f99b9d31dc0cb5d8db3

includes/specials/SpecialUserrights.php

index 3ba46c1..1d9c057 100644 (file)
@@ -88,6 +88,10 @@ class UserrightsPage extends SpecialPage {
                        $this->mTarget = trim( $this->mTarget );
                }
 
+               if ( $this->mTarget !== null && User::getCanonicalName( $this->mTarget ) === $user->getName() ) {
+                       $this->isself = true;
+               }
+
                $fetchedStatus = $this->fetchUser( $this->mTarget, true );
                if ( $fetchedStatus->isOK() ) {
                        $this->mFetchedUser = $fetchedStatus->value;