[pmwiki-users] authuser & SetTmplDisplay

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 21 11:18:25 CST 2006


On Tue, Feb 21, 2006 at 06:07:37PM +0100, noskule wrote:
>  hi list
>  I try to hide parts of the content in relation to userrights. The skinsection
>  <!--PageCmdsFmt--> should only be visible if the user has edit rights.
>  So I made the following configuration:
> 
>  [...]
>  $page = RetrieveAuthPage($pagename, 'read', false, READPAGE_CURRENT);
>  if (!@$page['=auth']['read']) SetTmplDisplay('PageCmdsFmt', 0);

This would seem to me to cause PageCmdsFmt to disappear only
if the user doesn't have 'read' rights (in which case they
cannot view the page at all).  I think you might have meant:

   if (!@$page['=auth']['edit']) SetTmplDisplay('PageCmdsFmt', 0);

>    authuser works correct. But the PageCmdsFmt content is allways visible.
>    What I'm doing wrong here? And secound question: Is this also susposed to
>    work with the userauth cookbook script?

I don't think it will work with userauth -- IIRC, userauth handles
its authorization information somewhat differently than authuser.

Pm




More information about the pmwiki-users mailing list