From 04222d9c198be20b85ab0a912865792caeac6a82 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 12 Oct 2009 06:23:34 +0000 Subject: [PATCH] Calculate global addressbook permissions only once - They can't change during runtime, they are not object related. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14571 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../addons/addressbook/class_addressbook.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc b/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc index 420ce026b..a2cf3fea2 100644 --- a/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc +++ b/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc @@ -72,6 +72,7 @@ class addressbook extends plugin var $objectclasses= array("top", "person", "organizationalPerson", "inetOrgPerson"); var $abobjectclass= "dc=addressbook"; + var $globalAddressbookPermissions = ""; function addressbook (&$config, $dn= NULL) { @@ -98,6 +99,10 @@ class addressbook extends plugin } $this->ui = get_userinfo(); + $this->globalAddressbookPermissions = ""; + foreach($this->ui->get_acl_target_objects() as $path => $data){ + $this->globalAddressbookPermissions .= $this->ui->get_permissions($path,"addressbook/addressbook",$attr); + } } function execute() @@ -830,10 +835,7 @@ class addressbook extends plugin /* Use addressbook acls */ if(preg_match("/".preg_quote($this->abobjectclass, '/')."/",$dn)) { - $acls = ""; - foreach($this->ui->ACLperPath as $path => $data){ - $acls.= $this->ui->get_permissions($path,"addressbook/addressbook",$attr); - } + $acls = $this->globalAddressbookPermissions; } /* Use Organizational Person acls */ -- 2.30.2