<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hans schrieb:
<blockquote cite="mid1717472940.20060221172149@flutesong.fsnet.co.uk"
type="cite">
<pre wrap="">Tuesday, February 21, 2006, 5:07:37 PM, noskule wrote:
</pre>
<blockquote type="cite">
<pre wrap="">$page = RetrieveAuthPage($pagename, 'read', false, READPAGE_CURRENT);
if (!@$page['=auth']['read']) SetTmplDisplay('PageCmdsFmt', 0);
</pre>
</blockquote>
<pre wrap=""><!---->
perhaps:
SetTmplDisplay('PageCmdsFmt', 0);
$page = RetrieveAuthPage($pagename, 'read', false, READPAGE_CURRENT);
if ($page['=auth']['edit']) SetTmplDisplay('PageCmdsFmt', 1);
Best,
~Hans
</pre>
</blockquote>
wow, this works :-)
<a class="moz-txt-link-freetext" href="http://pmwiki.netstreams.org/index.php/Test/HomePage">http://pmwiki.netstreams.org/index.php/Test/HomePage</a> 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 . ..<br>
<br>
<br>
<br>
-------------------------------<br>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Kate, the KDE Advanced Text Editor">
<pre><span style="color: rgb(128, 128, 128);"><i>## Auth User Test</i></span>
<span style="color: rgb(128, 128, 128);"><i>#$AuthUser['Guest'] = crypt('Guest');</i></span>
<span style="color: rgb(85, 85, 255);">$AuthUser</span><span
style="color: rgb(0, 128, 0);">[</span><span
style="color: rgb(221, 0, 0);">'Editor'</span><span
style="color: rgb(0, 128, 0);">]</span> = <span
style="color: rgb(0, 0, 128);">crypt</span><span
style="color: rgb(0, 128, 0);">(</span><span
style="color: rgb(221, 0, 0);">'Editor'</span><span
style="color: rgb(0, 128, 0);">);</span>
<span style="color: rgb(85, 85, 255);">$AuthUser</span><span
style="color: rgb(0, 128, 0);">[</span><span
style="color: rgb(221, 0, 0);">'Admin'</span><span
style="color: rgb(0, 128, 0);">]</span> = <span
style="color: rgb(0, 0, 128);">crypt</span><span
style="color: rgb(0, 128, 0);">(</span><span
style="color: rgb(221, 0, 0);">'test'</span><span
style="color: rgb(0, 128, 0);">);</span>
<span style="color: rgb(85, 85, 255);">$DefaultPasswords</span><span
style="color: rgb(0, 128, 0);">[</span><span
style="color: rgb(221, 0, 0);">'admin'</span><span
style="color: rgb(0, 128, 0);">]</span> = <span
style="color: rgb(221, 0, 0);">'id:Admin'</span><span
style="color: rgb(0, 128, 0);">;</span>
<span style="color: rgb(85, 85, 255);">$DefaultPasswords</span><span
style="color: rgb(0, 128, 0);">[</span><span
style="color: rgb(221, 0, 0);">'edit'</span><span
style="color: rgb(0, 128, 0);">]</span> = <span
style="color: rgb(221, 0, 0);">'id:Editor'</span><span
style="color: rgb(0, 128, 0);">;</span>
<span style="color: rgb(128, 128, 128);"><i>#$DefaultPasswords['read'] = 'id:Guest,Editor';</i></span>
<span style="color: rgb(161, 161, 0);">include_once</span><span
style="color: rgb(0, 128, 0);">(</span><span
style="color: rgb(221, 0, 0);">'scripts/authuser.php'</span><span
style="color: rgb(0, 128, 0);">);</span>
SetTmplDisplay<span
style="color: rgb(0, 128, 0);">(</span><span
style="color: rgb(221, 0, 0);">'PageCmdsAFmt'</span><span
style="color: rgb(0, 128, 0);">,</span> <span
style="color: rgb(0, 0, 255);">0</span><span
style="color: rgb(0, 128, 0);">);</span>
<span style="color: rgb(85, 85, 255);">$page</span> = RetrieveAuthPage<span
style="color: rgb(0, 128, 0);">(</span><span
style="color: rgb(85, 85, 255);">$pagename</span><span
style="color: rgb(0, 128, 0);">,</span> <span
style="color: rgb(221, 0, 0);">'read'</span><span
style="color: rgb(0, 128, 0);">,</span> <b>false</b><span
style="color: rgb(0, 128, 0);">,</span> READPAGE_CURRENT<span
style="color: rgb(0, 128, 0);">);</span>
<span style="color: rgb(161, 161, 0);">if</span> <span
style="color: rgb(0, 128, 0);">(</span><span
style="color: rgb(85, 85, 255);">$page</span><span
style="color: rgb(0, 128, 0);">[</span><span
style="color: rgb(221, 0, 0);">'=auth'</span><span
style="color: rgb(0, 128, 0);">][</span><span
style="color: rgb(221, 0, 0);">'edit'</span><span
style="color: rgb(0, 128, 0);">])</span> SetTmplDisplay<span
style="color: rgb(0, 128, 0);">(</span><span
style="color: rgb(221, 0, 0);">'PageCmdsAFmt'</span><span
style="color: rgb(0, 128, 0);">,</span> <span
style="color: rgb(0, 0, 255);">1</span><span
style="color: rgb(0, 128, 0);">);</span>
SetTmplDisplay<span
style="color: rgb(0, 128, 0);">(</span><span
style="color: rgb(221, 0, 0);">'PageCmdsBFmt'</span><span
style="color: rgb(0, 128, 0);">,</span> <span
style="color: rgb(0, 0, 255);">0</span><span
style="color: rgb(0, 128, 0);">);</span>
<span style="color: rgb(85, 85, 255);">$page</span> = RetrieveAuthPage<span
style="color: rgb(0, 128, 0);">(</span><span
style="color: rgb(85, 85, 255);">$pagename</span><span
style="color: rgb(0, 128, 0);">,</span> <span
style="color: rgb(221, 0, 0);">'read'</span><span
style="color: rgb(0, 128, 0);">,</span> <b>false</b><span
style="color: rgb(0, 128, 0);">,</span> READPAGE_CURRENT<span
style="color: rgb(0, 128, 0);">);</span>
<span style="color: rgb(161, 161, 0);">if</span> <span
style="color: rgb(0, 128, 0);">(</span><span
style="color: rgb(85, 85, 255);">$page</span><span
style="color: rgb(0, 128, 0);">[</span><span
style="color: rgb(221, 0, 0);">'=auth'</span><span
style="color: rgb(0, 128, 0);">][</span><span
style="color: rgb(221, 0, 0);">'edit'</span><span
style="color: rgb(0, 128, 0);">])</span> SetTmplDisplay<span
style="color: rgb(0, 128, 0);">(</span><span
style="color: rgb(221, 0, 0);">'PageCmdsBFmt'</span><span
style="color: rgb(0, 128, 0);">,</span> <span
style="color: rgb(0, 0, 255);">1</span><span
style="color: rgb(0, 128, 0);">);</span></pre>
<br>
</body>
</html>