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

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

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

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