authzgroups : add the groupmembers by ID

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2528 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2016-02-22 15:53:19 +00:00
parent 92a0fd8634
commit 2e64755481

View File

@@ -681,6 +681,30 @@ class authzgroups
return $res;
}
/** Return an array with all the groups where the user is in and in the module
*/
public function groupmemberReadUserByID ($module, $idgroupmember)
{
if ($this->dbGroupMember == null)
throw new Exception (dgettext ("domframework",
"DB for GroupMember is not connected"),
500);
$idgrouptmps = $this->groupRead ($module);
// Create an array with idgroup=>group
$idgroups = array ();
foreach ($idgrouptmps as $val)
$idgroups[$val["idgroup"]] = $val["group"];
$select = array ();
$select[] = array ("idgroupmember", $idgroupmember);
$idgroupmembers = $this->dbGroupMember->read ($select);
$res = array ();
foreach ($idgroupmembers as $idmembers)
{
$res[$idmembers["idgroup"]] = $idgroups[$idmembers["idgroup"]];
}
return $res;
}
/** Return an array with all the available users in the group and in the
module */
public function groupmemberReadGroup ($module, $group)