[pmwiki-users] Password protect page with editors' password action

Alex Eftimiades alexeftimiades at gmail.com
Sat Jul 14 17:53:28 CDT 2012

I have been trying to make a button that password protects a page with  
the editors' password, or un-protects it if it is already protected.

I tried putting this at the bottom of config.php, but it just seemed  
to mess up my pages:
$HandleActions['switchauth'] = 'switchauth';  # if url contains  
action=myaction call HandleMyAction timely
$HandleAuth['switchauth'] = ' ';              # authorization level  
$auth for HandleMyAction

function switchauth($pagename, $auth) {     # parameters (signature)  
of handler function required by PMWiki
#  Lock(2);
   $pagestuff = RetrieveAuthPage($pagename, 'attr', false);
     $pagestuff['passwdread'] = 'test';
     $pagestuff['passwdread'] = 'test';
   UpdatePage($pagename, $old, $pagestuff);
#  Lock(0);

Can someone please help me?

More information about the pmwiki-users mailing list