mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-23 19:31:53 +02:00
using accounts->member(ship)s($id, true) instead of accounts->member(ship), as it does not require to read (unused) account_lid, which takes far longer and require more memory on huge installs
This commit is contained in:
parent
727bd06868
commit
04f732e653
@ -139,7 +139,7 @@ class acl
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$acl_acc_list = $GLOBALS['egw']->accounts->memberships($this->account_id,true);
|
$acl_acc_list = $GLOBALS['egw']->accounts->memberships($this->account_id, true);
|
||||||
if (is_array($no_groups)) $acl_acc_list = array_diff($acl_acc_list,$no_groups);
|
if (is_array($no_groups)) $acl_acc_list = array_diff($acl_acc_list,$no_groups);
|
||||||
array_unshift($acl_acc_list,$this->account_id);
|
array_unshift($acl_acc_list,$this->account_id);
|
||||||
}
|
}
|
||||||
@ -483,10 +483,8 @@ class acl
|
|||||||
$accounts = array($account_id);
|
$accounts = array($account_id);
|
||||||
if ($use_memberships)
|
if ($use_memberships)
|
||||||
{
|
{
|
||||||
foreach((array)$GLOBALS['egw']->accounts->membership($account_id) as $group)
|
$accounts = $GLOBALS['egw']->accounts->memberships($account_id, true);
|
||||||
{
|
$accounts[] = $account_id;
|
||||||
$accounts[] = $group['account_id'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$rights = array();
|
$rights = array();
|
||||||
foreach($this->db->select(acl::TABLE,'acl_location,acl_rights',array(
|
foreach($this->db->select(acl::TABLE,'acl_location,acl_rights',array(
|
||||||
@ -642,7 +640,7 @@ class acl
|
|||||||
$account_id = get_account_id($accountid,$this->account_id);
|
$account_id = get_account_id($accountid,$this->account_id);
|
||||||
$cache_accountid[$accountid] = $account_id;
|
$cache_accountid[$accountid] = $account_id;
|
||||||
}
|
}
|
||||||
$memberships = $GLOBALS['egw']->accounts->memberships($account_id,true);
|
$memberships = $GLOBALS['egw']->accounts->memberships($account_id, true);
|
||||||
$memberships[] = $account_id;
|
$memberships[] = $account_id;
|
||||||
|
|
||||||
$apps = false;
|
$apps = false;
|
||||||
@ -682,11 +680,9 @@ class acl
|
|||||||
$grants =& $cache[$app][$user];
|
$grants =& $cache[$app][$user];
|
||||||
if (!isset($grants))
|
if (!isset($grants))
|
||||||
{
|
{
|
||||||
$memberships = array($user);
|
$memberships = $GLOBALS['egw']->accounts->memberships($user, true);
|
||||||
foreach((array)$GLOBALS['egw']->accounts->membership($user) as $group)
|
$memberships[] = $user;
|
||||||
{
|
|
||||||
$memberships[] = $group['account_id'];
|
|
||||||
}
|
|
||||||
$grants = $accounts = Array();
|
$grants = $accounts = Array();
|
||||||
foreach($this->db->select(acl::TABLE,array('acl_account','acl_rights','acl_location'),array(
|
foreach($this->db->select(acl::TABLE,array('acl_account','acl_rights','acl_location'),array(
|
||||||
'acl_appname' => $app,
|
'acl_appname' => $app,
|
||||||
@ -708,15 +704,13 @@ class acl
|
|||||||
(!is_array($enum_group_acls) || !in_array($grantor,$enum_group_acls)))
|
(!is_array($enum_group_acls) || !in_array($grantor,$enum_group_acls)))
|
||||||
{
|
{
|
||||||
// return the grant for each member of the group
|
// return the grant for each member of the group
|
||||||
foreach((array)$GLOBALS['egw']->accounts->member($grantor) as $member)
|
foreach((array)$GLOBALS['egw']->accounts->members($grantor, true) as $grantor)
|
||||||
{
|
{
|
||||||
if (!$member) continue; // can happen if group has no members
|
if (!$grantor) continue; // can happen if group has no members
|
||||||
|
|
||||||
// Don't allow to override private with group ACL's!
|
// Don't allow to override private with group ACL's!
|
||||||
$rights &= ~EGW_ACL_PRIVATE;
|
$rights &= ~EGW_ACL_PRIVATE;
|
||||||
|
|
||||||
$grantor = $member['account_id'];
|
|
||||||
|
|
||||||
if(!isset($grants[$grantor]))
|
if(!isset($grants[$grantor]))
|
||||||
{
|
{
|
||||||
$grants[$grantor] = 0;
|
$grants[$grantor] = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user