To All:
How would I change a Special Page (User List) to a Restricted Special Page?
----------------------------------- Jason Spirko Systems Administrator Xoran Technologies
.................................................................................... This message (including any attachments) contains confidential and proprietary information intended only for the addressee. If you are not the intended recipient, please notify the sender immediately by responding to this e-mail, and delete this message and attachments from your system. If you have any questions about this e-mail please notify the sender immediately. Any unauthorized disclosure, copying, distribution or reliance on the contents of this information is strictly prohibited and may constitute a violation of law.
How would I change a Special Page (User List) to a Restricted Special Page?
I think you just add something like:
# Permission check if( !$wgUser->isAllowed( 'block' ) ) { $wgOut->permissionRequired( 'block' ); return; }
(copied from SpecialBlockip.php)
to the constructor (which is right at the bottom of SpecialListUsers.php). There must be something else required to stop it appearing on Special:Specialpages, but that should be enough to stop users without the appropriate permission (replace block with whatever you like) seeing the list.
On 30/07/07, Thomas Dalton thomas.dalton@gmail.com wrote:
to the constructor (which is right at the bottom of SpecialListUsers.php). There must be something else required to stop it appearing on Special:Specialpages, but that should be enough to stop users without the appropriate permission (replace block with whatever you like) seeing the list.
The "something else" depends on how the special page was written. If it's a recent one, which extends SpecialPage and overrides the constructor and execute() method, then the trick is to add a permission name, e.g. "block" or "userlist" as the second parameter in the parent::__construct() call in the constructor itself.
I suspect that Special:Userlist is one of the older breed, so this permission name is supplied in the list in includes/SpecialPage.php.
Rob Church
Rob:
You are correct. I modified the following line in 'SpecialPage.php' allowing any users with 'userrights' will see the user list.
'Listusers' => array( 'SpecialPage', 'Listusers', 'userrights' ),
Thanks for your direction.
----------------------------- Jason Spirko Systems Administrator Xoran Technologies Inc.
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Rob Church Sent: Monday, July 30, 2007 12:16 PM To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] Change SpecialPage:User List to Restricted Page
On 30/07/07, Thomas Dalton thomas.dalton@gmail.com wrote:
to the constructor (which is right at the bottom of SpecialListUsers.php). There must be something else required to stop it appearing on Special:Specialpages, but that should be enough to stop users without the appropriate permission (replace block with whatever you like) seeing the list.
The "something else" depends on how the special page was written. If it's a recent one, which extends SpecialPage and overrides the constructor and execute() method, then the trick is to add a permission name, e.g. "block" or "userlist" as the second parameter in the parent::__construct() call in the constructor itself.
I suspect that Special:Userlist is one of the older breed, so this permission name is supplied in the list in includes/SpecialPage.php.
Rob Church
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
.................................................................................... This message (including any attachments) contains confidential and proprietary information intended only for the addressee. If you are not the intended recipient, please notify the sender immediately by responding to this e-mail, and delete this message and attachments from your system. If you have any questions about this e-mail please notify the sender immediately. Any unauthorized disclosure, copying, distribution or reliance on the contents of this information is strictly prohibited and may constitute a violation of law.
mediawiki-l@lists.wikimedia.org