r104850 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104849‎ | r104850 | r104851 >
Date:13:46, 1 December 2011
Author:cervidae
Status:deferred
Tags:
Comment:
Only show on Special:SpecialPages when user has 'batchuserrights' permission, removing obsolete 'userCanChangeRights', and adding message+documentation for 'right-batchuserrights'
Modified paths:
  • /trunk/extensions/BatchUserRights/BatchUserRights.i18n.php (modified) (history)
  • /trunk/extensions/BatchUserRights/SpecialBatchUserRights.php (modified) (history)

Diff [purge]

Index: trunk/extensions/BatchUserRights/BatchUserRights.i18n.php
@@ -22,13 +22,18 @@
2323 'batchuserrights-no-groups' => 'You did not choose any groups.
2424 This will not accomplish anything.
2525 The rest of the page will be allowed to run just so that you can easily see if any of the usernames could not be loaded.',
 26+
 27+ 'right-batchuserrights' => 'Adding one or more users to a group or more groups in one action',
2628 );
2729
2830 /** Message documentation (Message documentation)
 31+ * @author SVG
2932 * @author The Evil IP address
3033 */
3134 $messages['qqq'] = array(
3235 'batchuserrights-desc' => '{{desc}}',
 36+
 37+ 'right-batchuserrights' => '{{doc-right|batchuserrights}}',
3338 );
3439
3540 /** Afrikaans (Afrikaans)
@@ -102,6 +107,8 @@
103108 'batchuserrights-no-groups' => 'Du hast keine Gruppen ausgewählt.
104109 Dies wird nichts verändern.
105110 Der Rest der Seite wird nur geladen, sodass du einfach sehen kannst ob einer der Benutzer nicht geladen werden konnte.',
 111+
 112+ 'right-batchuserrights' => 'Mehrere Benutzer in einer Aktion einer oder mehrerer Gruppen hinzufügen',
106113 );
107114
108115 /** Spanish (Español)
@@ -395,4 +402,3 @@
396403 'batchuserrights' => '批处理的用户权限',
397404 'batchuserrights-desc' => '允许将一个或多个用户添加到一个操作中的一个组',
398405 );
399 -
Index: trunk/extensions/BatchUserRights/SpecialBatchUserRights.php
@@ -9,6 +9,7 @@
1010 protected $isself = false;
1111
1212 // For added security, this array will be the only groups we'll allow to be batch-added to users.
 13+ // FIXME: Don't use private function to define addable groups, switch to global variable
1314 private static $grantableUserGroups = array(
1415 'beta',
1516 'rollback',
@@ -21,10 +22,6 @@
2223 parent::__construct( 'BatchUserRights', 'batchuserrights' );
2324 }
2425
25 - public function userCanExecute( $user ) {
26 - return $this->userCanChangeRights( $user, false );
27 - }
28 -
2926 public function userCanChangeRights( $user, $checkIfSelf = true ) {
3027 $available = $this->changeableGroups();
3128 return !empty( $available['add'] ) ||
@@ -50,15 +47,6 @@
5148 return;
5249 }
5350
54 - if ( !$this->userCanChangeRights( $wgUser, true ) ) {
55 - // @todo FIXME: there may be intermediate groups we can mention.
56 - $wgOut->showPermissionsErrorPage( array(
57 - $wgUser->isAnon()
58 - ? 'userrights-nologin'
59 - : 'userrights-notallowed' ) );
60 - return;
61 - }
62 -
6351 // check if user is blocked -- see rt#19111
6452 if ( $wgUser->isBlocked() ) {
6553 $wgOut->blockedPage();
@@ -568,4 +556,4 @@
569557
570558 return $groups;
571559 }
572 -}
\ No newline at end of file
 560+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r104966complete message documentationcervidae13:37, 2 December 2011

Status & tagging log