Page MenuHomePhabricator

Add hook before changing of userrights
Open, LowPublic

Description

Author: trollingstone

Description:
I can do it with following code in includes/specials/SpecialUserrights.php:

    global $wgUserrightsProtectedUsers;
    if( in_array( User::getCanonicalName( $this->mTarget ), $wgUserrightsProtectedUsers ) ) {
        $out = $this->getOutput();
        $out->setPageTitle( 'Forbidden' );
        $out->addHTML('In the name of Holy Federal Security Service, you can't modify groups of this user.');
        return true;
}

More cleanly do it with hook.

good first bug: The hook now exists but can't be aborted. Add that functionality in order to fully address the original request.

Details

Reference
bz47338

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:15 AM
bzimport set Reference to bz47338.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Apr 17 2013, 8:46 PM
Florian added a subscriber: Florian.Oct 9 2015, 9:54 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 9 2015, 9:54 PM

Change 329727 had a related patch set uploaded (by MtDu):
Add a 'ChangeUserGroups' hook in Special:Userrights

https://gerrit.wikimedia.org/r/329727

MtDu closed this task as Resolved.Dec 31 2016, 3:12 AM
MtDu claimed this task.
MtDu added a subscriber: MtDu.

Patch has been merged here. https://gerrit.wikimedia.org/r/#/c/329727/ Hence closing as resolved.
Thanks!

Change 329727 merged by jenkins-bot:
Add a 'ChangeUserGroups' hook in Special:Userrights

https://gerrit.wikimedia.org/r/329727

TTO reopened this task as Open.Dec 31 2016, 3:43 AM
TTO added a subscriber: TTO.

This isn't done yet... we still need to add the possibility to allow the hook to abort the process if it wants to. I'll do this after the user rights expiration stuff is sorted out

matej_suchanek removed MtDu as the assignee of this task.Dec 31 2016, 10:29 AM
matej_suchanek removed a project: Patch-For-Review.
matej_suchanek updated the task description. (Show Details)
matej_suchanek removed a subscriber: wikibugs-l-list.
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptApr 27 2017, 2:27 AM
TTO updated the task description. (Show Details)Apr 27 2017, 2:28 AM
MtDu added a comment.Apr 27 2017, 2:47 AM

My exams end on May 12, Can take a look then. Feel free to if you're up to it. @TTO