Code

Renumber $this->FAIclasses when deleting values.
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Jul 2009 08:48:09 +0000 (08:48 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Jul 2009 08:48:09 +0000 (08:48 +0000)
Avoids problem with "ghost" entries.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13924 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/fai/admin/fai/class_faiProfile.inc

index 0e46f71d5fd1e91b2981f922d98ada0cce0a931f..3daa2424d77f3ad669c546a99db65953cbea0e57 100644 (file)
@@ -237,12 +237,13 @@ class faiProfile extends plugin
       }
 
       if($s_action == "delete" && $this->acl_is_writeable("FAIclass")){
+        $newfaiclasses = array();
         foreach($this->FAIclasses as $key => $name) {
-          if ($name == $s_entry) {
-            unset($this->FAIclasses[$key]);
-            break;
+          if ($name != $s_entry) {
+            array_push($newfaiclasses, $name);
           }
         }
+        $this->FAIclasses = $newfaiclasses;
       }
 
       if($s_action == "add" && $this->acl_is_writeable("FAIclass")){