Code

Removed multi-objectclass dependency. There's a more easy way to do this.
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 14 Jul 2006 11:29:58 +0000 (11:29 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 14 Jul 2006 11:29:58 +0000 (11:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4160 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_acl.inc
plugins/personal/environment/class_environment.inc

index 91a5dc5695c4d65ad7a487d40d35692269b8b807..499fcc8cb2e06eff5977f57efb32a34c0571d8c8 100644 (file)
@@ -102,27 +102,12 @@ class acl extends plugin
       if (isset($acls['plDescription'])){
         /* Only feed categories */
         if (isset($acls['plDepends']['description'])){
-          if (is_array($acls['plDepends']['objectClass'])){
-            foreach($acls['plDepends']['objectClass'] as $oc){
-              $this->aclObjects[$oc]= $acls['plDepends']['description'];
-            }
-          } else {
-            $this->aclObjects[$acls['plDepends']['objectClass']]= $acls['plDepends']['description'];
-          }
+          $this->aclObjects[$acls['plDepends']['objectClass']]= $acls['plDepends']['description'];
         }
 
         /* Additionally filter the classes we're interested in in "self edit" mode */
-        if (is_array($acls['plDepends']['objectClass'])){
-          foreach($acls['plDepends']['objectClass'] as $hoc){
-            if (in_array_ics($hoc, $oc)){
-              $this->myAclObjects[$class]= $acls['plDescription'];
-              break;
-            }
-          }
-        } else {
-          if (in_array_ics($acls['plDepends']['objectClass'], $oc)){
-            $this->myAclObjects[$class]= $acls['plDescription'];
-          }
+        if (in_array_ics($acls['plDepends']['objectClass'], $oc)){
+          $this->myAclObjects[$class]= $acls['plDescription'];
         }
       }
     }
@@ -133,20 +118,12 @@ class acl extends plugin
     /* Generate mapping object */
     foreach ($plist as $oc => $pl){
       if (isset($pl['plDepends']['objectClass'])){
-        if (is_array($pl['plDepends']['objectClass'])){
-          foreach($pl['plDepends']['objectClass'] as $class){
-            if (!isset($this->ocMapping[$class])){
-              $this->ocMapping[$class]= array();
-            }
-            $this->ocMapping[$class][]= $oc;
-          }
-        } else {
-          $class= $pl['plDepends']['objectClass'];
-          if (!isset($this->ocMapping[$class])){
-            $this->ocMapping[$class]= array();
-          }
-          $this->ocMapping[$class][]= $oc;
+        $class= $pl['plDepends']['objectClass'];
+        if (!isset($this->ocMapping[$class])){
+          $this->ocMapping[$class]= array();
+          $this->ocMapping[$class][]= '0';
         }
+        $this->ocMapping[$class][]= $oc;
       }
     }
 
@@ -446,19 +423,8 @@ class acl extends plugin
       $aclObjects= array();
 
       foreach ($plist as $class => $acls){
-        if (isset($acls['plDepends']['objectClass'])){
-          if (is_array($acls['plDepends']['objectClass'])){
-            foreach($acls['plDepends']['objectClass'] as $coc){
-              if ($coc == $this->aclObject){
-                $aclObjects[$class]= $acls['plDescription'];
-                break;
-              }
-            }
-          } else {
-            if ($acls['plDepends']['objectClass'] == $this->aclObject){
-              $aclObjects[$class]= $acls['plDescription'];
-            }
-          }
+        if (isset($acls['plDepends']['objectClass']) && $acls['plDepends']['objectClass'] == $this->aclObject){
+          $aclObjects[$class]= $acls['plDescription'];
         }
       }
 
index 784fca967eea2bd6a8c485f00ffc100019d96cfc..c8a599c44e3713056d3fc1bbe62b4b41d4e4cfda 100644 (file)
@@ -1251,7 +1251,7 @@ function printOutHotPlugDevices()
   {
     return (array("plDescription"   => _("Environment settings"),
                   "plSelfModify"    => TRUE,
-                  "plDepends"       => array("objectClass" => array("gosaAccount", "posixGroup")),
+                  "plDepends"       => array("objectClass" => "gosaAccount"),
 
                   "gotoProfileServer"   => _("Profile server") ,
                   "gotoProfileFlag_L"   => "FIXME"._("Resolution changeable during session") ,  // These variable are flags