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

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. Hence closing as resolved.

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

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

Restricted Application added a project: User-DannyS712. · View Herald TranscriptSep 22 2019, 2:35 AM
DannyS712 moved this task from Unsorted to Next on the User-DannyS712 board.Sep 22 2019, 2:35 AM

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