$members = $GLOBAL[‘egw’]->accounts->members(‘xyz’,true);
if (in_array($GLOBALS[‘egw_info’][‘user’][‘account_id’],$members))
{
// code if current user is a member of group ‘xyz’
}
or
$memberships = $GLOBAL[‘egw’]->accounts->memberships(
$GLOBALS[‘egw_info’][‘user’][‘account_id’]);
if (in_array($group_name,$memberships))
{
// code if current user is a member of group $group_name
}
Ralf
srini46 schrieb:
Hello I have an application which would use a “group-application” type of
ACL. That means, all the users in that group would be able to access that
application, while others would not be able to. Now I have created a dummy
group and added a few users to that group.
Now I would do this
if(user is from that group)
{
echo ‘welcome to app’;
}
else
{
header(’…/index.php’);
}
So I am unable to understand how to get to check if the logged in user is
part of a group. I can create a reference object for phpgwapi.accounts class
and retreive account data using get_account_data method, how do I find if
this user is part of my group??
All account-data of the current user is available via
$GLOBALS[‘egw’][‘user’] (does NOT contain memberships).
Ralf
Ralf Becker
Director Software Development
Stylite GmbH
[open style of IT]
Morschheimer Strasse 15
67292 Kirchheimbolanden
fon +49 (0) 6352 70629-0
fax +49 (0) 6352 70629-30
mailto: rb@stylite.de
www.stylite.de
www.egroupware.org
Geschäftsführer Andre Keller,
Gudrun Müller, Ralf Becker
Registergericht Kaiserslautern HRB 30575
Umsatzsteuer-Id / VAT-Id: DE214280951
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers