mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-11 16:38:39 +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
891fece61a
commit
6b06546565
@ -273,14 +273,18 @@ class accounts_sql
|
|||||||
*/
|
*/
|
||||||
function members($account_id)
|
function members($account_id)
|
||||||
{
|
{
|
||||||
if (!($uids = $GLOBALS['egw']->acl->get_ids_for_location($account_id, 1, 'phpgw_group')))
|
if (!is_numeric($account_id)) $account_id = $this-name2id($account_id);
|
||||||
{
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
$members = array();
|
$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);
|
//echo "accounts::members($accountid)"; _debug_array($members);
|
||||||
return $members;
|
return $members;
|
||||||
|
Loading…
Reference in New Issue
Block a user