Index: trunk/extensions/GroupPermissionsManager/plugins/CustomTabs.php |
— | — | @@ -24,8 +24,6 @@ |
25 | 25 | $wgHooks['SkinTemplateTabs'][] = 'efGPManagerGetSkin'; |
26 | 26 | $wgHooks['SkinTemplateBuildContentActionUrlsAfterSpecialPage'][] = 'efGPManagerGetSkin'; |
27 | 27 | |
28 | | -$wgGPManagerShowEditTab = false; //whether to always show the edit tab even though the user may not be able to read the resulting page. |
29 | | - |
30 | 28 | $egSkinObj = ''; |
31 | 29 | |
32 | 30 | function efGPManagerCustomTabs(&$ca) { |
Index: trunk/extensions/GroupPermissionsManager/RemoveUnusedGroups.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | * @param $par unused |
20 | 20 | */ |
21 | 21 | function execute($par) { |
22 | | - global $wgUser, $wgRequest, $wgOut, $wgGPManagerRUGrequireConfirm; |
| 22 | + global $wgUser, $wgRequest, $wgOut, $wgGPManagerRUGconfirm; |
23 | 23 | |
24 | 24 | if( !$wgUser->isAllowed( 'userrights' ) ) { |
25 | 25 | $wgOut->permissionRequired( 'userrights' ); |
— | — | @@ -28,11 +28,12 @@ |
29 | 29 | wfLoadExtensionMessages('GroupPermissions'); |
30 | 30 | $this->setHeaders(); |
31 | 31 | $wgOut->addWikiText( wfMsg( 'grouppermissions-rug-header' ) ); |
32 | | - if($wgRequest->wasPosted()) { |
| 32 | + if($wgRequest->wasPosted() || !$wgGPManagerRUGconfirm) { |
33 | 33 | $success = $this->removeUsers(); |
34 | 34 | if($success) { |
35 | 35 | $wgOut->addWikiText(wfMsg('grouppermissions-rug-success')); |
36 | 36 | } |
| 37 | + return; |
37 | 38 | } |
38 | 39 | $thisTitle = Title::makeTitle( NS_SPECIAL, $this->getName() ); |
39 | 40 | $form = "<form method=\"post\" action=\"".$thisTitle->getLocalUrl()."\">\n<input type=\"submit\" name=\"wpConfirm\" value=\"".wfMsg('grouppermissions-rug-confirm')."\" />\n</form>"; |
Index: trunk/extensions/GroupPermissionsManager/GroupPermissionsManager.php |
— | — | @@ -19,16 +19,23 @@ |
20 | 20 | 'description' => 'Manage group permissions via a special page', |
21 | 21 | 'descriptionmsg' => 'grouppermissions-desc', |
22 | 22 | ); |
| 23 | + |
| 24 | +###Config Variables. Change these in your LocalSettings.php file |
| 25 | +##Core |
| 26 | +$wgGPManagerForceVersion = false; //whether to force versionCheck() to always return true. Set this only if you hacked the MediaWiki core and added in those hooks/functions |
| 27 | +$wgGPManagerRUGconfirm = true; //whether to show a confirmation button on Special:RemoveUnusedGroups or just execute immediately upon access |
| 28 | +##CustomTabs plugin |
| 29 | +$wgGPManagerShowEditTab = false; //whether to always show the edit tab even though the user may not be able to read the resulting page |
| 30 | +###End Config Variables. |
| 31 | + |
23 | 32 | $wgAutoloadClasses['GroupPermissions'] = dirname(__FILE__) . '/GroupPermissionsManager_body.php'; |
24 | 33 | $wgAutoloadClasses['RemoveUnusedGroups'] = dirname(__FILE__) . '/RemoveUnusedGroups.php'; |
25 | 34 | $wgAutoloadClasses['SortPermissions'] = dirname(__FILE__) . '/SortPermissions.php'; |
26 | | -#$wgAutoloadClasses['NamespaceManager'] = dirname(__FILE__) . '/NamespaceManager.php'; |
27 | 35 | $wgSpecialPages['GroupPermissions'] = 'GroupPermissions'; |
28 | 36 | $wgSpecialPages['RemoveUnusedGroups'] = 'RemoveUnusedGroups'; |
29 | 37 | $wgSpecialPages['SortPermissions'] = 'SortPermissions'; |
30 | | -#$wgSpecialPages['NamespaceManager'] = 'NamespaceManager'; |
31 | 38 | $wgExtensionMessagesFiles['GroupPermissions'] = dirname(__FILE__) . '/GetMessages.php'; |
32 | | -$wgExtensionAliasesFiles['GroupPermissions'] = $dir . 'GroupPermissions.alias.php'; |
| 39 | +$wgExtensionAliasesFiles['GroupPermissions'] = $dir . 'GroupPermissionsManager.alias.php'; |
33 | 40 | |
34 | 41 | $wgLogTypes[] = 'gpmanager'; |
35 | 42 | $wgLogActions['gpmanager/add'] = 'grouppermissions-log-add'; |
— | — | @@ -44,7 +51,6 @@ |
45 | 52 | ##Permission required to use the 'GroupPermissions' and 'SortPermissions' special page |
46 | 53 | ##By default all bureaucrats can |
47 | 54 | $wgGroupPermissions['bureaucrat']['grouppermissions'] = true; |
48 | | -#$wgGroupPermissions['bureaucrat']['nsmanager'] = true; |
49 | 55 | ##Uncomment this if you want to make a separate group that can access the page as well |
50 | 56 | #$wgGroupPermissions['grouppermissions']['grouppermissions'] = true; |
51 | 57 | ##'RemoveUnusedGroups' requires the 'userrights' permission, also given to bureaucrats by default |
— | — | @@ -139,7 +145,9 @@ |
140 | 146 | //checks if the version of MediaWiki being run is greater than or equal to the given version |
141 | 147 | //for compatibility checking, defaults to 1.12, since that's the minimum version needed for this extension |
142 | 148 | function versionCheck( $ver = '1.12' ) { |
143 | | - global $wgVersion; |
| 149 | + global $wgVersion, $wgGPManagerForceVersion; |
| 150 | + if($wgGPManagerForceVersion) |
| 151 | + return true; |
144 | 152 | $nvp = explode('.', $ver); //explode it into pieces |
145 | 153 | $cvp = explode('.', $wgVersion); //do the same to $wgVersion |
146 | 154 | if($cvp[0] < $nvp[0]) return false; |