r64089 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64088‎ | r64089 | r64090 >
Date:19:59, 23 March 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Small improvement to permission check in Special:SMWAdmin
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/SMWAdmin/SMW_SpecialSMWAdmin.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/SMWAdmin/SMW_SpecialSMWAdmin.php
@@ -32,16 +32,13 @@
3333 }
3434
3535 public function execute( $par ) {
36 - global $wgOut, $wgRequest, $smwgAdminRefreshStore;
37 - global $wgServer; // "http://www.yourserver.org"
38 - // (should be equal to 'http://'.$_SERVER['SERVER_NAME'])
39 - global $wgScript; // "/subdirectory/of/wiki/index.php"
40 - global $wgUser;
 36+ global $wgOut, $wgRequest, $wgServer, $wgScript, $wgUser, $smwgAdminRefreshStore;
4137
42 - if ( !$wgUser->isAllowed( 'delete' ) ) {
43 - $wgOut->permissionRequired( 'delete' );
 38+ if ( !$this->userCanExecute( $wgUser ) ) {
 39+ // If the user is not authorized, show an error.
 40+ $this->displayRestrictionError();
4441 return;
45 - }
 42+ }
4643
4744 $this->setHeaders();
4845
@@ -56,7 +53,6 @@
5754 }
5855
5956 /**** Execute actions if any ****/
60 -
6157 $action = $wgRequest->getText( 'action' );
6258 if ( $action == 'updatetables' ) {
6359 $sure = $wgRequest->getText( 'udsure' );

Status & tagging log