r40613 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40612‎ | r40613 | r40614 >
Date:20:31, 8 September 2008
Author:ialex
Status:old
Tags:
Comment:
(bug 14744) Custom rights defined in $wgRestrictionLevels are now configurable in $wgGroupPermissions (require MediaWiki 1.13+)
Modified paths:
  • /trunk/extensions/Configure/CHANGELOG (modified) (history)
  • /trunk/extensions/Configure/Configure.func.php (modified) (history)
  • /trunk/extensions/Configure/Configure.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/CHANGELOG
@@ -1,6 +1,10 @@
22 This file lists changes on this extension.
33 Localisation updates are done on betawiki and aren't listed here.
44
 5+0.7.3 - 8 September 2008
 6+ (bug 14744) Custom rights defined in $wgRestrictionLevels are now configurable
 7+ in $wgGroupPermissions (require MediaWiki 1.13+).
 8+
59 0.7.2 - 7 September 2008
610 Added $wgEnableImageWhitelist and $wgSpecialPageCacheUpdates.
711
Index: trunk/extensions/Configure/Configure.func.php
@@ -108,3 +108,14 @@
109109 } while( $code = Language::getFallbackFor( $code ) );
110110 return true;
111111 }
 112+
 113+/**
 114+ * Add custom rights defined in $wgRestrictionLevels
 115+ * Note that this only works on 1.13+
 116+ */
 117+function efConfigureGetAllRights( &$rights ){
 118+ global $wgRestrictionLevels;
 119+ $newrights = array_diff( $wgRestrictionLevels, array( '', 'sysop' ) ); // Pseudo rights
 120+ $rights = array_unique( array_merge( $rights, $newrights ) );
 121+ return true;
 122+}
\ No newline at end of file
Index: trunk/extensions/Configure/Configure.php
@@ -17,7 +17,7 @@
1818 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure',
1919 'description' => 'Allow authorised users to configure the wiki by a web-based interface',
2020 'descriptionmsg' => 'configure-desc',
21 - 'version' => '0.7.2',
 21+ 'version' => '0.7.3',
2222 );
2323
2424 ## Configuration part
@@ -133,6 +133,9 @@
134134 $wgHooks['LangugeGetSpecialPageAliases'][] = 'efConfigureLoadAliases';
135135 }
136136
 137+## Add custom rights defined in $wgRestrictionLevels
 138+$wgHooks['UserGetAllRights'][] = 'efConfigureGetAllRights';
 139+
137140 ## Adding the new special pages...
138141 ## Common code
139142 $wgAutoloadClasses['ConfigurationPage'] = $dir . 'Configure.page.php';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r37266(bug 14744) Fixed default value of $wgExternalDiffEngineialex17:04, 7 July 2008