r44349 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44348‎ | r44349 | r44350 >
Date:17:15, 9 December 2008
Author:ashley
Status:deferred
Tags:
Comment:
bugfix - check for the correct user right
Modified paths:
  • /trunk/extensions/SocialProfile/SystemGifts/SpecialPopulateAwards.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/SystemGifts/SpecialPopulateAwards.php
@@ -6,7 +6,7 @@
77 * Constructor
88 */
99 public function __construct(){
10 - parent::__construct('PopulateAwards'/*class*/, 'populateawards' /*restriction*/);
 10+ parent::__construct('PopulateAwards'/*class*/, 'awardsmanage' /*restriction*/);
1111 }
1212
1313 /**
@@ -18,9 +18,9 @@
1919 global $wgUser, $wgOut, $wgMemc;
2020 $this->setHeaders();
2121
22 - # If user is blocked, s/he doesn't need to access this page
23 - if ( $wgUser->isBlocked() ) {
24 - $wgOut->blockedPage();
 22+ # If the user doesn't have the required 'awardsmanage' permission, display an error
 23+ if( !$wgUser->isAllowed( 'awardsmanage' ) ) {
 24+ $wgOut->permissionRequired( 'awardsmanage' );
2525 return;
2626 }
2727
@@ -30,9 +30,9 @@
3131 return;
3232 }
3333
34 - # If the user doesn't have the required 'awardsmanage' permission, display an error
35 - if( !$wgUser->isAllowed( 'awardsmanage' ) ) {
36 - $wgOut->permissionRequired( 'awardsmanage' );
 34+ # If user is blocked, s/he doesn't need to access this page
 35+ if ( $wgUser->isBlocked() ) {
 36+ $wgOut->blockedPage();
3737 return;
3838 }
3939

Status & tagging log