Code

Removed unused classes.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Jul 2009 08:46:15 +0000 (08:46 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Jul 2009 08:46:15 +0000 (08:46 +0000)
- Added fai disk changes

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13957 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc
gosa-plugins/fai/admin/fai/class_faiLvmEntry.inc [deleted file]
gosa-plugins/fai/admin/fai/class_faiRaidEntry.inc [deleted file]
gosa-plugins/fai/admin/fai/faiLvmEntry.tpl [deleted file]

index 69253f5fe5440912a179294829788025b55646a3..c2fcfa1076f658deff44dc197723306111b5e813 100644 (file)
@@ -26,8 +26,9 @@ class faiDiskEntry extends plugin
   function faiDiskEntry (&$config, $dn= NULL,$usedDiskNames=array(),$disk=false)
   {
     plugin::plugin ($config, $dn);
-    $this->UsedAttrs  = array("cn","description","FAIpartitionType","FAIpartitionNr","FAIfsType","FAImountPoint","FAIpartitionSize",
-                         "FAImountOptions","FAIfsOptions","FAIpartitionFlags");
+    $this->UsedAttrs  = array("cn","description","FAIpartitionType",
+        "FAIpartitionNr","FAIfsType","FAImountPoint","FAIpartitionSize",
+        "FAImountOptions","FAIfsOptions","FAIpartitionFlags","FAIdiskOption");
 
     /* Default status is new */
     $this->status = "new";    
@@ -87,17 +88,23 @@ class faiDiskEntry extends plugin
         foreach($disk['FAIdiskOption'] as $option) {
           if (preg_match("/fstabkey:(device|label|uuid)/", $option)){
             $this->fstabkey= preg_replace("/^.*fstabkey:(device|label|uuid).*$/", "$1", $option);
-            break;
+            continue;
           }
           if (preg_match("/disklabel:(msdos|gpt)/", $option)){
             $this->disklabel= preg_replace("/^.*disklabel:(msdos|gpt).*$/", "$1", $option);
+            continue;
+          }
+          if (preg_match("/^bootable:/", $option)){
+            $bootable = split(",", trim(preg_replace("/^bootable:/","",$option),","));
+            foreach($bootable as $bootflag){
+              $this->partitions[$bootflag]['bootable'] = TRUE;  
+            }
             break;
           }
         }
       } else {
         $this->fstabkey= "device";
       }
-
     }
   }
 
