Hello. You can overload constructor of your Special page (more on http://www.mediawiki.org/wiki/Manual:Special_pages#Constructor). So you can use this:
SpecialPage::SpecialPage('YourSpecialPageName', 'sysop');
in the constructor of your special page class.
-Matěj Grabovský
Od: Christian Schneider Přijato: 28.3.2008 9:55:47 Předmět: [Mediawiki-l] How to block Special Pages for non-Sysop Users?
Can anyone tell me how I can block the Special Pages for all user
which are not sysop?
Thanks
Christian Schneider
------------------------------------------
Setting a restriction (the second constructor parameter) will force your SpecialPage to be listed underneath the Restricted special pages list on Special:Specialpages, but if you override the execute() method in your child class, this will be insufficient to stop someone from actually using the page, assuming they know the URL.
To really prevent access, you should do something like this:
class YourSpecialPage extends SpecialPage { ... function execute( $par ) { global $wgUser; if ($this->userCanExecute($wgUser)) { global $wgOut; # To show the "permission required" page if the person doesn't have the 'whatever' permission: $wgOut->permissionRequired( 'whatever' ); # OR, to show an error page as though the SpecialPage doesn't exist at all (sneaky) $wgOut->showErrorPage( 'errorpagetitle', 'nospecialpagetext' ); return false; } }
Good luck!
-- Jim R. Wilson (jimbojw)
On Fri, Mar 28, 2008 at 7:57 AM, Grabovský Matěj 65s.mg@atlas.cz wrote:
Hello. You can overload constructor of your Special page (more on http://www.mediawiki.org/wiki/Manual:Special_pages#Constructor). So you can use this:
SpecialPage::SpecialPage('YourSpecialPageName', 'sysop');
in the constructor of your special page class.
-Matěj Grabovský
Od: Christian Schneider Přijato: 28.3.2008 9:55:47 Předmět: [Mediawiki-l] How to block Special Pages for non-Sysop Users?
Can anyone tell me how I can block the Special Pages for all user
which are not sysop?
Thanks
Christian Schneider
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Thanks, this solved my problem for now...
Regards,
Christian Schneider
On Mar 28, 2008, at 2:20 PM, Jim R. Wilson wrote:
http://www.mediawiki.org/wiki/Manual:Special_pages#Constructor
mediawiki-l@lists.wikimedia.org