forked from extern/egroupware
minor fixes for reading group info
This commit is contained in:
parent
33a9bf669f
commit
94b6d81a37
@ -126,15 +126,12 @@
|
|||||||
|
|
||||||
if (gettype($id) == "string") { $id = $this->name2id($id); }
|
if (gettype($id) == "string") { $id = $this->name2id($id); }
|
||||||
$groups = Array();
|
$groups = Array();
|
||||||
$group_memberships = $phpgw->acl->get_location_list_for_id("phpgw_group", 1, "u", intval($id));
|
$group_memberships = $phpgw->acl->get_location_list_for_id("phpgw_group", 1, intval($id));
|
||||||
if ($group_memberships) {
|
if (!$group_memberships) { return False; }
|
||||||
for ($idx=0; $idx<count($group_memberships); $idx++){
|
for ($idx=0; $idx<count($group_memberships); $idx++){
|
||||||
$groups[intval($group_memberships[$idx])] = 1;
|
$groups[intval($group_memberships[$idx])] = 1;
|
||||||
}
|
|
||||||
return $groups;
|
|
||||||
} else {
|
|
||||||
return False;
|
|
||||||
}
|
}
|
||||||
|
return $groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
function read_group_names($lid = "")
|
function read_group_names($lid = "")
|
||||||
|
@ -67,18 +67,15 @@
|
|||||||
function sql_search($table,$owner=0)
|
function sql_search($table,$owner=0)
|
||||||
{
|
{
|
||||||
global $phpgw_info;
|
global $phpgw_info;
|
||||||
global $phpgw;
|
|
||||||
$s = "";
|
$s = "";
|
||||||
// Changed By: Skeeter 29 Nov 00
|
|
||||||
// This is to allow the user to search for other individuals group info....
|
|
||||||
if(!$owner) {
|
if(!$owner) {
|
||||||
$owner = $phpgw_info["user"]["account_id"];
|
$owner = $phpgw_info["user"]["account_id"];
|
||||||
}
|
}
|
||||||
$groups = $this->read_groups($owner);
|
$groups = $this->read_groups(intval($owner));
|
||||||
if (gettype($groups) == "array") {
|
if (gettype($groups) == "array") {
|
||||||
// echo "\n\n\n\n\ntest: " . count($groups) . "\n\n\n\n\n\n";
|
|
||||||
while ($group = each($groups)) {
|
while ($group = each($groups)) {
|
||||||
$s .= " or $table like '%," . $group[1] . ",%'";
|
$s .= " or $table like '%," . $group[0] . ",%'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $s;
|
return $s;
|
||||||
|
@ -98,14 +98,11 @@
|
|||||||
if (gettype($id) == "string") { $id = $this->name2id($id); }
|
if (gettype($id) == "string") { $id = $this->name2id($id); }
|
||||||
$groups = Array();
|
$groups = Array();
|
||||||
$group_memberships = $phpgw->acl->get_location_list_for_id("phpgw_group", 1, intval($id));
|
$group_memberships = $phpgw->acl->get_location_list_for_id("phpgw_group", 1, intval($id));
|
||||||
if ($group_memberships) {
|
if (!$group_memberships) { return False; }
|
||||||
for ($idx=0; $idx<count($group_memberships); $idx++){
|
for ($idx=0; $idx<count($group_memberships); $idx++){
|
||||||
$groups[$group_memberships[$idx]] = 1;
|
$groups[$group_memberships[$idx]] = 1;
|
||||||
}
|
|
||||||
return $groups;
|
|
||||||
} else {
|
|
||||||
return False;
|
|
||||||
}
|
}
|
||||||
|
return $groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
function read_group_names($lid = ""){
|
function read_group_names($lid = ""){
|
||||||
|
Loading…
Reference in New Issue
Block a user