To check if a user is an administrative-level user, use the session_admin() function:
<?php
if (session_admin ()) {
// administrator
} else {
// not an administrator
}
?>
Similarly, you can call this function from a SimpleTemplate file via:
{if session_admin ()}
administrator
{end if}
{if else}
not an administrator
{end if}
And finally, you can call the same thing from an XT template via:
<xt:condition>
<xt:if expr="php: session_admin ()">
administrator
</xt:if>
<xt:else>
not an administrator
</xt:else>
</xt:condition>
Created on April 23, 2005 1:31 AM by lux
Linked from: Authentication