Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- nestormateo responded to »Fillters in Clip« 06:33 AM
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 03:19 AM
- frw responded to »Bug in the SMTP mail transfer protocol - Port 25 - Zikula 1.2.9« 22. May
- mdee responded to »Short URL questions« 22. May
- mesteele101 responded to »Problem in Database Connection« 21. May
- Herr.Vorragend responded to »Clip Documentation and Doubt« 19. May
- mazdev responded to »zikula 1.3.3. and IE9« 19. 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
Admin switch in theme
-
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Jan 09, 2004
- Posts: 6
I have looked through the forums, but couldn't find this info.... What I need is a general Admin switch for dynamic menus on my site, so that I can say "if admin (show admin panel link;show admin only forum link;show pnphpbb2 admin panel link)". Better yet, is there a listing of useful availble variables? TIA! -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Jan 09, 2004
- Posts: 6
No, what I'm doing is setting up a DHTML menu, that's dynamically created. I want the admin menu options to only appear for admins, but the menu in general will be there for everyone. A simple if statement, but I don't know what the variable name to test. -
- Rank: Software Foundation
- Registered: Dec 31, 1969
- Last visit: Oct 21, 2009
- Posts: 3814
you need to check against the various module components. check /includes/blocks/menu.php (waiting content area) for the basic idea.
--
regards from germany
..::[Zikula Application Framework]::.. ..::[SEO-Blog]::.. ..::[CMS Sicherheit]::.. -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Jan 09, 2004
- Posts: 6
Thanks, lars! There's not an ACCESS_ADMIN in there, but it gave me enough to find "'Permissions::', '::', ACCESS_ADMIN". If you can change permissions, you're an Admin, and it very nicely uses Pyro's suggestion
IMHO, there should be a global admin that is defined through a single variable check, instead of through a function (most sites only have one admin anyways)... Same thing with user logged in (phpBB uses $userdata["user_level"] and ["session_logged_in"])
For anyone else stumbling on this post, this should work (I have not tested yet)Code
if (!pnSecAuthAction(0, 'Permissions::', '::', ACCESS_ADMIN)) {
(some code)
}
Curious what the 0 indicates...? -
- Rank: Expert
- Registered: Dec 02, 2002
- Last visit: Apr 30, 2010
- Posts: 1474
Easy with Autotheme:
Code
if (atIsAdminUser()) {
//code here
}
Regards
--
-Lobos
Professional PHP Framework Services: Concept, Development and Deployment
- Moderated by:
- Support
