Index: trunk/extensions/SemanticMediaWiki/specials/SMWAdmin/SMW_SpecialSMWAdmin.php |
— | — | @@ -32,16 +32,13 @@ |
33 | 33 | } |
34 | 34 | |
35 | 35 | 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; |
41 | 37 | |
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(); |
44 | 41 | return; |
45 | | - } |
| 42 | + } |
46 | 43 | |
47 | 44 | $this->setHeaders(); |
48 | 45 | |
— | — | @@ -56,7 +53,6 @@ |
57 | 54 | } |
58 | 55 | |
59 | 56 | /**** Execute actions if any ****/ |
60 | | - |
61 | 57 | $action = $wgRequest->getText( 'action' ); |
62 | 58 | if ( $action == 'updatetables' ) { |
63 | 59 | $sure = $wgRequest->getText( 'udsure' ); |