Code

Calculate global addressbook permissions only once - They can't change during runtime...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Oct 2009 06:23:34 +0000 (06:23 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Oct 2009 06:23:34 +0000 (06:23 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14571 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc

index 420ce026b600f1a2014a6b67a5ce779ba7303029..a2cf3fea2b3c6c895b2eb4735eb470071afc299c 100644 (file)
@@ -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 */