[pmwiki-users] How to disable some actions if user has no admin rights?

Ted Nicolson deltafox at mail.com
Tue Mar 7 08:37:34 CST 2006


Is it possible to disable actions like rss, diff, atom etc, if user has
no logged in yet ?
I'd like to leave only browse, search and login enabled by default. I
know that I can protect them but what I'm looking for, is to
conditionally disable them not simply protect their access with password.

I tried something like the the following in both skin.php and config.php
... 
 $page = RetrieveAuthPage($pagename, 'read', false, READPAGE_CURRENT);
 if (! $page['=auth']['admin']) {
##  Allow only essential site-related actions.
$Actions_allowed =  array('browse','print','search','login');
if (! in_array($action, $Actions_allowed)) { $action='browse'; }
}

Unfortunately if didn't work. BTW I know how to disable actions in
config.php but don't know how to do that conditionally, depending on user
login status. I'd like to leave a basic set of actions enabled for all
readers, and the rest only available to a single admin (me)

Any idea?

Thanks for your help

Ted

-- 
___________________________________________________
Play 100s of games for FREE! http://games.mail.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20060307/c7f60184/attachment.html 


More information about the pmwiki-users mailing list