Fork me on GitHub

Code for testing admin  Bottom

  • Can anyone help me with the basic code to test whether the logged-in user has admin privileges or not? I basically want to add a link to the admin panel within my home.htm and master.htm that only shows when I am logged in as an administrator. Thanks.

    --
    km
  • it depends which version of zikula you are using. here is the old (1.2.x) way:

    Code

    <!--[pnsecauthaction realm="0" comp="::" inst="::" level="ACCESS_ADMIN" assign="admin"]-->
    <!--[if $admin eq true]-->
    <li><a href="<!--[pnmodurl modname="Admin" func="adminpanel" type="admin"]-->"><img src='images/icons/small/configure.gif' alt='Administrate Site'></a></li>
    <!--[/if]-->
  • Dude, you rock. It worked like a charm.

    If you are willing, could you give me a lesson on the first line? What is pnsecauthaction? And the other variables?

    Where might I learn more about using this type of logic with zikula? It seems like it would have several applications.

    --
    km
  • 0 users

This list is based on users active over the last 60 minutes.