Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. 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
getting users group data
-
- Rank: Softmore
- Registered: Oct 05, 2008
- Last visit: Feb 17, 2010
- Posts: 144
not really making a module but i didnt know where to post this, how can i get users info and tell what group a user belongs to? ill be using PHP. -
**unknown user**
- Rank: Expert
- Registered: Mar 16, 2002
- Last visit: Apr 02, 2010
- Posts: 1208
This should point you in the right direction, I think:
http://api.zikula.or…usergetvar.php.html -
- Rank: Softmore
- Registered: Oct 05, 2008
- Last visit: Feb 17, 2010
- Posts: 144
that might help thanx :D but first i must get the users id so i can find the rest. any idea where to start? could i take ZIKULASID2 from the cookie and find the user id? like using the pn_session_info table? -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
Depends on which data you have to get the user(s) in question
then get that data directly or first find his(their) uid(s).
So, which is the context?
Greetings
--
- Mateo T. -
Mis principios... son mis fines -
**unknown user**
- Rank: Helper
- Registered: Mar 16, 2002
- Last visit: May 18, 2010
- Posts: 985
Not really PHP but how about this?
Code
<!--[pnmodapifunc modname="Groups" type="user" func="getusergroups" uid=$uid assign="usergroups"]-->
<!--[foreach item="group" from=$usergroups]-->
<!--[if $group.gid eq 1]-->
statement
<!--[/if]-->
<!--[/foreach]-->
- Igor -
- Rank: Softmore
- Registered: Oct 05, 2008
- Last visit: Feb 17, 2010
- Posts: 144
yeah the end game is to get their group so i know if they belong to a group that is allowed to have access to the content -
- Rank: Developer
- Registered: Jun 03, 2002
- Last visit: Dec 21, 2009
- Posts: 284
This sound like you need to set the correct permissions for each group for the module. And if the modules are done right and the correct permissions are set, then the users in the groups that do not have permission to view that module's content wont see it.
--
cyber_wolf
www.bkbsolutions.com - My Zikula module development site. -
- Rank: Softmore
- Registered: Oct 05, 2008
- Last visit: Feb 17, 2010
- Posts: 144
the module is Pages which is working fine its just a Blank Page but it has a iframe and i need to get that info for the page that loads in the iframe -
- Rank: Softmore
- Registered: May 30, 2005
- Last visit: May 31, 2010
- Posts: 340
You should be able to do this just with permissions. I tried it out on my test site. Any time you have a module that you are setting new permissions for, follow these steps.
- First, look at the pnversion.php file to see how the permission scheme is laid out. For pages it's very nice for what you want to do. Here is how it's listed.
Code
This means you can identify each page either by its name, or its id
- Now go to the permissions module when you are logged in as an administrator.
- Create a new rule and enter these codes. This example assumes the page ID is 1
Group -- (The group name you want to limit it to)
Component -- Pages::Page
Instance -- .*::1
Permissions Level -- (The level of access you want to give them)
- Save your data and test. That should do it.
Here is a good summary page on Permissions http://community.zik…ag=PermissionsAdmin
- Moderated by:
- Support
