From a82811fffb3225cc9704376bcd11ba6b34bba5ca Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Fri, 16 Feb 2001 02:41:38 +0000 Subject: [PATCH] Add in this file to check acl --- addressbook/inc/header.inc.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 addressbook/inc/header.inc.php diff --git a/addressbook/inc/header.inc.php b/addressbook/inc/header.inc.php new file mode 100644 index 0000000000..0428f1c730 --- /dev/null +++ b/addressbook/inc/header.inc.php @@ -0,0 +1,31 @@ +acl->get_grants('addressbook'); + + if(!isset($owner) || !$owner) { + $owner = $phpgw_info['user']['account_id']; + $rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + 16; + } else { + if($grants[$owner]) { + $rights = $grants[$owner]; + if (!($rights & PHPGW_ACL_READ)) { + $owner = $phpgw_info['user']['account_id']; + $rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + 16; + } + } + } + +?>