Code

Fixed lock handling for FAI objects.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 14 May 2008 13:14:17 +0000 (13:14 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 14 May 2008 13:14:17 +0000 (13:14 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10897 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiManagement.inc

index 1e2ac8abdd74042ce2f6d7d98ec942d3254b33d4..e767dd0d1f34df7278fd817651b2849cdb0fb40e 100644 (file)
@@ -333,11 +333,11 @@ class faiManagement extends plugin
           msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG);
           new log("security","fai/".get_class($this),$dn,array(),"Tried to trick deletion.");
         }
-
-        /* Remove lock file after successfull deletion */
-        del_lock ($dn);
-        unset($this->dns[$key]);
       }
+
+      /* Remove lock file after successfull deletion */
+      $this->remove_lock();
+      $this->dns = array();
     }
 
 
@@ -347,10 +347,8 @@ class faiManagement extends plugin
 
     /* Remove lock */
     if(isset($_POST['delete_multiple_fai_object_cancel'])){
-      foreach($this->dns as $key => $dn){
-        del_lock ($dn);
-        unset($this->dns[$key]);
-      }
+      $this->dns = array();
+      $this->remove_lock();
     }
 
 
@@ -360,7 +358,7 @@ class faiManagement extends plugin
 
                /* Delete canceled? */
                if (isset($_POST['delete_cancel'])){
-                       del_lock ($this->dn);
+      $this->remove_lock();
                }
 
 
@@ -409,8 +407,9 @@ class faiManagement extends plugin
       }else{
         msg_dialog::display(_("Error"), sprintf(_("Cannot delete '%s': object does not exist!"), $this->dn) , ERROR_DIALOG);
       }
+
       /* Remove lock file after successfull deletion */
-      del_lock ($this->dn);
+      $this->remove_lock();
     }
 
 
@@ -850,11 +849,10 @@ class faiManagement extends plugin
      ****************/
 
                if(isset($_POST['edit_cancel'])){
-                       unset($this->dialog);
                        $this->dialog=FALSE;
                        $this->is_dialog = false;
                        session::un_set('objectinfo');
-                       del_lock ($this->dn);
+      $this->remove_lock();
                }
 
 
@@ -877,8 +875,7 @@ class faiManagement extends plugin
                                $this->dialog->save();
         FAI::save_release_changes_now();
         if (!isset($_POST['edit_apply'])){
-          del_lock ($this->dn);
-          unset($this->dialog);
+          $this->remove_lock();
           $this->dialog=FALSE;
           $this->is_dialog=false;
           session::un_set('objectinfo');
@@ -1127,6 +1124,9 @@ class faiManagement extends plugin
                if (isset($this->dn)){
                        del_lock ($this->dn);
                }
+    if(isset($this->dns) && is_array($this->dns) && count($this->dns)){
+      del_lock ($this->dns);
+    }
        }
 
        function get_type($array){