r40807 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40806‎ | r40807 | r40808 >
Date:02:39, 14 September 2008
Author:skizzerz
Status:old
Tags:
Comment:
*update
Modified paths:
  • /trunk/extensions/GroupPermissionsManager/GroupPermissionsManager.php (modified) (history)
  • /trunk/extensions/GroupPermissionsManager/RemoveUnusedGroups.php (modified) (history)
  • /trunk/extensions/GroupPermissionsManager/plugins/CustomTabs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GroupPermissionsManager/plugins/CustomTabs.php
@@ -24,8 +24,6 @@
2525 $wgHooks['SkinTemplateTabs'][] = 'efGPManagerGetSkin';
2626 $wgHooks['SkinTemplateBuildContentActionUrlsAfterSpecialPage'][] = 'efGPManagerGetSkin';
2727
28 -$wgGPManagerShowEditTab = false; //whether to always show the edit tab even though the user may not be able to read the resulting page.
29 -
3028 $egSkinObj = '';
3129
3230 function efGPManagerCustomTabs(&$ca) {
Index: trunk/extensions/GroupPermissionsManager/RemoveUnusedGroups.php
@@ -18,7 +18,7 @@
1919 * @param $par unused
2020 */
2121 function execute($par) {
22 - global $wgUser, $wgRequest, $wgOut, $wgGPManagerRUGrequireConfirm;
 22+ global $wgUser, $wgRequest, $wgOut, $wgGPManagerRUGconfirm;
2323
2424 if( !$wgUser->isAllowed( 'userrights' ) ) {
2525 $wgOut->permissionRequired( 'userrights' );
@@ -28,11 +28,12 @@
2929 wfLoadExtensionMessages('GroupPermissions');
3030 $this->setHeaders();
3131 $wgOut->addWikiText( wfMsg( 'grouppermissions-rug-header' ) );
32 - if($wgRequest->wasPosted()) {
 32+ if($wgRequest->wasPosted() || !$wgGPManagerRUGconfirm) {
3333 $success = $this->removeUsers();
3434 if($success) {
3535 $wgOut->addWikiText(wfMsg('grouppermissions-rug-success'));
3636 }
 37+ return;
3738 }
3839 $thisTitle = Title::makeTitle( NS_SPECIAL, $this->getName() );
3940 $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 @@
2020 'description' => 'Manage group permissions via a special page',
2121 'descriptionmsg' => 'grouppermissions-desc',
2222 );
 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+
2332 $wgAutoloadClasses['GroupPermissions'] = dirname(__FILE__) . '/GroupPermissionsManager_body.php';
2433 $wgAutoloadClasses['RemoveUnusedGroups'] = dirname(__FILE__) . '/RemoveUnusedGroups.php';
2534 $wgAutoloadClasses['SortPermissions'] = dirname(__FILE__) . '/SortPermissions.php';
26 -#$wgAutoloadClasses['NamespaceManager'] = dirname(__FILE__) . '/NamespaceManager.php';
2735 $wgSpecialPages['GroupPermissions'] = 'GroupPermissions';
2836 $wgSpecialPages['RemoveUnusedGroups'] = 'RemoveUnusedGroups';
2937 $wgSpecialPages['SortPermissions'] = 'SortPermissions';
30 -#$wgSpecialPages['NamespaceManager'] = 'NamespaceManager';
3138 $wgExtensionMessagesFiles['GroupPermissions'] = dirname(__FILE__) . '/GetMessages.php';
32 -$wgExtensionAliasesFiles['GroupPermissions'] = $dir . 'GroupPermissions.alias.php';
 39+$wgExtensionAliasesFiles['GroupPermissions'] = $dir . 'GroupPermissionsManager.alias.php';
3340
3441 $wgLogTypes[] = 'gpmanager';
3542 $wgLogActions['gpmanager/add'] = 'grouppermissions-log-add';
@@ -44,7 +51,6 @@
4552 ##Permission required to use the 'GroupPermissions' and 'SortPermissions' special page
4653 ##By default all bureaucrats can
4754 $wgGroupPermissions['bureaucrat']['grouppermissions'] = true;
48 -#$wgGroupPermissions['bureaucrat']['nsmanager'] = true;
4955 ##Uncomment this if you want to make a separate group that can access the page as well
5056 #$wgGroupPermissions['grouppermissions']['grouppermissions'] = true;
5157 ##'RemoveUnusedGroups' requires the 'userrights' permission, also given to bureaucrats by default
@@ -139,7 +145,9 @@
140146 //checks if the version of MediaWiki being run is greater than or equal to the given version
141147 //for compatibility checking, defaults to 1.12, since that's the minimum version needed for this extension
142148 function versionCheck( $ver = '1.12' ) {
143 - global $wgVersion;
 149+ global $wgVersion, $wgGPManagerForceVersion;
 150+ if($wgGPManagerForceVersion)
 151+ return true;
144152 $nvp = explode('.', $ver); //explode it into pieces
145153 $cvp = explode('.', $wgVersion); //do the same to $wgVersion
146154 if($cvp[0] < $nvp[0]) return false;