summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: abbed32)
raw | patch | inline | side by side (parent: abbed32)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 Aug 2009 08:20:32 +0000 (08:20 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 Aug 2009 08:20:32 +0000 (08:20 +0000) |
-Added some cleanup after successful save/aplly
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14019 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14019 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 b5b8937d234869c1b0a9c234f3ba7b19132406fd..213e9db8cfafe89ce504c8fc46628edc1866e877 100644 (file)
/* Append all disks to ldap */
foreach($order as $cn=>$disk){
+
$disk_dn = "cn=".$disk['cn'].",".$this->dn;
$disk_attrs['cn'] = $disk['cn'];
$disk_attrs['objectClass'] = array("top","FAIclass","FAIpartitionDisk");
if($disk['status'] == "delete"){
FAI::prepare_to_save_FAI_object($disk_dn,array(),true);
$this->handle_post_events("remove");
+ unset($this->disks[$cn]);
}elseif($disk['status'] == "edited"){
FAI::prepare_to_save_FAI_object($disk_dn,$disk_attrs);
$this->handle_post_events("modify");
if($disk['status']!="delete")
/* Add all partitions */
- foreach($disk['partitions'] as $key => $partition){
+ foreach($disk['partitions'] as $pkey => $partition){
$partition_attrs = array();
foreach($partition as $key => $value){
if($partition['status'] == "delete"){
FAI::prepare_to_save_FAI_object($partition_dn,array(),true);
$this->handle_post_events("remove");
+ unset($this->disks[$cn]['partitions'][$pkey]);
}elseif($partition['status'] == "edited"){
FAI::prepare_to_save_FAI_object($partition_dn,$partition_attrs);
$this->handle_post_events("modify");
FAI::prepare_to_save_FAI_object($partition_dn,$partition_attrs);
$this->handle_post_events("add");
}
+
+ // We do not need the status flag any longer
+ if(isset($this->disks[$cn]['partitions'][$pkey]['status'])){
+ unset($this->disks[$cn]['partitions'][$pkey]['status']);
+ }
+ }
+ // We do not need the status flag any longer
+ if(isset($this->disks[$cn]['status'])){
+ unset($this->disks[$cn]['status']);
}
}
+ $this->initial_disks = $this->disks;
+ print_a($this->disks);
$this->handle_post_events("add");
}