- Instead show a message saying that it will no longer be able to access this page
- Added a "success=1" parameter to URL the user is redirected to after making changes
on that page to catch those cases
bug: 48609
Change-Id: I4f42713ccec647b1d6ff11c2714d645973750579
}
if ( !$this->userCanChangeRights( $user, true ) ) {
+ if ( $this->isself && $request->getCheck( 'success' ) ) {
+ // bug 48609: if the user just removed its own rights, this would
+ // leads it in a "permissions error" page. In that case, show a
+ // message that it can't anymore use this page instead of an error
+ $this->setHeaders();
+ $out = $this->getOutput();
+ $out->wrapWikiMsg( "<div class=\"successbox\">\n$1\n</div>", 'userrights-removed-self' );
+ $out->returnToMain();
+ return;
+ }
+
// @todo FIXME: There may be intermediate groups we can mention.
$msg = $user->isAnon() ? 'userrights-nologin' : 'userrights-notallowed';
throw new PermissionsError( null, array( array( $msg ) ) );
}
function getSuccessURL() {
- return $this->getTitle( $this->mTarget )->getFullURL();
+ return $this->getTitle( $this->mTarget )->getFullURL( array( 'success' => 1 ) );
}
/**
'userrights-unchangeable-col' => 'Groups you cannot change',
'userrights-irreversible-marker' => '$1*', # only translate this message to other languages if you have to change it
'userrights-conflict' => 'User rights conflict! Please apply your changes again.',
+'userrights-removed-self' => 'You successfully removed your own rights. As such, you are no longer able to access this page.',
# Groups
'group' => 'Group:',
* $1 - optional, for PLURAL use, the number of items in the column following the message. Avoid PLURAL, if your language allows that.',
'userrights-irreversible-marker' => '{{optional}}',
'userrights-conflict' => "Shown on [[Special:UserRights]] if the target's rights have been changed since the form was loaded.",
+'userrights-removed-self' => "Shown on [[Special:UserRights]] in a green box after the user removed its own rights to access that page.",
# Groups
'group' => '{{Identical|Group}}',
'userrights-unchangeable-col',
'userrights-irreversible-marker',
'userrights-conflict',
+ 'userrights-removed-self',
),
'group' => array(
'group',