added a local instantiation of acl in memberships

This commit is contained in:
skeeter 2001-02-11 19:06:22 +00:00
parent 996f25f84e
commit 3c55ebb349

View File

@ -71,15 +71,17 @@
function members ($account_id = False) function members ($account_id = False)
{ {
global $phpgw_info, $phpgw; global $phpgw_info, $phpgw;
if ($account_id == ""){ $account_id = $phpgw_info["user"]["account_id"]; } if ($account_id == ''){ $account_id = $phpgw_info['user']['account_id']; }
elseif (gettype($account_id) == "string") { $account_id = $this->name2id($account_id); } elseif (gettype($account_id) == 'string') { $account_id = $this->name2id($account_id); }
$security_equals = Array(); $security_equals = Array();
$security_equals = $phpgw->acl->get_ids_for_location(intval($account_id), 1, "phpgw_group"); $acl = CreateObject('phpgwapi.acl');
$security_equals = $acl->get_ids_for_location(intval($account_id), 1, 'phpgw_group');
unset($acl);
if (!$security_equals) { return False; } if (!$security_equals) { return False; }
for ($idx=0; $idx<count($security_equals); $idx++){ for ($idx=0; $idx<count($security_equals); $idx++){
$name = $this->name2id($security_equals[$idx]); $name = $this->name2id($security_equals[$idx]);
$this->members[] = Array("account_id" => $security_equals[$idx], "account_name" => "$name"); $this->members[] = Array('account_id' => $security_equals[$idx], 'account_name' => "$name");
} }
return $this->members; return $this->members;
} }