Index: trunk/extensions/DSMW/DSMW_Settings.php |
— | — | @@ -35,14 +35,8 @@ |
36 | 36 | $wgGroupPermissions['*']['editchangeset'] = false; |
37 | 37 | $wgGroupPermissions['sysop']['editchangeset'] = true; |
38 | 38 | |
39 | | - |
40 | | -$wgGroupPermissions['*']['ArticleAdminPage'] = true;// sysop |
41 | 39 | require_once( dirname( __FILE__ ) . '/specials/ArticleAdminPage.php' ); |
42 | | - |
43 | | -$wgGroupPermissions['*']['DSMWAdmin'] = true;// sysop |
44 | 40 | require_once( dirname( __FILE__ ) . '/specials/DSMWAdmin.php' ); |
45 | | - |
46 | | -$wgGroupPermissions['*']['DSMWGeneralExhibits'] = true;// sysop |
47 | 41 | require_once( dirname( __FILE__ ) . '/specials/DSMWGeneralExhibits.php' ); |
48 | 42 | |
49 | 43 | // semantic mediawiki extension |
Index: trunk/extensions/DSMW/specials/ArticleAdminPage.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | $wgHooks["SkinTemplateTabs"][] = $this; |
19 | 19 | $wgHooks['SkinTemplateNavigation'][] = $this; |
20 | 20 | |
21 | | - parent::__construct( 'ArticleAdminPage' ); |
| 21 | + parent::__construct( 'ArticleAdminPage', 'delete' ); |
22 | 22 | } |
23 | 23 | |
24 | 24 | public function getDescription() { |
— | — | @@ -35,8 +35,14 @@ |
36 | 36 | * @return <bool> |
37 | 37 | */ |
38 | 38 | public function execute() { |
39 | | - global $wgOut, $wgServerName, $wgScriptPath, $wgScriptExtension; /*, $wgSitename, $wgCachePages, $wgUser, $wgTitle, $wgDenyAccessMessage, $wgAllowAnonUsers, $wgRequest, $wgMessageCache, $wgWatchingMessages, $wgDBtype, $namespace_titles;*/ |
| 39 | + global $wgOut, $wgServerName, $wgScriptPath, $wgScriptExtension, $wgUser; |
40 | 40 | |
| 41 | + if ( !$this->userCanExecute( $wgUser ) ) { |
| 42 | + // If the user is not authorized, show an error. |
| 43 | + $this->displayRestrictionError(); |
| 44 | + return; |
| 45 | + } |
| 46 | + |
41 | 47 | $url = 'http://' . $wgServerName . $wgScriptPath . "/index{$wgScriptExtension}"; |
42 | 48 | $urlServer = 'http://' . $wgServerName . $wgScriptPath; |
43 | 49 | // $wgOut->addHeadItem('script', ArticleAdminPage::javascript()); |
Index: trunk/extensions/DSMW/specials/DSMWAdmin.php |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | # Add all our needed hooks |
18 | 18 | $wgHooks['SkinTemplateTabs'][] = $this; |
19 | 19 | |
20 | | - parent::__construct( 'DSMWAdmin' ); |
| 20 | + parent::__construct( 'DSMWAdmin', 'delete' ); |
21 | 21 | } |
22 | 22 | |
23 | 23 | public function getDescription() { |
— | — | @@ -34,8 +34,14 @@ |
35 | 35 | * @return <bool> |
36 | 36 | */ |
37 | 37 | public function execute() { |
38 | | - global $wgOut, $wgRequest, $wgServerName, $wgScriptPath, $wgDSMWIP, $wgServerName, $wgScriptPath; |
| 38 | + global $wgOut, $wgRequest, $wgServerName, $wgScriptPath, $wgDSMWIP, $wgServerName, $wgScriptPath, $wgUser; |
39 | 39 | |
| 40 | + if ( !$this->userCanExecute( $wgUser ) ) { |
| 41 | + // If the user is not authorized, show an error. |
| 42 | + $this->displayRestrictionError(); |
| 43 | + return; |
| 44 | + } |
| 45 | + |
40 | 46 | /**** Get status of refresh job, if any ****/ |
41 | 47 | $dbr =& wfGetDB( DB_SLAVE ); |
42 | 48 | $row = $dbr->selectRow( 'job', '*', array( 'job_cmd' => 'DSMWUpdateJob' ), __METHOD__ ); |
Index: trunk/extensions/DSMW/specials/DSMWGeneralExhibits.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | class DSMWGeneralExhibits extends SpecialPage { |
14 | 14 | |
15 | 15 | public function __construct() { |
16 | | - parent::__construct( 'DSMWGeneralExhibits' ); |
| 16 | + parent::__construct( 'DSMWGeneralExhibits', 'delete' ); |
17 | 17 | } |
18 | 18 | |
19 | 19 | public function getDescription() { |
— | — | @@ -27,8 +27,14 @@ |
28 | 28 | * There are 3 links used to see informations about Patches, PullFeeds or PushFeeds |
29 | 29 | */ |
30 | 30 | public function execute() { |
31 | | - global $wgOut, $wgRequest; |
| 31 | + global $wgOut, $wgRequest, $wgUser; |
32 | 32 | |
| 33 | + if ( !$this->userCanExecute( $wgUser ) ) { |
| 34 | + // If the user is not authorized, show an error. |
| 35 | + $this->displayRestrictionError(); |
| 36 | + return; |
| 37 | + } |
| 38 | + |
33 | 39 | $output = '<p>This page displays general informations about Distributed Semantic MediaWiki.</p>'; |
34 | 40 | |
35 | 41 | $returntitle1 = Title::makeTitle( NS_SPECIAL, 'DSMWGeneralExhibits' ); |