[pmwiki-users] commenting to private pages

Patrick R. Michaud pmichaud at pobox.com
Tue Dec 19 15:50:52 CST 2006


On Tue, Dec 19, 2006 at 09:25:55PM +0000, Hans wrote:
> Tuesday, December 19, 2006, 8:53:17 PM, Patrick wrote:
> 
> > Simply use ReadPage() instead of RetrieveAuthPage().
> 
> You think the following code is sufficient as a switch between the
> case where it may be allowed to post to some private page(s), and the
> case where an admin can enforce a higher auth level for posting, by
> setting var $FoxAuth to 'edit' or higher?
> 
>     if($FoxAuth=='read') $page = ReadPage($targetname);
>     else $page = RetrieveAuthPage($targetname, $FoxAuth, true);

Oh, I forgot.  RetrieveAuthPage allows a $level value of 'ALWAYS',
which means that the page is returned regardless of any
authorization settings in effect:

    $page = RetrieveAuthPage($targetname, 'ALWAYS', true);

That should work just about the same as ReadPage() for what you're
wanting to do.  Phrased another way, when Fox has decided that it's
okay to post to a page regardless of permissions, it can just pass
'ALWAYS' to the RetrieveAuthPage function instead of 'read' or 'edit'.

Pm




More information about the pmwiki-users mailing list