Code

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

plugins/admin/fai/class_faiPartitionTable.inc
plugins/admin/fai/class_faiProfile.inc

index 50a9bb1cd63dfab112d54238721f30477a33f066..336d93180bb3f397b173c7e54e7a7463df8c1caa 100644 (file)
@@ -344,8 +344,7 @@ class faiPartitionTable extends plugin
        */
       $ldap->cd($this->dn);
       $this->cleanup();
-$ldap->modify ($this->attrs); 
-
+      $ldap->modify ($this->attrs); 
       show_ldap_error($ldap->get_error());
     }
   
@@ -374,11 +373,18 @@ $ldap->modify ($this->attrs);
       $disk_attrs['objectClass']  =  array("top","FAIclass","FAIpartitionDisk");
 
       if($disk['status']=="new"){
-        $ldap->cat($disk_dn);
+        $ldap->cat($disk_dn,array("objectClass"));
         if($ldap->count()){
           $disk['status']="edited";
         }
       }
+
+      /* Fix problem with missing objectClass "gosaAdministrativeUnitTag" for disks */
+      $ldap->cat($disk_dn,array("objectClass"));
+      $attrs = $ldap->fetch();
+      if(isset($attrs['objectClass']) && in_array_ics("gosaAdministrativeUnitTag",$attrs['objectClass'])){
+        $disk_attrs['objectClass'][] = "gosaAdministrativeUnitTag";
+      }
  
       if($disk['status'] == "delete"){
         $ldap->cd($disk_dn);
@@ -390,7 +396,6 @@ $ldap->modify ($this->attrs);
         $ldap->cd($disk_dn);
         $this->cleanup();
         $ldap->modify ($disk_attrs); 
-
       }elseif($disk['status']== "new"){
         if(empty($disk_attrs['description'])){
           unset($disk_attrs['description']);
@@ -428,7 +433,7 @@ $ldap->modify ($this->attrs);
         unset($partition_attrs['old_cn']);
 
         if($partition['status']=="new"){
-          $ldap->cat($partition_dn);
+          $ldap->cat($partition_dn,array("objectClass"));
           if($ldap->count()){
             $partition['status']="edited";
           }
@@ -438,6 +443,13 @@ $ldap->modify ($this->attrs);
           $partition_attrs['FAImountPoint']="swap";
         }
 
+        /* Fix problem with missing objectClass "gosaAdministrativeUnitTag" for partitions */
+        $ldap->cat($partition_dn,array("objectClass"));
+        $attrs = $ldap->fetch();
+        if(isset($attrs['objectClass']) && in_array_ics("gosaAdministrativeUnitTag",$attrs['objectClass'])){
+          $partition_attrs['objectClass'][] = "gosaAdministrativeUnitTag";
+        }
+
         if(($partition['status'] == "delete")&&($disk['status']!="new")){
           $ldap->cd($partition_dn);
           $ldap->rmdir_recursive($partition_dn);
index a3976d254e099afc1c05d757d3add7badb22c478..489b8bb26662c3ff02ea720cf01aa7c951029ba5 100644 (file)
@@ -412,13 +412,12 @@ class faiProfile extends plugin
 
     $this->attrs['FAIclass']=trim($this->FAIclass);
 
-    $ldap->cat($this->dn);
+    $ldap->cat($this->dn,array("objectClass"));
     if($ldap->count()!=0){
       /* Write FAIscript to ldap*/
       $ldap->cd($this->dn);
       $this->cleanup();
-$ldap->modify ($this->attrs); 
-
+      $ldap->modify ($this->attrs); 
     }else{
       /* Write FAIscript to ldap*/
       $ldap->cd($this->config->current['BASE']);