Code

Fixed Addressbook ACL problems
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Oct 2009 08:30:04 +0000 (08:30 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Oct 2009 08:30:04 +0000 (08:30 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14575 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 4ebac0f3389a5bef3c5d0561519053de82b1d9a6..0d2ca65113fac17039ff62942201c54cb27ceb90 100644 (file)
@@ -72,7 +72,7 @@ class addressbook extends plugin
        var $objectclasses= array("top", "person", "organizationalPerson", "inetOrgPerson");
 
        var $abobjectclass= "dc=addressbook";
-  var $globalAddressbookPermissions = "";
+  var $acl_targets_objects = array();
 
   function addressbook (&$config, $dn= NULL)
   {
@@ -99,10 +99,7 @@ class addressbook extends plugin
     }
      
     $this->ui = get_userinfo();
-    $this->globalAddressbookPermissions = "";
-    foreach($this->ui->get_acl_target_objects() as $path){
-      $this->globalAddressbookPermissions .= $this->ui->get_permissions($path,"addressbook/addressbook",$attr);
-    }
+    $this->acl_targets_objects = $this->ui->get_acl_target_objects();
   }
 
   function execute()
@@ -151,7 +148,7 @@ class addressbook extends plugin
     session::set("phonefilter", $phonefilter);
 
     /* Assign create acl */
-    $acl = $this->get_entry_acls($this->abobjectclass.",".$phonefilter['search_base']);
+    $acl = $this->get_entry_acls($this->dn);
     $smarty->assign("internal_createable", preg_match("/c/",$acl));
     $smarty->assign("internal_removeable", preg_match("/d/",$acl));
     $smarty->assign("internal_editable",   preg_match("/w/",$acl));
@@ -833,7 +830,10 @@ class addressbook extends plugin
 
       /* Use addressbook acls */
       if(preg_match("/".preg_quote($this->abobjectclass, '/')."/",$dn))  {
-        $acls = $this->globalAddressbookPermissions;
+        $acls = "";
+        foreach($this->acl_targets_objects as $path){
+          $acls .= $this->ui->get_permissions($path,"addressbook/addressbook",$attr);
+        }
       }
 
       /* Use Organizational Person acls */