@@ -138,7 +145,9 @@ class faiDiskEntry extends plugin
      * The number specifies the index we want to delete
      */
     foreach($_POST as $name => $value){
-      if((preg_match("/Delete_.*/",$name)) && $this->acl_is_removeable() && !preg_match("/freeze/i",$this->FAIstate)){
+      if((preg_match("/Delete_.*/",$name)) && 
+          $this->acl_is_removeable() && 
+          !preg_match("/freeze/i",$this->FAIstate)){
         $tmp = split("_",$name);
         $s_action = "remove";
         $s_entry  = $tmp[1]; 
@@ -149,7 +158,8 @@ class faiDiskEntry extends plugin
      * We must sort the index again, else we possibly got problems 
      * with partitions order.
      */
-    if($s_action == "remove" && $this->acl_is_removeable() && !preg_match("/freeze/i",$this->FAIstate)){
+    if($s_action == "remove" && $this->acl_is_removeable() && 
+        !preg_match("/freeze/i",$this->FAIstate)){
       if($this->partitions[$s_entry]['status'] == "edited"){
         $this->deletePartitions[$s_entry]= $this->partitions[$s_entry];
         $this->deletePartitions[$s_entry]['FAIpartitionNr']=$s_entry;
@@ -164,18 +174,41 @@ class faiDiskEntry extends plugin
       $this->partitions = $tmp;
     }
 
-    /* To add a partitions we only append an empty 
-     *  array to the already defined partitions.
-     */
-    if(isset($_POST['AddPartition']) && $this->acl_is_createable() && !preg_match("/freeze/i",$this->FAIstate)){
-      foreach($this->UsedAttrs as $attr){
-        $tmp[$attr]                = "";     
+
+    /* Add / Edit partitions here.
+     */    
+    foreach($_POST as $name => $value){
+      if(preg_match("/^EditPartition_/",$name)){
+        $id = preg_replace("/^EditPartition_/","",$name);
+        $id = preg_replace("/_.*$/","",$id);
+        if(isset($this->partitions[$id])){
+          $this->dialog = new faiPartition($this->config,"disk",$this->partitions[$id]);
+          break;
+        }
+      } 
+    }
+    if(isset($_POST['AddPartition']) && !preg_match("/freeze/i",$this->FAIstate)){
+      $this->dialog = new faiPartition($this->config,"disk");
+    }
+    if($this->dialog instanceOf plugin && isset($_POST['PartitionCancel'])){
+      $this->dialog = null;
+    }
+    if($this->dialog instanceOf plugin && isset($_POST['PartitionSave'])){
+      $this->dialog->save_object();
+      $attrs = $this->dialog->save();
+      if(isset($attrs['FAIpartitionNr'])){
+        $this->partitions[$attrs['FAIpartitionNr']] = $attrs;
+      }else{
+        $this->partitions[] = $attrs;
       }
-      $tmp["old_cn"]               = "";     
-      $tmp['status']="new";
-      $this->partitions[count($this->partitions)+1]=$tmp;
+      $this->dialog = null;
+    }
+    if($this->dialog instanceOf plugin){
+      $this->dialog->save_object();
+      return($this->dialog->execute());
     }
 
+
     /* $setup contains a table with the partitions. 
      */
     $smarty->assign("setup", $this->generateParts());
@@ -210,151 +243,39 @@ class faiDiskEntry extends plugin
 
     $divlist = new divSelectBox("DiskEntries"); 
     foreach($this->partitions as $key => $part){
-     
-
-      $number =array("string" => $part['FAIpartitionNr']);
-      $size   =array("string" => $part['FAIpartitionSize']);
+      $number =array(
+          "string" => $part['FAIpartitionNr'],
+          "attach" => "style='width:20px;'");
+      $size   =array(
+          "string" => $part['FAIpartitionSize'],
+          "attach" => "style='width:100px;'");
+      $fstype =array(
+          "string" => $part['FAIfsType'],
+          "attach" => "style='width:60px;'");
+      $type   =array(
+          "string" => $part['FAIpartitionType'],
+          "attach" => "style='width:80px;'");
+      $opt    =array(
+          "string" => $part['FAImountOptions'],
+          "attach" => "style='width:80px;'");
+      $fsopt  =array(
+          "string" => $part['FAIfsOptions'],
+          "attach" => "style='width:80px;'");
+      $flags  =array(
+          "string" => $part['FAIpartitionFlags'],
+          "attach" => "style='width:80px;'");
       $mntp   =array("string" => $part['FAImountPoint']);
-      $fstype =array("string" => $part['FAIfsType']);
-      $type   =array("string" => $part['FAIpartitionType']);
-      
-      $desc   =array("string" => $part['description']);
-      $opt    =array("string" => $part['FAImountOptions']);
-      $fsopt  =array("string" => $part['FAIfsOptions']);
-      $flags  =array("string" => $part['FAIpartitionFlags']);
 
-    
-      $fields = array($number,$mntp,$size,$fstype,$type);
+   
+      $action =array(
+          "string" => "<input type='image' src='images/lists/edit.png' name='EditPartition_".$key."'>",
+          "attach" => "style='width:40px;'");
+
+      $fields = array($number,$type,$mntp,$size,$fstype, $opt,$fsopt,$flags,$action);
       $divlist->AddEntry($fields);
     }
     return($divlist->DrawList());    
-
-    /* Define Arrays with allowed syntax */
-    $PartitionTypes   = array("primary"=>_("primary"),"logical"=>_("logical"));
-    $FAIfsTypes       = array("ext2","ext3","xfs","swap","reiser","dosfat16","winfat32");
-
-    /* Display Header */
-    $str = "";
-    if (count($this->partitions)){
-      $str .= "<tr>";
-      $str .= "<td><b>"._("Type")."</b></td>";
-      $str .= "<td><b>"._("FS type")."</b></td>";
-      $str .= "<td><b>"._("Mount point")."</b></td>";
-      $str .= "<td><b>"._("Size in MB")."</b></td>";
-      $str .= "<td><b>"._("Mount options")."</b></td>";
-      $str .= "<td><b>"._("FS option")."</b></td>";
-      $str .= "<td><b>"._("Preserve")."</b></td>";
-      $str .= "<td>&nbsp;</td>";
-      $str .= "</tr>";
-    }
-    
-    /* Walk through all defined partitions.
-     * Create a new row for each partition and append it to 
-     *  the header defined above.
-     * To be able to check the posts later, we append a key to each single postfield. like cn_1 ... cn_2
-     */
-    foreach($this->partitions as $key => $part){
-      
-      $dis = "";
-      if($part['FAIpartitionFlags'] == "preserve"){
-        $dis = " disabled ";
-      }
-
-      $disableALL = "";
-      if (preg_match("/freeze/", $this->FAIstate)){
-        $disableALL = " disabled ";
-      }
-
-      if($part['status']!="delete"){
-
-        /* Generate Partition select box  
-         */
-        $PartitionType = "";
-        if($this->acl_is_writeable("FAIpartitionType")){
-          $PartitionType = "<select name='FAIpartitionType_".$key."' id='FAIpartitionType_".$key."' ".$disableALL.">";
-          foreach($PartitionTypes as $type => $PTname){
-            if($part['FAIpartitionType'] == $type){
-              $PartitionType .="<option value='".$type."' selected >".$PTname."</option>";
-            }else{
-              $PartitionType .="<option value='".$type."'>".$PTname."</option>";
-            }
-          }        
-          $PartitionType.="</select>";   
-        }elseif($this->acl_is_readable("FAIpartitionType")){
-          $PartitionType = $part['FAIpartitionType'];
-        }
-
-
-        /* Generate fsType select box  
-         */
-        $FAIfsType= "";
-        if($this->acl_is_writeable("FAIfsType")){
-          $FAIfsType= "<select name='FAIfsType_".$key."' id='FAIfsType_".$key."' ".$dis." ".$disableALL.">";
-          foreach($FAIfsTypes as $type){
-            if($part['FAIfsType'] == $type){
-              $FAIfsType  .="<option value='".$type."' selected >".$type."</option>";
-            }else{
-              $FAIfsType .="<option value='".$type."'>".$type."</option>";
-            }
-          }        
-          $FAIfsType.="</select>";   
-        }elseif($this->acl_is_readable("FAIfsType")){
-          $FAIfsType = $part['FAIfsType'];
-        }
-
-        foreach(array("FAImountPoint","FAIpartitionSize","FAImountOptions","FAIfsOptions") as $attr){
-          $$attr  = "";
-          if($this->acl_is_writeable($attr)){
-            $$attr = "<input name='".$attr."_".$key."'  ".$disableALL."  ".$dis."
-                        value='".$part[$attr]."'    id='".$attr."_".$key."'>";
-
-          }elseif($this->acl_is_readable($attr)){
-            $$attr = $part[$attr];
-          }
-        }
-
-
-        $str .= "\n<tr>";
-        $str .= "\n<td>".$PartitionType."</td>";
-        $str .= "\n<td>".$FAIfsType."</td>";
-        $str .= "\n<td>".$FAImountPoint."</td>";
-        $str .= "\n<td>".$FAIpartitionSize."</td>";
-        $str .= "\n<td>".$FAImountOptions."</td>";
-        $str .= "\n<td>".$FAIfsOptions."</td>";
-
-        $changeState = "onClick=\"changeState('FAImountPoint_".$key."') ; ".
-                                 "changeState('FAIpartitionSize_".$key."') ; ".
-                                 "changeState('FAImountOptions_".$key."') ; ".
-                                 "changeState('FAIfsType_".$key."') ; ".
-                                 "changeState('FAIfsOptions_".$key."') ; \"";
-  
-        if($this->acl_is_writeable("FAIpartitionFlags")){
-          if($part['FAIpartitionFlags']!=false){
-            $str .= "\n<td><input type='checkbox' name='FAIpartitionFlags_".$key."' value='preserve' checked ".$changeState." ".$disableALL."></td>";
-          }else{
-            $str .= "\n<td><input type='checkbox' name='FAIpartitionFlags_".$key."' value='preserve' ".$changeState." ".$disableALL."></td>";
-          }
-        }else{
-          if($part['FAIpartitionFlags']!=false){
-            $str .= "<td>"._("False")."</td>";
-          }else{
-            $str .= "<td>"._("True")."</td>";
-          }
-        }
-        if($this->acl_is_removeable()){
-          $str .= "\n<td><input type='submit' name='Delete_".$key."' value='"._("Remove")."' ".$disableALL."></td>";    
-        }else{
-          $str .= "\n<td><input type='submit' name='restricted' disabled value='"._("Remove")."'></td>";    
-        }
-        $str .= "\n</tr>";    
-      }
-    }
-    
-    if(!empty($str)){
-      $str = "<table summary='' style='width:100%'>".$str."</table>";
-    }
-    return($str);
-
   }
 
   function save()
@@ -395,27 +316,6 @@ class faiDiskEntry extends plugin
   {
     if((isset($_POST['TableEntryFrameSubmitted'])) && !preg_match("/freeze/", $this->FAIstate) ){
       plugin::save_object();
-
-      foreach($this->partitions as $key => $part){
-        foreach($this->UsedAttrs as $attrs){
-
-          if($this->acl_is_writeable($attrs)){
-
-            if(isset($_POST[$attrs."_".$key])){
-              $this->partitions[$key][$attrs] = $_POST[$attrs."_".$key];
-            }else{
-              $this->partitions[$key][$attrs] = false;
-            }
-          }
-        }
-
-        /* Adapt ext3 to have -j option */
-        if ($this->partitions[$key]["FAIfsType"] == "ext3") {
-          $this->partitions[$key]["FAIfsOptions"]= preg_replace('/\s*-j\s*/', '', $this->partitions[$key]["FAIfsOptions"]);
-          $this->partitions[$key]["FAIfsOptions"]= "-j ".$this->partitions[$key]["FAIfsOptions"];
-        }
-      }
-
     }
   }
 
diff --git a/gosa-plugins/fai/admin/fai/class_faiLvmEntry.inc b/gosa-plugins/fai/admin/fai/class_faiLvmEntry.inc
deleted file mode 100644 (file)
index bc15c3d..0000000
+++ /dev/null
@@ -1,530 +0,0 @@
-<?php
-
-class faiLvmEntry extends plugin
-{
-  /* attribute list for save action */
-  var $ignore_account= TRUE;
-  var $attributes   = array("DISKcn","DISKdescription");
-  var $objectclasses= array();
-
-  var $DISKcn              = "";
-  var $DISKdescription     = "";
-  var $DISKFAIdiskOptions     = "";
-  
-  var $partitions           = array();
-  var $UsedAttrs            = array();
-  var $is_edit              = false;
-  var $old_cn               = "";
-  var $status               = "new";
-  var $deletePartitions     = array();
-  var $fstabkey             = "device";
-  var $disklabel            = "msdos";
-
-  var $FAIstate             = "";
-  var $FAIdiskType          = "lvm";
-
-  function __construct (&$config, $dn= NULL,$usedDiskNames=array(),$disk=false)
-  {
-    plugin::plugin ($config, $dn);
-    $this->UsedAttrs  = array("cn","description","FAIpartitionType",
-        "FAIpartitionNr","FAIfsType","FAImountPoint","FAIpartitionSize",
-        "FAImountOptions","FAIfsOptions","FAIpartitionFlags");
-
-    /* Default status is new */
-    $this->status = "new";    
-    /* We want to edit an entry */
-    if($disk){
-
-      /* Set disk status, eg removed. */      
-      $this->status = $disk['status'];
-
-      /* Walk through partitions */
-      foreach($disk['partitions'] as $name => $values){
-
-        /* If a partition is already marked as delete, attach it to deletePartitions only. */
-        if($values['status'] == "delete"){
-          unset($disk['partitions'][$name]);
-          $this->deletePartitions[]=$values;
-        }else{
-
-          /* Set status, to know which partition must be deleted from ldap
-             new    : Neu partition entry // save
-             edited : Update partition entry in ldap
-             deleted: Remove partition from ldap
-           */
-    
-          /* If status is not new, set to edit mode. 
-           * New means that this partition currently wasn't saved to ldap.
-           */
-          if($disk['partitions'][$name]['status']!="new"){
-            $disk['partitions'][$name]['status']="edited";
-          }
-     
-          $disk['partitions'][$name]['old_cn']= $disk['partitions'][$name]['cn'];
-          /* Assign empty attributes, if attribute is missing */
-          foreach($this->UsedAttrs as $attr){
-            if(!isset($values[$attr])){
-              $disk['partitions'][$name][$attr]="";  
-            }
-          }
-
-          if (preg_match('/^_/', $disk['partitions'][$name]['FAIfsType'])){
-            $disk['partitions'][$name]['FAIfsType']= preg_replace('/^_/', '', $disk['partitions'][$name]['FAIfsType']);
-          }
-        }
-      }
-
-      /* Set default attributes */
-      $this->DISKcn          = $disk['cn'];
-      $this->DISKdescription = $disk['description'];
-      $this->partitions      = $disk['partitions'];
-      $this->is_edit         = true;
-      $this->old_cn          = $disk['cn'];
-
-      /* Move faiDiskOption */
-      if (isset($disk['FAIdiskOption'])){
-        foreach($disk['FAIdiskOption'] as $option) {
-          if (preg_match("/fstabkey:(device|label|uuid)/", $option)){
-            $this->fstabkey= preg_replace("/^.*fstabkey:(device|label|uuid).*$/", "$1", $option);
-            break;
-          }
-          if (preg_match("/disklabel:(msdos|gpt)/", $option)){
-            $this->disklabel= preg_replace("/^.*disklabel:(msdos|gpt).*$/", "$1", $option);
-            break;
-          }
-        }
-      } else {
-        $this->fstabkey= "device";
-      }
-    }
-  }
-
-
-  function execute()
-  {
-    /* Call parent execute */
-    plugin::execute();
-
-    /* Fill templating stuff */
-    $smarty     = get_smarty();
-    $s_action   = "";
-    $s_entry    = "";
-    $display    = "";
-
-    /* Load parameters */
-    if (isset($_POST['disklabel']) && preg_match("/^(msdos|gpt)$/", $_POST['disklabel'])){
-      $this->disklabel= $_POST['disklabel'];
-    }
-    if (isset($_POST['fstabkey']) && preg_match("/^(device|label|uuid)$/", $_POST['fstabkey'])){
-      $this->fstabkey= $_POST['fstabkey'];
-    }
-    
-    /* Assign values 
-     * And Checkbox selection
-     */
-    foreach($this->attributes as $attrs){
-      $smarty->assign($attrs,$this->$attrs);
-      if($this->$attrs){
-        $smarty->assign($attrs."CHK"," ");
-      }else{
-        $smarty->assign($attrs."CHK"," disabled ");
-      }
-    }
-
-    /* Check all Posts if there is something usefull for us,
-     * For example : Delete is posted as Delete_1 
-     * The number specifies the index we want to delete
-     */
-    foreach($_POST as $name => $value){
-      if((preg_match("/Delete_.*/",$name)) && $this->acl_is_removeable() && !preg_match("/freeze/i",$this->FAIstate)){
-        $tmp = split("_",$name);
-        $s_action = "remove";
-        $s_entry  = $tmp[1]; 
-      }
-    }
-
-    /* To remove a partition we unset the index posted.
-     * We must sort the index again, else we possibly got problems 
-     * with partitions order.
-     */
-    if($s_action == "remove" && $this->acl_is_removeable() && !preg_match("/freeze/i",$this->FAIstate)){
-      if($this->partitions[$s_entry]['status'] == "edited"){
-        $this->deletePartitions[$s_entry]= $this->partitions[$s_entry];
-        $this->deletePartitions[$s_entry]['FAIpartitionNr']=$s_entry;
-        unset($this->partitions[$s_entry]);
-      }else{
-        unset($this->partitions[$s_entry]);
-      }
-      $tmp= array();
-      foreach($this->partitions as $part){
-        $tmp[count($tmp)+1]=$part;
-      }
-      $this->partitions = $tmp;
-    }
-
-    /* To add a partitions we only append an empty 
-     *  array to the already defined partitions.
-     */
-    if(isset($_POST['AddPartition']) && $this->acl_is_createable() && !preg_match("/freeze/i",$this->FAIstate)){
-      foreach($this->UsedAttrs as $attr){
-        $tmp[$attr]                = "";     
-      }
-      $tmp["old_cn"]               = "";     
-      $tmp['status']="new";
-      $this->partitions[count($this->partitions)+1]=$tmp;
-    }
-
-    /* $setup contains a table with the partitions. 
-     */
-    $smarty->assign("setup", $this->generateParts());
-    foreach($this->attributes as $attr){
-      $smarty->assign($attr,$this->$attr);
-    }
-
-    $tmp = $this->plInfo();
-    $sacl = "";
-    foreach($tmp['plProvidedAcls'] as $name => $translated){
-      $acl = $this->getacl($name, preg_match("/freeze/i",$this->FAIstate));
-      $smarty->assign($name."ACL",$acl);
-    }
-   
-    $smarty->assign("sub_object_is_createable",$this->acl_is_createable());
-    $smarty->assign("freeze",preg_match("/freeze/i",$this->FAIstate));
-
-    // Fill boxes
-    $smarty->assign("fstabkeys", array("device" => _("Device"), "label" => _("Label"), "uuid" => _("UUID")));
-    $smarty->assign("disklabels", array("msdos" => "MSDOS", "gpt" => "GPT"));
-    $smarty->assign("fstabkey", $this->fstabkey);
-    $smarty->assign("disklabel", $this->disklabel);
-
-    // Create divlist 
-    $divlist = new divSelectBox("lvmDisks");
-    $smarty->assign("clist", $this->generateParts().$divlist->DrawList());
-    /* Fetch template and show the result
-     */
-    $display.= $smarty->fetch(get_template_path('faiLvmEntry.tpl', TRUE));
-    return($display);
-  }
-
-  function generateParts()
-  {
-    /* Define Arrays with allowed syntax */
-    $PartitionTypes   = array("primary"=>_("primary"),"logical"=>_("logical"));
-    $FAIfsTypes       = array("ext2","ext3","xfs","swap","reiser","dosfat16","winfat32");
-
-    /* Display Header */
-    $str = "";
-    if (count($this->partitions)){
-      $str .= "<tr>";
-      $str .= "<td><b>"._("Type")."</b></td>";
-      $str .= "<td><b>"._("FS type")."</b></td>";
-      $str .= "<td><b>"._("Mount point")."</b></td>";
-      $str .= "<td><b>"._("Size in MB")."</b></td>";
-      $str .= "<td><b>"._("Mount options")."</b></td>";
-      $str .= "<td><b>"._("FS option")."</b></td>";
-      $str .= "<td><b>"._("Preserve")."</b></td>";
-      $str .= "<td>&nbsp;</td>";
-      $str .= "</tr>";
-    }
-    
-    /* Walk through all defined partitions.
-     * Create a new row for each partition and append it to 
-     *  the header defined above.
-     * To be able to check the posts later, we append a key to each single postfield. like cn_1 ... cn_2
-     */
-    foreach($this->partitions as $key => $part){
-      
-      $dis = "";
-      if($part['FAIpartitionFlags'] == "preserve"){
-        $dis = " disabled ";
-      }
-
-      $disableALL = "";
-      if (preg_match("/freeze/", $this->FAIstate)){
-        $disableALL = " disabled ";
-      }
-
-      if($part['status']!="delete"){
-
-        /* Generate Partition select box  
-         */
-        $PartitionType = "";
-        if($this->acl_is_writeable("FAIpartitionType")){
-          $PartitionType = "<select name='FAIpartitionType_".$key."' id='FAIpartitionType_".$key."' ".$disableALL.">";
-          foreach($PartitionTypes as $type => $PTname){
-            if($part['FAIpartitionType'] == $type){
-              $PartitionType .="<option value='".$type."' selected >".$PTname."</option>";
-            }else{
-              $PartitionType .="<option value='".$type."'>".$PTname."</option>";
-            }
-          }        
-          $PartitionType.="</select>";   
-        }elseif($this->acl_is_readable("FAIpartitionType")){
-          $PartitionType = $part['FAIpartitionType'];
-        }
-
-
-        /* Generate fsType select box  
-         */
-        $FAIfsType= "";
-        if($this->acl_is_writeable("FAIfsType")){
-          $FAIfsType= "<select name='FAIfsType_".$key."' id='FAIfsType_".$key."' ".$dis." ".$disableALL.">";
-          foreach($FAIfsTypes as $type){
-            if($part['FAIfsType'] == $type){
-              $FAIfsType  .="<option value='".$type."' selected >".$type."</option>";
-            }else{
-              $FAIfsType .="<option value='".$type."'>".$type."</option>";
-            }
-          }        
-          $FAIfsType.="</select>";   
-        }elseif($this->acl_is_readable("FAIfsType")){
-          $FAIfsType = $part['FAIfsType'];
-        }
-
-        foreach(array("FAImountPoint","FAIpartitionSize","FAImountOptions","FAIfsOptions") as $attr){
-          $$attr  = "";
-          if($this->acl_is_writeable($attr)){
-            $$attr = "<input name='".$attr."_".$key."'  ".$disableALL."  ".$dis."
-                        value='".$part[$attr]."'    id='".$attr."_".$key."'>";
-
-          }elseif($this->acl_is_readable($attr)){
-            $$attr = $part[$attr];
-          }
-        }
-
-
-        $str .= "\n<tr>";
-        $str .= "\n<td>".$PartitionType."</td>";
-        $str .= "\n<td>".$FAIfsType."</td>";
-        $str .= "\n<td>".$FAImountPoint."</td>";
-        $str .= "\n<td>".$FAIpartitionSize."</td>";
-        $str .= "\n<td>".$FAImountOptions."</td>";
-        $str .= "\n<td>".$FAIfsOptions."</td>";
-
-        $changeState = "onClick=\"changeState('FAImountPoint_".$key."') ; ".
-                                 "changeState('FAIpartitionSize_".$key."') ; ".
-                                 "changeState('FAImountOptions_".$key."') ; ".
-                                 "changeState('FAIfsType_".$key."') ; ".
-                                 "changeState('FAIfsOptions_".$key."') ; \"";
-  
-        if($this->acl_is_writeable("FAIpartitionFlags")){
-          if($part['FAIpartitionFlags']!=false){
-            $str .= "\n<td><input type='checkbox' name='FAIpartitionFlags_".$key."' value='preserve' checked ".$changeState." ".$disableALL."></td>";
-          }else{
-            $str .= "\n<td><input type='checkbox' name='FAIpartitionFlags_".$key."' value='preserve' ".$changeState." ".$disableALL."></td>";
-          }
-        }else{
-          if($part['FAIpartitionFlags']!=false){
-            $str .= "<td>"._("False")."</td>";
-          }else{
-            $str .= "<td>"._("True")."</td>";
-          }
-        }
-        if($this->acl_is_removeable()){
-          $str .= "\n<td><input type='submit' name='Delete_".$key."' value='"._("Remove")."' ".$disableALL."></td>";    
-        }else{
-          $str .= "\n<td><input type='submit' name='restricted' disabled value='"._("Remove")."'></td>";    
-        }
-        $str .= "\n</tr>";    
-      }
-    }
-    
-    if(!empty($str)){
-      $str = "<table summary='' style='width:100%'>".$str."</table>";
-    }
-    return($str);
-
-  }
-
-  function save()
-  {
-    $tmp = array();
-    $tmp['cn']          = $this->DISKcn;
-
-    /* Attach partitions */
-    foreach($this->partitions as $key=>$val) {
-      $this->partitions[$key]['FAIpartitionNr']=$key;
-    }
-
-    /* Attach deleted */
-    foreach($this->deletePartitions as $key=>$val) {
-      $this->partitions[$key."-delete"]=$val;
-      $this->partitions[$key."-delete"]['status']="delete";
-    }
-
-    $tmp['description'] = $this->DISKdescription;
-    $tmp['partitions']  = $this->partitions;
-    $tmp['status']      = $this->status;
-    $tmp['FAIdiskType'] = $this->FAIdiskType;
-
-    /* Assemble flags */
-    $tmp['FAIdiskOption'] = array("fstabkey:".$this->fstabkey, "disklabel:".$this->disklabel);
-
-    /* If hdd name has changed, tell partitionTable to rename it */
-    if(($this->is_edit)&&($this->old_cn != $this->DISKcn)){
-      $tmp['rename']['from']  = $this->old_cn;
-      $tmp['rename']['to']    = $this->DISKcn;
-    }
-    return($tmp);
-  }
-
-
-  /* Save data to object */
-  function save_object()
-  {
-    if((isset($_POST['TableEntryFrameSubmitted'])) && !preg_match("/freeze/", $this->FAIstate) ){
-      plugin::save_object();
-
-      foreach($this->partitions as $key => $part){
-        foreach($this->UsedAttrs as $attrs){
-
-          if($this->acl_is_writeable($attrs)){
-
-            if(isset($_POST[$attrs."_".$key])){
-              $this->partitions[$key][$attrs] = $_POST[$attrs."_".$key];
-            }else{
-              $this->partitions[$key][$attrs] = false;
-            }
-          }
-        }
-
-        /* Adapt ext3 to have -j option */
-        if ($this->partitions[$key]["FAIfsType"] == "ext3") {
-          $this->partitions[$key]["FAIfsOptions"]= preg_replace('/\s*-j\s*/', '', $this->partitions[$key]["FAIfsOptions"]);
-          $this->partitions[$key]["FAIfsOptions"]= "-j ".$this->partitions[$key]["FAIfsOptions"];
-        }
-      }
-
-    }
-  }
-
-
-  /* Check supplied data */
-  function check()
-  {
-    /* Call common method to give check the hook */
-    $message= plugin::check();
-  
-    /* Check for an empty disk name */
-    $d = trim($this->DISKcn);
-    if($d == "" ){
-      $message[] = msgPool::required(_("Name"));
-    }
-    if(preg_match("/[^a-z0-9_\-]/i",$d)){
-      $message[] = msgPool::invalid(_("Name"),$d,"/[a-z0-9_\-]/i");
-    }
-       
-    /* check every partition.
-     * if there is an invalid value defined, append an errorstr to message
-     */
-
-    /* Array that contain every partitionname mountpoint etc already assigned */
-    $alreadyUsed    = array();
-    foreach($this->UsedAttrs as $attrs){
-      $alreadyUsed[$attrs] = array();
-    }      
-
-    foreach($this->partitions as $key => $part){
-  
-      /* Skip all checks, if preserve is set */ 
-      if($part['FAIpartitionFlags'] == "preserve"){
-        $this->partitions[$key]['FAIfsType']        = "preserve";
-        $this->partitions[$key]['FAIpartitionSize'] = "preserve";
-        continue;
-      }
-      if($part['FAImountPoint'] != "-" && (in_array($part['FAImountPoint'],$alreadyUsed['FAImountPoint']))&&($part['FAIfsType']!="swap")){
-        $message[]=sprintf(_("Please enter a unique mount point for partition %s"),($key));
-      }
-
-      if($part['FAIfsType']!="swap" && $part['FAImountPoint'] != "-"){
-        if((empty($part['FAImountPoint']))||(!((preg_match("/^\/.*/",$part['FAImountPoint']))||(preg_match("/^swap$/",$part['FAImountPoint']))))){
-          $message[]= msgPool::invalid(sprintf(_("partition %s mount point"),$key));
-        }
-      }
-      if($part['FAIfsType'] == "swap"){
-        if(in_array($part['FAIfsType'],$alreadyUsed['FAIfsType'])){
-          $message[]=sprintf(_("File system type 'swap' is already used, change file system type for partition %s."),$key);
-        }
-      }
-      if(($part['FAIfsType'] == "swap")&&(!empty($part['FAImountPoint']))&&($part['FAImountPoint']!="swap")){
-        $message[]=_("Please use 'swap' as mount point, if 'swap' is used as fs-type.");
-      }
-
-      $tmp = split("-",$part['FAIpartitionSize']);
-      switch (count($tmp)){
-        case 0:
-                $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key));
-                break;
-        case 1:
-                if (!tests::is_id($tmp[0]) &&(!empty($tmp[1]))){
-                  $message[]=  msgPool::invalid(sprintf(_("partition %s size"),$key));
-                }
-                break;
-                
-        case 2:
-                if( !tests::is_id($tmp[0]) && !tests::is_id($tmp[1]) && !empty($tmp[1]) ){
-                  $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key));
-                }elseif(!empty($tmp[1]) && $tmp[0]>=$tmp[1]){
-                  $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key));
-                }
-                break;
-
-        default:
-                $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key));
-      }
-
-      foreach($this->UsedAttrs as $attrs){
-        $alreadyUsed[$attrs][$key] = $part[$attrs];
-      }      
-    }
-
-    $cnt = 0;
-    foreach($this->partitions as $key => $part){
-      if($part['FAIpartitionType'] == "primary"){
-        $cnt ++ ; 
-      }
-    }
-    if($cnt > 3){
-      $message[] = _("You have more than 3 primary partition table entries in your configuration, please check your configuration twice.");
-    }
-
-    return ($message);
-  }
-
-  
-
-  /* Return plugin informations for acl handling */
-  static function plInfo()
-  {
-    return (array(
-          "plShortName" => _("Partition table entry"),
-          "plDescription" => _("FAI partition table entry"),
-          "plSelfModify"  => FALSE,
-          "plDepends"     => array(),
-          "plPriority"    => 27,
-          "plSection"     => array("administration"),
-          "plCategory"    => array("fai"),
-          "plProvidedAcls" => array(
-            "DISKcn"           => _("Name"),
-            "DISKdescription"  => _("Description"),
-            "DISKFAIdiskOption"  => _("Disk options"),
-            "FAIpartitionType"  => _("Partition type"),
-            "FAIpartitionNr"    => _("Partition no."),
-            "FAIfsType"         => _("File system type"),
-            "FAImountPoint"     => _("Mount point"),
-            "FAIpartitionSize"  => _("Partition size"),
-            "FAImountOptions"   => _("Mount options"),
-            "FAIfsOptions"      => _("File system options"),
-            "FAIpartitionFlags" => _("Partition flags"))
-          ));
-  }
-
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-plugins/fai/admin/fai/class_faiRaidEntry.inc b/gosa-plugins/fai/admin/fai/class_faiRaidEntry.inc
deleted file mode 100644 (file)
index d47a583..0000000
+++ /dev/null
@@ -1,526 +0,0 @@
-<?php
-
-class faiRaidEntry extends plugin
-{
-  /* attribute list for save action */
-  var $ignore_account= TRUE;
-  var $attributes   = array("DISKcn","DISKdescription");
-  var $objectclasses= array();
-
-  var $DISKcn              = "";
-  var $DISKdescription     = "";
-  var $DISKFAIdiskOptions     = "";
-  
-  var $partitions           = array();
-  var $UsedAttrs            = array();
-  var $is_edit              = false;
-  var $old_cn               = "";
-  var $status               = "new";
-  var $deletePartitions     = array();
-  var $fstabkey             = "device";
-  var $disklabel            = "msdos";
-
-  var $FAIstate             = "";
-  var $FAIdiskType          = "raid";
-
-  function __construct (&$config, $dn= NULL,$usedDiskNames=array(),$disk=false)
-  {
-    plugin::plugin ($config, $dn);
-    $this->UsedAttrs  = array("cn","description","FAIpartitionType","FAIpartitionNr","FAIfsType","FAImountPoint","FAIpartitionSize",
-                         "FAImountOptions","FAIfsOptions","FAIpartitionFlags");
-
-    /* Default status is new */
-    $this->status = "new";    
-    /* We want to edit an entry */
-    if($disk){
-
-      /* Set disk status */      
-      $this->status = $disk['status'];
-
-      /* Walk through partitions */
-      foreach($disk['partitions'] as $name => $values){
-
-        /* If a partition is already marked as delete, attach it to deletePartitions only. */
-        if($values['status'] == "delete"){
-          unset($disk['partitions'][$name]);
-          $this->deletePartitions[]=$values;
-        }else{
-
-          /* Set status, to know which partition must be deleted from ldap
-             new    : Neu partition entry // save
-             edited : Update partition entry in ldap
-             deleted: Remove partition from ldap
-           */
-    
-          /* If status is not new, set to edit mode. 
-           * New means that this partition currently wasn't saved to ldap.
-           */
-          if($disk['partitions'][$name]['status']!="new"){
-            $disk['partitions'][$name]['status']="edited";
-          }
-     
-          $disk['partitions'][$name]['old_cn']= $disk['partitions'][$name]['cn'];
-          /* Assign empty attributes, if attribute is missing */
-          foreach($this->UsedAttrs as $attr){
-            if(!isset($values[$attr])){
-              $disk['partitions'][$name][$attr]="";  
-            }
-          }
-
-          if (preg_match('/^_/', $disk['partitions'][$name]['FAIfsType'])){
-            $disk['partitions'][$name]['FAIfsType']= preg_replace('/^_/', '', $disk['partitions'][$name]['FAIfsType']);
-          }
-        }
-      }
-
-      /* Set default attributes */
-      $this->DISKcn          = $disk['cn'];
-      $this->DISKdescription = $disk['description'];
-      $this->partitions      = $disk['partitions'];
-      $this->is_edit         = true;
-      $this->old_cn          = $disk['cn'];
-
-      /* Move faiDiskOption */
-      if (isset($disk['FAIdiskOption'])){
-        foreach($disk['FAIdiskOption'] as $option) {
-          if (preg_match("/fstabkey:(device|label|uuid)/", $option)){
-            $this->fstabkey= preg_replace("/^.*fstabkey:(device|label|uuid).*$/", "$1", $option);
-            break;
-          }
-          if (preg_match("/disklabel:(msdos|gpt)/", $option)){
-            $this->disklabel= preg_replace("/^.*disklabel:(msdos|gpt).*$/", "$1", $option);
-            break;
-          }
-        }
-      } else {
-        $this->fstabkey= "device";
-      }
-
-    }
-  }
-
-
-  function execute()
-  {
-    /* Call parent execute */
-    plugin::execute();
-
-    /* Fill templating stuff */
-    $smarty     = get_smarty();
-    $s_action   = "";
-    $s_entry    = "";
-    $display    = "";
-
-    /* Load parameters */
-    if (isset($_POST['disklabel']) && preg_match("/^(msdos|gpt)$/", $_POST['disklabel'])){
-      $this->disklabel= $_POST['disklabel'];
-    }
-    if (isset($_POST['fstabkey']) && preg_match("/^(device|label|uuid)$/", $_POST['fstabkey'])){
-      $this->fstabkey= $_POST['fstabkey'];
-    }
-    
-    /* Assign values 
-     * And Checkbox selection
-     */
-    foreach($this->attributes as $attrs){
-      $smarty->assign($attrs,$this->$attrs);
-      if($this->$attrs){
-        $smarty->assign($attrs."CHK"," ");
-      }else{
-        $smarty->assign($attrs."CHK"," disabled ");
-      }
-    }
-
-    /* Check all Posts if there is something usefull for us,
-     * For example : Delete is posted as Delete_1 
-     * The number specifies the index we want to delete
-     */
-    foreach($_POST as $name => $value){
-      if((preg_match("/Delete_.*/",$name)) && $this->acl_is_removeable() && !preg_match("/freeze/i",$this->FAIstate)){
-        $tmp = split("_",$name);
-        $s_action = "remove";
-        $s_entry  = $tmp[1]; 
-      }
-    }
-
-    /* To remove a partition we unset the index posted.
-     * We must sort the index again, else we possibly got problems 
-     * with partitions order.
-     */
-    if($s_action == "remove" && $this->acl_is_removeable() && !preg_match("/freeze/i",$this->FAIstate)){
-      if($this->partitions[$s_entry]['status'] == "edited"){
-        $this->deletePartitions[$s_entry]= $this->partitions[$s_entry];
-        $this->deletePartitions[$s_entry]['FAIpartitionNr']=$s_entry;
-        unset($this->partitions[$s_entry]);
-      }else{
-        unset($this->partitions[$s_entry]);
-      }
-      $tmp= array();
-      foreach($this->partitions as $part){
-        $tmp[count($tmp)+1]=$part;
-      }
-      $this->partitions = $tmp;
-    }
-
-    /* To add a partitions we only append an empty 
-     *  array to the already defined partitions.
-     */
-    if(isset($_POST['AddPartition']) && $this->acl_is_createable() && !preg_match("/freeze/i",$this->FAIstate)){
-      foreach($this->UsedAttrs as $attr){
-        $tmp[$attr]                = "";     
-      }
-      $tmp["old_cn"]               = "";     
-      $tmp['status']="new";
-      $this->partitions[count($this->partitions)+1]=$tmp;
-    }
-
-    /* $setup contains a table with the partitions. 
-     */
-    $smarty->assign("setup", $this->generateParts());
-    foreach($this->attributes as $attr){
-      $smarty->assign($attr,$this->$attr);
-    }
-
-    $tmp = $this->plInfo();
-    $sacl = "";
-    foreach($tmp['plProvidedAcls'] as $name => $translated){
-      $acl = $this->getacl($name, preg_match("/freeze/i",$this->FAIstate));
-      $smarty->assign($name."ACL",$acl);
-    }
-   
-    $smarty->assign("sub_object_is_createable",$this->acl_is_createable());
-    $smarty->assign("freeze",preg_match("/freeze/i",$this->FAIstate));
-
-    // Fill boxes
-    $smarty->assign("fstabkeys", array("device" => _("Device"), "label" => _("Label"), "uuid" => _("UUID")));
-    $smarty->assign("disklabels", array("msdos" => "MSDOS", "gpt" => "GPT"));
-    $smarty->assign("fstabkey", $this->fstabkey);
-    $smarty->assign("disklabel", $this->disklabel);
-    /* Fetch template and show the result
-     */
-    $display.= $smarty->fetch(get_template_path('faiDiskEntry.tpl', TRUE));
-    return($display);
-  }
-
-  function generateParts()
-  {
-    /* Define Arrays with allowed syntax */
-    $PartitionTypes   = array("primary"=>_("primary"),"logical"=>_("logical"));
-    $FAIfsTypes       = array("ext2","ext3","xfs","swap","reiser","dosfat16","winfat32");
-
-    /* Display Header */
-    $str = "";
-    if (count($this->partitions)){
-      $str .= "<tr>";
-      $str .= "<td><b>"._("Type")."</b></td>";
-      $str .= "<td><b>"._("FS type")."</b></td>";
-      $str .= "<td><b>"._("Mount point")."</b></td>";
-      $str .= "<td><b>"._("Size in MB")."</b></td>";
-      $str .= "<td><b>"._("Mount options")."</b></td>";
-      $str .= "<td><b>"._("FS option")."</b></td>";
-      $str .= "<td><b>"._("Preserve")."</b></td>";
-      $str .= "<td>&nbsp;</td>";
-      $str .= "</tr>";
-    }
-    
-    /* Walk through all defined partitions.
-     * Create a new row for each partition and append it to 
-     *  the header defined above.
-     * To be able to check the posts later, we append a key to each single postfield. like cn_1 ... cn_2
-     */
-    foreach($this->partitions as $key => $part){
-      
-      $dis = "";
-      if($part['FAIpartitionFlags'] == "preserve"){
-        $dis = " disabled ";
-      }
-
-      $disableALL = "";
-      if (preg_match("/freeze/", $this->FAIstate)){
-        $disableALL = " disabled ";
-      }
-
-      if($part['status']!="delete"){
-
-        /* Generate Partition select box  
-         */
-        $PartitionType = "";
-        if($this->acl_is_writeable("FAIpartitionType")){
-          $PartitionType = "<select name='FAIpartitionType_".$key."' id='FAIpartitionType_".$key."' ".$disableALL.">";
-          foreach($PartitionTypes as $type => $PTname){
-            if($part['FAIpartitionType'] == $type){
-              $PartitionType .="<option value='".$type."' selected >".$PTname."</option>";
-            }else{
-              $PartitionType .="<option value='".$type."'>".$PTname."</option>";
-            }
-          }        
-          $PartitionType.="</select>";   
-        }elseif($this->acl_is_readable("FAIpartitionType")){
-          $PartitionType = $part['FAIpartitionType'];
-        }
-
-
-        /* Generate fsType select box  
-         */
-        $FAIfsType= "";
-        if($this->acl_is_writeable("FAIfsType")){
-          $FAIfsType= "<select name='FAIfsType_".$key."' id='FAIfsType_".$key."' ".$dis." ".$disableALL.">";
-          foreach($FAIfsTypes as $type){
-            if($part['FAIfsType'] == $type){
-              $FAIfsType  .="<option value='".$type."' selected >".$type."</option>";
-            }else{
-              $FAIfsType .="<option value='".$type."'>".$type."</option>";
-            }
-          }        
-          $FAIfsType.="</select>";   
-        }elseif($this->acl_is_readable("FAIfsType")){
-          $FAIfsType = $part['FAIfsType'];
-        }
-
-        foreach(array("FAImountPoint","FAIpartitionSize","FAImountOptions","FAIfsOptions") as $attr){
-          $$attr  = "";
-          if($this->acl_is_writeable($attr)){
-            $$attr = "<input name='".$attr."_".$key."'  ".$disableALL."  ".$dis."
-                        value='".$part[$attr]."'    id='".$attr."_".$key."'>";
-
-          }elseif($this->acl_is_readable($attr)){
-            $$attr = $part[$attr];
-          }
-        }
-
-
-        $str .= "\n<tr>";
-        $str .= "\n<td>".$PartitionType."</td>";
-        $str .= "\n<td>".$FAIfsType."</td>";
-        $str .= "\n<td>".$FAImountPoint."</td>";
-        $str .= "\n<td>".$FAIpartitionSize."</td>";
-        $str .= "\n<td>".$FAImountOptions."</td>";
-        $str .= "\n<td>".$FAIfsOptions."</td>";
-
-        $changeState = "onClick=\"changeState('FAImountPoint_".$key."') ; ".
-                                 "changeState('FAIpartitionSize_".$key."') ; ".
-                                 "changeState('FAImountOptions_".$key."') ; ".
-                                 "changeState('FAIfsType_".$key."') ; ".
-                                 "changeState('FAIfsOptions_".$key."') ; \"";
-  
-        if($this->acl_is_writeable("FAIpartitionFlags")){
-          if($part['FAIpartitionFlags']!=false){
-            $str .= "\n<td><input type='checkbox' name='FAIpartitionFlags_".$key."' value='preserve' checked ".$changeState." ".$disableALL."></td>";
-          }else{
-            $str .= "\n<td><input type='checkbox' name='FAIpartitionFlags_".$key."' value='preserve' ".$changeState." ".$disableALL."></td>";
-          }
-        }else{
-          if($part['FAIpartitionFlags']!=false){
-            $str .= "<td>"._("False")."</td>";
-          }else{
-            $str .= "<td>"._("True")."</td>";
-          }
-        }
-        if($this->acl_is_removeable()){
-          $str .= "\n<td><input type='submit' name='Delete_".$key."' value='"._("Remove")."' ".$disableALL."></td>";    
-        }else{
-          $str .= "\n<td><input type='submit' name='restricted' disabled value='"._("Remove")."'></td>";    
-        }
-        $str .= "\n</tr>";    
-      }
-    }
-    
-    if(!empty($str)){
-      $str = "<table summary='' style='width:100%'>".$str."</table>";
-    }
-    return($str);
-
-  }
-
-  function save()
-  {
-    $tmp = array();
-    $tmp['cn']          = $this->DISKcn;
-
-    /* Attach partitions */
-    foreach($this->partitions as $key=>$val) {
-      $this->partitions[$key]['FAIpartitionNr']=$key;
-    }
-
-    /* Attach deleted */
-    foreach($this->deletePartitions as $key=>$val) {
-      $this->partitions[$key."-delete"]=$val;
-      $this->partitions[$key."-delete"]['status']="delete";
-    }
-
-    $tmp['description'] = $this->DISKdescription;
-    $tmp['partitions']  = $this->partitions;
-    $tmp['status']      = $this->status;
-    $tmp['FAIdiskType'] = $this->FAIdiskType;
-
-    /* Assemble flags */
-    $tmp['FAIdiskOption'] = array("fstabkey:".$this->fstabkey, "disklabel:".$this->disklabel);
-
-    /* If hdd name has changed, tell partitionTable to rename it */
-    if(($this->is_edit)&&($this->old_cn != $this->DISKcn)){
-      $tmp['rename']['from']  = $this->old_cn;
-      $tmp['rename']['to']    = $this->DISKcn;
-    }
-    return($tmp);
-  }
-
-
-  /* Save data to object */
-  function save_object()
-  {
-    if((isset($_POST['TableEntryFrameSubmitted'])) && !preg_match("/freeze/", $this->FAIstate) ){
-      plugin::save_object();
-
-      foreach($this->partitions as $key => $part){
-        foreach($this->UsedAttrs as $attrs){
-
-          if($this->acl_is_writeable($attrs)){
-
-            if(isset($_POST[$attrs."_".$key])){
-              $this->partitions[$key][$attrs] = $_POST[$attrs."_".$key];
-            }else{
-              $this->partitions[$key][$attrs] = false;
-            }
-          }
-        }
-
-        /* Adapt ext3 to have -j option */
-        if ($this->partitions[$key]["FAIfsType"] == "ext3") {
-          $this->partitions[$key]["FAIfsOptions"]= preg_replace('/\s*-j\s*/', '', $this->partitions[$key]["FAIfsOptions"]);
-          $this->partitions[$key]["FAIfsOptions"]= "-j ".$this->partitions[$key]["FAIfsOptions"];
-        }
-      }
-
-    }
-  }
-
-
-  /* Check supplied data */
-  function check()
-  {
-    /* Call common method to give check the hook */
-    $message= plugin::check();
-  
-    /* Check for an empty disk name */
-    $d = trim($this->DISKcn);
-    if($d == "" ){
-      $message[] = msgPool::required(_("Name"));
-    }
-    if(preg_match("/[^a-z0-9_\-]/i",$d)){
-      $message[] = msgPool::invalid(_("Name"),$d,"/[a-z0-9_\-]/i");
-    }
-       
-    /* check every partition.
-     * if there is an invalid value defined, append an errorstr to message
-     */
-
-    /* Array that contain every partitionname mountpoint etc already assigned */
-    $alreadyUsed    = array();
-    foreach($this->UsedAttrs as $attrs){
-      $alreadyUsed[$attrs] = array();
-    }      
-
-    foreach($this->partitions as $key => $part){
-  
-      /* Skip all checks, if preserve is set */ 
-      if($part['FAIpartitionFlags'] == "preserve"){
-        $this->partitions[$key]['FAIfsType']        = "preserve";
-        $this->partitions[$key]['FAIpartitionSize'] = "preserve";
-        continue;
-      }
-      if($part['FAImountPoint'] != "-" && (in_array($part['FAImountPoint'],$alreadyUsed['FAImountPoint']))&&($part['FAIfsType']!="swap")){
-        $message[]=sprintf(_("Please enter a unique mount point for partition %s"),($key));
-      }
-
-      if($part['FAIfsType']!="swap" && $part['FAImountPoint'] != "-"){
-        if((empty($part['FAImountPoint']))||(!((preg_match("/^\/.*/",$part['FAImountPoint']))||(preg_match("/^swap$/",$part['FAImountPoint']))))){
-          $message[]= msgPool::invalid(sprintf(_("partition %s mount point"),$key));
-        }
-      }
-      if($part['FAIfsType'] == "swap"){
-        if(in_array($part['FAIfsType'],$alreadyUsed['FAIfsType'])){
-          $message[]=sprintf(_("File system type 'swap' is already used, change file system type for partition %s."),$key);
-        }
-      }
-      if(($part['FAIfsType'] == "swap")&&(!empty($part['FAImountPoint']))&&($part['FAImountPoint']!="swap")){
-        $message[]=_("Please use 'swap' as mount point, if 'swap' is used as fs-type.");
-      }
-
-      $tmp = split("-",$part['FAIpartitionSize']);
-      switch (count($tmp)){
-        case 0:
-                $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key));
-                break;
-        case 1:
-                if (!tests::is_id($tmp[0]) &&(!empty($tmp[1]))){
-                  $message[]=  msgPool::invalid(sprintf(_("partition %s size"),$key));
-                }
-                break;
-                
-        case 2:
-                if( !tests::is_id($tmp[0]) && !tests::is_id($tmp[1]) && !empty($tmp[1]) ){
-                  $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key));
-                }elseif(!empty($tmp[1]) && $tmp[0]>=$tmp[1]){
-                  $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key));
-                }
-                break;
-
-        default:
-                $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key));
-      }
-
-      foreach($this->UsedAttrs as $attrs){
-        $alreadyUsed[$attrs][$key] = $part[$attrs];
-      }      
-    }
-
-    $cnt = 0;
-    foreach($this->partitions as $key => $part){
-      if($part['FAIpartitionType'] == "primary"){
-        $cnt ++ ; 
-      }
-    }
-    if($cnt > 3){
-      $message[] = _("You have more than 3 primary partition table entries in your configuration, please check your configuration twice.");
-    }
-
-    return ($message);
-  }
-
-  
-
-  /* Return plugin informations for acl handling */
-  static function plInfo()
-  {
-    return (array(
-          "plShortName" => _("Partition table entry"),
-          "plDescription" => _("FAI partition table entry"),
-          "plSelfModify"  => FALSE,
-          "plDepends"     => array(),
-          "plPriority"    => 27,
-          "plSection"     => array("administration"),
-          "plCategory"    => array("fai"),
-          "plProvidedAcls" => array(
-            "DISKcn"           => _("Name"),
-            "DISKdescription"  => _("Description"),
-            "DISKFAIdiskOption"  => _("Disk options"),
-            "FAIpartitionType"  => _("Partition type"),
-            "FAIpartitionNr"    => _("Partition no."),
-            "FAIfsType"         => _("File system type"),
-            "FAImountPoint"     => _("Mount point"),
-            "FAIpartitionSize"  => _("Partition size"),
-            "FAImountOptions"   => _("Mount options"),
-            "FAIfsOptions"      => _("File system options"),
-            "FAIpartitionFlags" => _("Partition flags"))
-          ));
-  }
-
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-plugins/fai/admin/fai/faiLvmEntry.tpl b/gosa-plugins/fai/admin/fai/faiLvmEntry.tpl
deleted file mode 100644 (file)
index 36783fb..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<input type="hidden" name="LvmFrameSubmitted" value="1">
-
-<h2>
-  <img class="center" alt="" src="plugins/fai/images/fai_partitionTable.png" 
-    align="middle" title="{t}Generic{/t}">&nbsp;{t}Device{/t}
-</h2>
-<table style='width:100%' summary="">
-       <tr>
-               <td style='width:50%;border-right:1px solid #909090;'>
-
-      <table>
-        <tr>
-          <td>
-            <LABEL for="DISKcn">{t}Name{/t}</LABEL>{$must}&nbsp;
-          </td>
-          <td>
-{render acl=$DISKcnACL}
-            <input value="{$DISKcn}" size="45" maxlength="80" name="DISKcn" id="DISKcn">
-{/render}
-                     </td>
-        </tr>
-        <tr>
-                     <td>
-            <LABEL for="fstabkey">{t}FSTAB key{/t}</LABEL>
-          </td>
-          <td>
-{render acl=$DISKFAIdiskOptionACL}
-            <select name="fstabkey" size="1">
-               {html_options options=$fstabkeys selected=$fstabkey}
-            </select>
-{/render}
-                   </td>
-        </tr>
-      </table>
-    </td>
-               <td style='vertical-align:top;'>
-      <table>
-        <tr>
-          <td>
-            <LABEL for="DISKdescription">&nbsp;{t}Description{/t}</LABEL>&nbsp;
-          </td>
-          <td>
-{render acl=$DISKdescriptionACL}
-                             <input value="{$DISKdescription}" size="45" maxlength="80" 
-              name="DISKdescription" id="DISKdescription">
-{/render}
-                     </td>
-        </tr>
-      </table>
-    </td>
-       </tr>
-</table>
-<br>
-<p class="seperator">&nbsp;</p>
-<h2>{t}Combined partitions{/t}</h2>
-
-{$clist}
-
-<br>
-<p class="seperator">&nbsp;</p>
-<br>
-
-<div style="align:right;" align="right">
-{if !$freeze}
-       <input type="submit" name="SaveDisk" value="{msgPool type=saveButton}">
-{/if}
-<input type="submit" name="CancelDisk" value="{msgPool type=cancelButton}" >
-</div>
-<!-- Place cursor -->
-<script language="JavaScript" type="text/javascript">
-  <!-- // First input field on page
-       focus_field('DISK_cn');
-  -->
-</script>
-