[pmwiki-users] authuser & SetTmplDisplay

noskule noskule at gmx.net
Tue Feb 21 12:11:33 CST 2006


Hans schrieb:

>Tuesday, February 21, 2006, 5:07:37 PM, noskule wrote:
>  
>
>>$page = RetrieveAuthPage($pagename, 'read', false, READPAGE_CURRENT);
>>if (!@$page['=auth']['read']) SetTmplDisplay('PageCmdsFmt', 0);
>>    
>>
>
>perhaps:
>
>SetTmplDisplay('PageCmdsFmt', 0);
>$page = RetrieveAuthPage($pagename, 'read', false, READPAGE_CURRENT);
>if ($page['=auth']['edit']) SetTmplDisplay('PageCmdsFmt', 1);
>
>
>Best, 
>~Hans                           
>
>
>  
>
wow, this works :-) http://pmwiki.netstreams.org/index.php/Test/HomePage 
edit access: Editor/Editor . I made 2 areas:PageCmdsAFmt, PageCmdsBFmt. 
"B" is shown correctly but not "A", it hides a tr. Does someone have any 
suggestions? I attached the template . ..



-------------------------------

/## Auth User Test/
/#$AuthUser['Guest'] = crypt('Guest');/
$AuthUser['Editor'] = crypt('Editor');
$AuthUser['Admin'] = crypt('test');

$DefaultPasswords['admin'] = 'id:Admin';
$DefaultPasswords['edit'] = 'id:Editor';
/#$DefaultPasswords['read'] = 'id:Guest,Editor';/

include_once('scripts/authuser.php');

SetTmplDisplay('PageCmdsAFmt', 0);
$page = RetrieveAuthPage($pagename, 'read', *false*, READPAGE_CURRENT);
if ($page['=auth']['edit']) SetTmplDisplay('PageCmdsAFmt', 1);

SetTmplDisplay('PageCmdsBFmt', 0);
$page = RetrieveAuthPage($pagename, 'read', *false*, READPAGE_CURRENT);
if ($page['=auth']['edit']) SetTmplDisplay('PageCmdsBFmt', 1);


-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20060221/8984fd93/attachment.html 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20060221/8984fd93/attachment-0001.html 


More information about the pmwiki-users mailing list