Fork me on GitHub

[solved] <!--[if admin]--> ???  Bottom

  • looking for a plugin that will let me hide contents from non-admins. Any help? :)
  • why a plugin? What i do is just use perms in my templates. Works great!

    Example:

    Code

    <!--[if pnSecAuthAction(0, "clientlinks::", "::", ACCESS_COMMENT)]-->
    Show this
                    <!--[/if]-->


    You can do a an if else too.

    Code

    <!--[if pnSecAuthAction(0, "clientlinks::", "::", ACCESS_COMMENT)]-->
    Show this
    <!--[else]-->
    Show that
    <!--[/if]-->


    You can name the permission whatever you want and then go make that permission. You could just call one "AdminOnly" and then hide it from every group except admin. Hope this helps you out.
  • you should be using the pnSecAuthAction plugin to check permissions - you can then assign it to a variable and use it later int he template (I think Chestnut! posted an example recently)

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • Kookoo... knew my ears were ringing :)

    Code

    <!--[pnsecauthaction realm="0" comp="clientlinks::" inst="::" level="ACCESS_COMMENT" assign="auth"]-->

    <!--[if $auth eq true]-->

      Woha... you have the right to say something...

    <!--[else]-->

      Woha... you have the right to remain silent... all what you say can and will......
      humpff... forget it !

    <!--[/if]-->


    wink
  • I'm sorry - I don't get it :) I'm a little thick.

    All I'm doing is creating a link on the template to go to admin.php. I want to hide it from non-admins.

    so something like:


    show my link


    so, using the method Chestnut outlined, what is the correct pnsecauthaction code?
  • Code

    <!--[pnsecauthaction realm="0" comp="::" inst="::" level="ACCESS_ADMIN" assign="admin"]-->
    <!--[if $admin eq true]-->
    <a hef="admin.php">You're an admin!</a>
    <!--[else]-->
    &nbsp;
    <!--[/if]-->


    should do it.

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • thanks - that worked great!

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