Code

Updated table summary
[gosa.git] / gosa-plugins / fai / admin / fai / class_FAI.inc
index 1123681049897bb186f1f014d1405c3356808b94..b6ef2a6125cae94dd430be037d543df5d9b1cd45 100644 (file)
@@ -63,8 +63,8 @@ class FAI
       foreach($deps_to_search as $fai_base){
 
         /* Ldap search for fai classes specified in this release */
-        $attributes  = array("dn","objectClass","FAIstate","cn","FAIdiskType","FAIlvmDevice");
-        $res_tmp = get_list($filter,"fai",$fai_base,$attributes,GL_SUBSEARCH | GL_SIZELIMIT);
+        $attributes  = array("dn","objectClass","FAIstate","cn","FAIdiskType","FAIlvmDevice","FAIdiskOption");
+        $res_tmp = get_list($filter,"fai",$fai_base,$attributes,GL_SUBSEARCH);
 
         /* check the returned objects, and add/replace them in our return variable */
         foreach($res_tmp as $attr){
@@ -103,6 +103,11 @@ class FAI
             $buffer['FAIdiskType'] = "old";
           }
 
+          if(isset($attr['FAIdiskOption'])){
+            $buffer['FAIdiskOption'] = $attr['FAIdiskOption'];
+          } else {
+            $buffer['FAIdiskOption'] = null;
+          }
           if(isset($attr['FAIlvmDevice'])){
             $buffer['FAIlvmDevice'] = $attr['FAIlvmDevice'];
           }
@@ -161,7 +166,7 @@ class FAI
   {
     global $config;
 
-    if(!preg_match("/".preg_quote(get_ou('faiBaseRDN'), '/')."/",$dn)){
+    if(!preg_match("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",$dn)){
       $base = get_ou('faiBaseRDN').$dn;
     }else{
       $base = $dn;
@@ -173,7 +178,7 @@ class FAI
     $ldap->search("(objectClass=FAIbranch)",array("ou","dn"));
     while($attrs = $ldap->fetch()){
       if($appendedName){
-        $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".preg_quote(get_ou('faiBaseRDN'), '/').".*$/","",$attrs['dn']));
+        $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".preg_quote(get_ou('faiBaseRDN'), '/').".*$/i","",$attrs['dn']));
       }else{
         $res[$attrs['dn']] = $attrs['ou'][0];
       }
@@ -217,7 +222,7 @@ class FAI
 
       /* Dont't try to modify non FAIclasses  
        */
-      if(!preg_match("/[^,]+,".preg_quote(get_ou("faiBaseRDN"), '/')."/",$obj_dn)){
+      if(!preg_match("/[^,]+,".preg_quote(get_ou("faiBaseRDN"), '/')."/i",$obj_dn)){
         trigger_error("PLEASE check fai class handling in ".__LINE__." -> ".__FILE__);        
         echo "<br>-->".$Current_DN."<br>";
         echo "<br>-->".$obj_dn."<br>";
@@ -238,8 +243,7 @@ class FAI
           $classes = FAI::get_all_objects_for_given_base(FAI::get_release_dn($Current_DN),
               "(&(objectClass=FAIclass)(cn=".$cn."))"); 
 
-          /* Check if this is the last class with this name.
-           */
+          /* Check if this is the last class with this name */
           if(count($classes) == 1){
 
             /* Get all FAI Profiles 
@@ -531,6 +535,13 @@ class FAI
                */ 
               $rTag = FAI::get_release_tag(FAI::get_release_dn($key));
               $parent_attrs['FAIstate'] = $rTag;
+
+              /* FAItemplateFile can be binary, therefore it needs to be fetched with
+               * $ldap->get_attribute */
+              if (isset($parent_attrs['FAItemplateFile'])) {
+                $parent_attrs['FAItemplateFile'] = $ldap->get_attribute($parent_obj, 'FAItemplateFile');
+              }
+
               FAI::save_FAI_object($key,$parent_attrs);
             }
           }
@@ -881,12 +892,12 @@ class FAI
     $start = microtime(TRUE);
     $source_release = trim($source_release,"/");
 
-    echo "<h2>".sprintf(_("Creating group application release for %s"),$destination_name)."</h2>";
+    echo "<h3>".sprintf(_("Creating group application release for %s"),$destination_name)."</h3>";
 
     $sub_releases = array();
     $source_dn = "";
     
-    $tmp = split("\/",$source_release);
+    $tmp = explode("/",$source_release);
     foreach($tmp as $part){
       if(empty($part)){
         continue;
@@ -912,7 +923,7 @@ class FAI
     $ldap->search("(objectClass=FAIbranch)",array("ou","FAIstate"));
     while($attrs = $ldap->fetch()){
       foreach($sub_releases as $sub_rel){
-        if(preg_match("/^".preg_quote($sub_rel.get_ou('faiBaseRDN'), '/')."/",$attrs['dn'])){
+        if(preg_match("/^".preg_quote($sub_rel.get_ou('faiBaseRDN'), '/')."/i",$attrs['dn'])){
           $f_releases[$sub_rel.get_ou('faiBaseRDN')] = $attrs;
         }
       }
@@ -1049,12 +1060,12 @@ class FAI
     /* Display current action information.
      */
     if($is_first){
-      echo "<h2>".sprintf(_("Creating copy of %s"),"<i>".LDAP::fix($sourcedn)."</i>")."</h2>";
+      echo "<h3>".sprintf(_("Creating copy of %s"),"<i>".LDAP::fix($sourcedn)."</i>")."</h3>";
     }else{
       if(preg_match("/^ou=/",$sourcedn)){
         echo "<h3>"._("Processing")." <i>".LDAP::fix($destinationdn)."</i></h3>";
       }else{
-        $tmp = split(",",$sourcedn);
+        $tmp = explode(",",$sourcedn);
         echo "&nbsp;<b>"._("Object").":</b> ";
         $deststr = LDAP::fix($destinationdn);
         if(strlen($deststr) > 96){
@@ -1196,7 +1207,7 @@ class FAI
       }
     }
     if($is_first){
-      echo "<p class='seperator'>&nbsp;</p>";
+      echo "<hr>";
     }
   }