Extension:HNP
From MediaWiki.org
|
Release status: stable |
|||
|---|---|---|---|
| Implementation | User rights | ||
| Description | Provides an hierarchical namespace permissions system (aka "prefixes") to Mediawiki without changes to the base installation nor creation of new database tables. | ||
| Author(s) | Jean-Lou Dupont | ||
| Last Version | 1.1.2 | ||
| MediaWiki | 1.10, 1.11 | ||
| License | No license specified | ||
| Download | no link See SVN |
||
|
|||
|
check usage (experimental) |
|||
Contents |
[edit] Features
- Permission management through simple edition of a page
MediaWiki:Registry/HNP
- Sysop has always all rights regardless of state of registry page
- Enables easier 'human error' management
- Prefix based namespace access with wildcards
- E.g. 'sysop group has access to all namespaces'
- Namespace dependant & Namespace Independant rights management
- No additional database tables nor changes to schema
- No mandatory patches
- Namespace dependant rights management: no patches necessary
- Namespace independant rights management: if wanted, requires a patch:
- 'includes/User.php'
- Post-installation information always available through Special:Version page.
- Magic Words:
- ' #username# ' magic word can be used to substitute the current user's name in the title field
- Useful for implementing functionality akin to 'KeepYourHandsToYourself' whereas only the owner of a userpage can edit his own
- ' #username# ' magic word can be used to substitute the current user's name in the title field
[edit] Usage
Please see example configuration page Example.
[edit] Notes
- Please read about security issues with authorization extensions
- Users interested in this extension might also appreciate Extension:BizzWiki.
[edit] Installation
See the Mediawiki Extension table entry "download" above.[1]
[edit] LocalSettings.php
Extension:ExtensionManager: See footnote[2]
- Add the following to LocalSettings.php if the extension was downloaded from Jean-Lou Dupont's MediaWiki SVN directory (link in the download entry of the table above)[2]:
require_once( "$IP/extensions/HNP/HNP.php" );
[edit] PEARPEAR is a repository of en:PHP software code.
require 'MediaWiki/HNP/HNP.php';
[edit] Upgrades through PEARSometimes, it is necessary to clear PEAR's cache in order to perform upgrades.
or use the force method:
[edit] PEAR Web FrontendFor easier remote package management, PEAR Frontend WEB can be installed. Installation notes can be found here. An example of the WEB frontend is available here. |
[edit] RSS feed
To keep kept up-to-date with this channel, use the following RSS feed__
.
[edit] Notes
[edit] Other Extensions From the same author
Consult User Jldupont's page.
- ↑ The most recent release is always available through the extension's PEAR and SVN repositories. This page is not necessarily up-to-date.
- ↑ 2.0 2.1 2.2 Extension:ExtensionManager does not require any modification to LocalSettings.php because ExtensionManager includes the extension.
Note that if PHP code caching is in place (e.g. APC, eAccelerator), then to successfully complete the installation a cache flush might be needed. - ↑ Modifications to
LocalSettings.phpis only necessary if not using Extension:ExtensionManager
[edit] User.php patch
[edit] Original file
function isAllowed($action='') { if ( $action === '' ) // In the spirit of DWIM return true; return in_array( $action, $this->getRights() ); }
[edit] Patched file
function isAllowed($action='', $ns = null /* addition */, $title = null /* addition */ ) { if ( $action === '' ) // In the spirit of DWIM return true; // PATCH begin{{ $result = null; wfRunHooks('UserIsAllowed', array( &$this, $ns, $title, &$action, &$result ) ); if ( $result !== null ) return $result; // PATCH end }} return in_array( $action, $this->getRights() ); }
[edit] MEDIAWIKI NOTES
1) Only the forward slash is interpreted (when enabled) as an indicator of "sub-page". Thus, only the forward slash and ~ are considered here to be part of the hierarchical functionality.
2) The allowed characters in a title are defined in "DefaultSettings.php".
$wgLegalTitleChars = " %!\"$&'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+";
NOTE that #{}[]| are not part of this list.
3) Special command characters for preg_match do not include the following:
#`'~,@ Those were tested with preg_quote
4) Be careful not to choose namespace name identifiers too long as the standard limit in Mediawiki is 16characters long.
[edit] History
[edit] 1.0.1
- Removed file caching (causing more troubles than adding value)
- Fixed debug messages as to not stop normal processing flow.
[edit] 1.1.0
- Added Magic Words support
- '#username#' magic word for implementing functionality akin to 'KeepYourHandsToYourself'
[edit] 1.1.1
- Attempt at fixing the parser functions '#hnp_r' and '#hnp_h' that do not work on some setup.
[edit] 1.1.2
- Reverted 'fix' of version 1.1.1
- Adjusted dependency to Extension:StubManager v1.0.5 (fix for PHP bug with version 5.1.2)