mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-09 07:28:43 +01:00
Cleanup use of acl, one less db call, etc.
This commit is contained in:
parent
9d60e7f2ac
commit
b4eacadef8
@ -21,15 +21,23 @@
|
||||
|
||||
function soaddressbook()
|
||||
{
|
||||
global $phpgw,$phpgw_info,$owner;
|
||||
if(!isset($GLOBALS['owner']))
|
||||
{
|
||||
$GLOBALS['owner'] = 0;
|
||||
}
|
||||
$owner = $GLOBALS['owner'];
|
||||
|
||||
if(!isset($owner)) { $owner = 0; }
|
||||
$this->contacts = CreateObject('phpgwapi.contacts');
|
||||
$grants = $this->contacts->grants;
|
||||
/* _debug_array($GLOBALS['phpgw_info']); */
|
||||
/* _debug_array($grants); */
|
||||
|
||||
$grants = $phpgw->acl->get_grants('addressbook');
|
||||
if(!isset($owner) || !$owner)
|
||||
{
|
||||
$owner = $phpgw_info['user']['account_id'];
|
||||
$owner = $GLOBALS['phpgw_info']['user']['account_id'];
|
||||
/* echo $owner; */
|
||||
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + 16;
|
||||
/* echo $rights; */
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -38,7 +46,7 @@
|
||||
$rights = $grants[$owner];
|
||||
if (!($rights & PHPGW_ACL_READ))
|
||||
{
|
||||
$owner = $phpgw_info['user']['account_id'];
|
||||
$owner = $GLOBALS['phpgw_info']['user']['account_id'];
|
||||
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + 16;
|
||||
}
|
||||
}
|
||||
@ -46,7 +54,6 @@
|
||||
$this->rights = $rights;
|
||||
$this->grants = $grants;
|
||||
$this->owner = $owner;
|
||||
$this->contacts = CreateObject('phpgwapi.contacts');
|
||||
}
|
||||
|
||||
function read_entries($start,$offset,$qcols,$query,$qfilter,$sort,$order)
|
||||
|
Loading…
Reference in New Issue
Block a user