Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
[solved] <!--[if admin]--> ???
-
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
looking for a plugin that will let me hide contents from non-admins. Any help? :) -
- Rank: Expert
- Registered: Dec 31, 1969
- Last visit: Oct 21, 2009
- Posts: 1437
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. -
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
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 -
**unknown user**
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 1097
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]-->
-
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
Supersonic hearing! ;)
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
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? -
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
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]-->
<!--[/if]-->
should do it.
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
- Moderated by:
- Support
