Extension:HNP
|
HNP 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 and version matrix | |||
Contents |
Features [edit]
- 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
Usage [edit]
Please see example configuration page Example.
Notes [edit]
- Please read about security issues with authorization extensions
- Users interested in this extension might also appreciate Extension:BizzWiki.
ISSUES/BUGS [edit]
If you receive the "unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_NS_SEPARATOR" error in line 423 of extensions/HNP/HNP.body.php, change the "Namespace::" reference to "MWNamespace::". The error will disappear - or at least it did for me. salindley 9 March 2010
Installation [edit]
See the Mediawiki Extension table entry "download" above.[1]
LocalSettings.php [edit]
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" );
- Since this Extensions is depending on StubManager, add the line after the StubManager include, or else your Wiki won't work.
PEAR [edit]PEAR is a repository of PHP software code.
require 'MediaWiki/HNP/HNP.php';
Upgrades through PEAR [edit]Sometimes, it is necessary to clear PEAR's cache in order to perform upgrades.
or use the force method:
PEAR Web Frontend [edit]For 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. |
RSS feed [edit]
To keep up-to-date with this channel, use the following RSS feed__
.
Notes [edit]
Other Extensions From the same author [edit]
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
ISSUES/BUGS [edit]
If you receive the "unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_NS_SEPARATOR" error in line 423 of extensions/HNP/HNP.body.php, change the "Namespace::" reference to "MWNamespace::". The error will disappear - or at least it did for me. salindley 9 March 2010
User.php patch [edit]
Original file [edit]
function isAllowed($action='') {
if ( $action === '' )
// In the spirit of DWIM
return true;
return in_array( $action, $this->getRights() );
}
Patched file [edit]
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() );
}
MEDIAWIKI NOTES [edit]
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.
History [edit]
1.0.1 [edit]
- Removed file caching (causing more troubles than adding value)
- Fixed debug messages as to not stop normal processing flow.
1.1.0 [edit]
- Added Magic Words support
- '#username#' magic word for implementing functionality akin to 'KeepYourHandsToYourself'
1.1.1 [edit]
- Attempt at fixing the parser functions '#hnp_r' and '#hnp_h' that do not work on some setup.
1.1.2 [edit]
- Reverted 'fix' of version 1.1.1
- Adjusted dependency to Extension:StubManager v1.0.5 (fix for PHP bug with version 5.1.2)