summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9c7a292)
raw | patch | inline | side by side (parent: 9c7a292)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 18 Jul 2008 12:16:07 +0000 (12:16 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 18 Jul 2008 12:16:07 +0000 (12:16 +0000) |
-Object handling is now cow
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11713 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11713 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc | patch | blob | history |
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
index 1beba24fe3f7ce9fd4729e4e80d4c2a266265d0b..878c4833ac63626843e0c9d607c9ab6ef2ce1b2f 100644 (file)
var $attributes = array("cn","description");
var $objectclasses = array("top","FAIclass","FAIpartitionTable");
- var $subAttributes = array("cn","description","FAIpartitionNr");
+ var $subAttributes = array("cn","description");
+ var $subPartAttributes = array("cn","FAIpartitionNr","FAIpartitionSize","FAImountPoint","FAIfsType","FAIpartitionType","FAImountOptions","FAIfsOptions","FAIpartitionFlags","description");
+
var $sub64coded = array();
var $subBinary = array();
/* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry)
*/
- $res = FAI::get_all_objects_for_given_base($this->dn,"(&(objectClass=FAIclass)(objectClass=FAIpartitionTable))");
+ $res = FAI::get_all_objects_for_given_base($this->dn,"(&(objectClass=FAIclass)(objectClass=FAIpartitionDisk))");
foreach($res as $obj){
+
+ /* Skip not relevant objects */
+ if(!preg_match("/".normalizePreg($this->dn)."$/i",$obj['dn'])) continue;
+
$objects = array();
+ $objects['description'] = "";
$objects['status'] = "edited";
$objects['dn'] = $obj['dn'];
$objects = $this->get_object_attributes($objects,$this->subAttributes);
$this->disks[$objects['cn']] = $objects;
+ $this->disks[$objects['cn']]['partitions'] = array();
}
/* read all partitions for each disk
*/
foreach($this->disks as $name => $disk){
-
$res = FAI::get_all_objects_for_given_base($disk['dn'],"(&(objectClass=FAIclass)(objectClass=FAIpartitionEntry))");
foreach($res as $obj){
+
+ /* Skip not relevant objects */
+ if(!preg_match("/".normalizePreg($disk['dn'])."$/i",$obj['dn'])) continue;
+
$objects = array();
$objects['status'] = "edited";
$objects['dn'] = $obj['dn'];
- $objects = $this->get_object_attributes($objects,$this->subAttributes);
- $this->disks[$name]['partitions'][$objects['cn']] = $objects;
+ $objects = $this->get_object_attributes($objects,$this->subPartAttributes);
+ unset($objects['dn']);;
+ $this->disks[$name]['partitions'][$objects['FAIpartitionNr']] = $objects;
}
}
}
+
$this->is_new = FALSE;
if($this->dn == "new"){
$this->is_new =TRUE;
/* Call parent execute */
plugin::execute();
- print_a($this->disks);
-
if($this->is_account && !$this->view_logged){
$this->view_logged = TRUE;
new log("view","fai/".get_class($this),$this->dn);
$disk_dn = "cn=".$disk['cn'].",".$this->dn;
$disk_attrs['cn'] = $disk['cn'];
$disk_attrs['description'] = $disk['description'];
+
+ if(empty($disk_attrs['description']) && $disk['status'] == "edited"){
+ $disk_attrs['description'] = array();
+ }
+
$disk_attrs['objectClass'] = array("top","FAIclass","FAIpartitionDisk");
if($disk['status']=="new"){
$partition_attrs['FAImountPoint']="swap";
}
- /* Tag object */
- $this->tag_attrs($partition_attrs, $partition_dn, $this->gosaUnitTag);
+ /* Tag object */
+ $this->tag_attrs($partition_attrs, $partition_dn, $this->gosaUnitTag);
if($partition['status'] == "delete"){
FAI::prepare_to_save_FAI_object($partition_dn,array(),true);