Members

Note: You can use your Sitellite.org account here and vice versa.

Username

Password

Remember Login

Forgot your password?

Not a member? Click here to register

Session Admin

Home Page | All Pages | Recently Revised | Authors | Feeds |

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