Code

Added "gosaAdministrativeUnitTag" fix for Hooks / Scripts
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 May 2006 09:04:03 +0000 (09:04 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 May 2006 09:04:03 +0000 (09:04 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3262 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiHook.inc
plugins/admin/fai/class_faiScript.inc

index 4caa9d0e2b3aeabbb7adf92029309fab7aab301e..dcef17f8f14db1ff255fbc9867dcb7dd0eff13f6 100644 (file)
@@ -429,12 +429,12 @@ class faiHook extends plugin
       if($obj['status']=="new"){
         $ldap->cat($sub_dn,array("objectClass"));
         if($ldap->count()){
-          $obj['status']="modify";
+          $obj['status']="edited";
         }
       }
 
       /* Check if gosaAdministrativeUnitTag is required as object class */
-      if($obj['status'] == "modify"){
+      if($obj['status'] == "edited"){
         $ldap->cat($sub_dn,array("objectClass"));
         $attrs = $ldap->fetch();
         if(isset($attrs['objectClass'])){
index c614aa04c8d9e32eeaed08ca6bff74c915eb0a4e..798f63946b8a4bd7dbf153a439f2c308cab01f92 100644 (file)
@@ -336,7 +336,7 @@ class faiScript extends plugin
 
     $ldap = $this->config->get_ldap_link();
 
-    $ldap->cat($this->dn);
+    $ldap->cat($this->dn,array("objectClass"));
     if($ldap->count()!=0){
       /* Write FAIscript to ldap*/
       $ldap->cd($this->dn);
@@ -396,9 +396,9 @@ class faiScript extends plugin
       $sub_dn = "cn=".$obj['cn'].",".$this->dn;
 
       if($obj['status']=="new"){
-        $ldap->cat($sub_dn);
+        $ldap->cat($sub_dn,array("objectClass"));
         if($ldap->count()){
-          $obj['status']="modify";
+          $obj['status']="edited";
         }
       }
 
@@ -406,6 +406,17 @@ class faiScript extends plugin
         $tmp['FAIpriority']  ="0";
       }
 
+      /* Check if gosaAdministrativeUnitTag is required as object class */
+      if($obj['status'] == "edited"){
+        $ldap->cat($sub_dn,array("objectClass"));
+        $attrs = $ldap->fetch();
+        if(isset($attrs['objectClass'])){
+          if(in_array_ics("gosaAdministrativeUnitTag",$attrs['objectClass'])){
+            $tmp['objectClass'][] = "gosaAdministrativeUnitTag";
+          }
+        }
+      }
+
       if($obj['status'] == "delete"){
         $ldap->cd($sub_dn);
         $ldap->rmdir_recursive($sub_dn);