* Depending on the submit button used, call a form or a save function.
*/
function execute() {
+ // If the visitor doesn't have permissions to assign or remove
+ // any groups, it's a bit silly to give them the user search prompt.
+ $available = $this->changeableGroups();
+ if( empty( $available['add'] ) && empty( $available['remove'] ) ) {
+ // fixme... there may be intermediate groups we can mention.
+ global $wgOut, $wgUser;
+ $wgOut->showPermissionsErrorPage( array(
+ $wgUser->isAnon()
+ ? 'userrights-nologin'
+ : 'userrights-notallowed' ) );
+ return;
+ }
+
// show the general form
$this->switchForm();
if( $this->mPosted ) {
'userrights-available-remove' => 'You can remove users from $1.',
'userrights-no-interwiki' => 'You do not have permission to edit user rights on other wikis.',
'userrights-nodatabase' => 'Database $1 does not exist or is not local.',
+'userrights-nologin' => 'You must [[Special:Userlogin|log in]] with an administrator account to assign user rights.',
+'userrights-notallowed' => 'Your account does not have permission to assign user rights.',
# Groups
'group' => 'Group:',