Fork me on GitHub

getting users group data  Bottom

  • 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.
  • This should point you in the right direction, I think:
    http://api.zikula.or…usergetvar.php.html
  • 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?
  • 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
  • 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
  • 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
  • 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.
  • 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
  • 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

      $modversion['securityschema'] = array('Pages::Page' => 'Page name::Page ID');

      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

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