Stephan Elsner wrote:
You can get the groups user belongs to by doingYou can only list memberships for users you own. That means: you must be root, admin, the user in question, or be owner of one of the groups that the user belings to.Is it not possible to get the group of the autenticated user? I need to get it because I want to create a dynamic navigation which hide categories owned by a group the user doesn't belong to.
if ($midgard->user) { //we're authenticated
$grouplist=mgd_list_memberships($midgard->user);
if ($grouplist) { //We have valid memberships
$users_groups=array();
while ($grouplist->fetch()) {
$users_groups[$grouplist->gid]=1;
}
}
}
Now $users_groups is either undefined or contains array where each key is a group id you can check wheter user is owner for a topic but checking
if ($users_groups[$topic->owner])
/Rambo
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
