Login
Donate to Zikula
Options
Group checker - v1.0
Author: Mumuri
Zikula Version: Zikula 1.0.0
Type: Xanthia
Description:
This small plugin allows you to display a specific content to the user of a given group. Usually; you can do that by adding permissions to the given group, and using a smarty to check the permission, but this can't be done in some cases.
For instance, if there is no permissions for the content you wan't to display or if you wan't to display specific icons to a given groups (that was i ve done on top flood).
Quick setup
<!--[checkgroup gid="1" ]-->
do some stuff
<!--[/checkgroup]-->
the gid parameter is the id from the given group, you can find this id in the group module (index.php?module=Groupes&type=admin)
Why did you use an ID and not the group name ?
the GID was chosen over the group name, because it would have require one more SQL query. The only solution to avoid that was to use adodb cache system and i don't have time for that for the moment. Notes that all the information are already in the user interface, you don't have to use your phpMyAdmin to connect to the database and see the ids... André Bergues
Support Information:
support in the comment, but i guess you won't have problems with the doc
Change Log:
Comments
Many thanks! Will need this in the future.
Hi,
would be nice, if we could choose more than 1 group (example gid="1,2"), that are able to see the content.
Martin
would be nice, if we could choose more than 1 group (example gid="1,2"), that are able to see the content.
Martin
@mdee24: It's far easier to use the normal permissions for that. There's a pnsecauthaction-block plugin that you can use and you can make up some permissions and give that to as many groups as you like:
So if you have 2 groups that should see this, you can give them the according permissions:
group1 | myStuff:: | :: | read
group2 | myStuff:: | :: | read
group3 | myStuff:: | :: | none
Group 3 is not allowed to see that.
Notice: "myStuff" can be anything - it doesn't have to be coded in a module.
Code
<!--[pnsecauthaction_block component='myStuff::' instance='::' level=ACCESS_READ]-->
do some stuff now we have permission
<!--[/pnsecauthaction_block]-->
do some stuff now we have permission
<!--[/pnsecauthaction_block]-->
So if you have 2 groups that should see this, you can give them the according permissions:
group1 | myStuff:: | :: | read
group2 | myStuff:: | :: | read
group3 | myStuff:: | :: | none
Group 3 is not allowed to see that.
Notice: "myStuff" can be anything - it doesn't have to be coded in a module.
mdee24 eventually you can patch the module and send me an mp for me to upgrade the zip, you credits will add
kafferring, in some case, it's far easier to simply use the group to do that, for instance, you have a link or icon that you want to display to admin, but not to moderator...
kafferring, in some case, it's far easier to simply use the group to do that, for instance, you have a link or icon that you want to display to admin, but not to moderator...

Comment by:
mumuri
16 Jun 2008 - 07:32AM