Page MenuHomePhabricator

Add hook before changing of userrights
Open, LowPublic


Author: trollingstone

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 task: The hook now exists but can't be aborted. Add that functionality in order to fully address the original request.

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).

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

MtDu claimed this task.
MtDu added a subscriber: MtDu.

Patch has been merged here. Hence closing as resolved.

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

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 a project: Patch-For-Review.
matej_suchanek updated the task description. (Show Details)
matej_suchanek removed a subscriber: wikibugs-l-list.

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

Change 542662 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Allow aborting changing userrights using ChangeUserGroups hook