mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:04 +01:00
accounts_sql::members() use single sql query with join to acl table instead calling id2name for each account, as it is quicker and uses less memory
This commit is contained in:
parent
04f732e653
commit
dea7e46a2d
@ -274,14 +274,18 @@ class accounts_sql
|
||||
*/
|
||||
function members($account_id)
|
||||
{
|
||||
if (!($uids = $GLOBALS['egw']->acl->get_ids_for_location($account_id, 1, 'phpgw_group')))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
if (!is_numeric($account_id)) $account_id = $this-name2id($account_id);
|
||||
|
||||
$members = array();
|
||||
foreach ($uids as $uid)
|
||||
foreach($this->db->select($this->table, 'account_id,account_lid',
|
||||
$this->db->expression(acl::TABLE, array(
|
||||
'acl_appname' => 'phpgw_group',
|
||||
'acl_location' => $account_id,
|
||||
)), __LINE__, __FILE__, false,
|
||||
'JOIN '.acl::TABLE.' ON account_id=acl_owner'
|
||||
) as $row)
|
||||
{
|
||||
$members[$uid] = $this->id2name($uid);
|
||||
$members[$row['account_id']] = $row['account_lid'];
|
||||
}
|
||||
//echo "accounts::members($accountid)"; _debug_array($members);
|
||||
return $members;
|
||||
|
Loading…
Reference in New Issue
Block a user