Code

Fixed lock handling for systems.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 15 May 2008 08:02:02 +0000 (08:02 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 15 May 2008 08:02:02 +0000 (08:02 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10903 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_systemManagement.inc
gosa-plugins/systems/admin/systems/main.inc

index 08a55409887d02bdf9561c05693fde23aae09060..4aaf19368a83507db37d459fe2efd444b1871518 100644 (file)
@@ -382,7 +382,7 @@ class systems extends plugin
         add_lock ($this->dn, $this->ui->dn);
       }else{ 
         msg_dialog::display(_("Error"), _("Editing this type of object is not supported yet!"), ERROR_DIALOG);
-        del_lock($this->dn);
+        $this->remove_lock();
       }
     }
 
@@ -541,7 +541,7 @@ class systems extends plugin
 
     /* Delete terminal canceled? */
     if (isset($_POST['delete_cancel']) || isset($_POST['password_cancel'])){
-      del_lock ($this->dn);
+      $this->remove_lock();
       session::un_set('objectinfo');
     }
 
@@ -724,10 +724,11 @@ class systems extends plugin
             msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG);
             new log("security","systems/".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();
       }
     }
 
@@ -737,11 +738,11 @@ class systems extends plugin
 
     /* Remove lock */
    if(isset($_POST['delete_multiple_system_cancel'])){
-      foreach($this->dns as $key => $dn){
-        del_lock ($dn);
-        unset($this->dns[$key]);
-      }
-    }
+
+     /* Remove lock file after successfull deletion */
+     $this->remove_lock();
+     $this->dns = array();
+   }
 
 
     /********************
@@ -869,7 +870,7 @@ class systems extends plugin
       }
 
       /* Remove lock file after successfull deletion */
-      del_lock ($this->dn);
+      $this->remove_lock();
     }
 
 
@@ -988,7 +989,7 @@ class systems extends plugin
         /* Terminal has been saved successfully, remove lock from LDAP. */
         if (!isset($_POST['edit_apply'])){
           if ($this->dn != "new"){
-            del_lock ($this->dn);
+            $this->remove_lock();
           }
 
           unset ($this->systab);
@@ -1015,7 +1016,7 @@ class systems extends plugin
     /* Cancel dialogs */
     if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel']) || isset($_POST['SystemTypeAborted'])){
       if (isset($this->systab)){
-        del_lock ($this->systab->dn);
+        $this->remove_lock();
         unset ($this->systab);
       }
       $this->systab= NULL;
@@ -1374,6 +1375,12 @@ class systems extends plugin
     if (isset($this->systab->dn)){
       del_lock ($this->systab->dn);
     }
+    if(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){
+      del_lock($this->dn);
+    }
+    if(isset($this->dns) && is_array($this->dns) && count($this->dns)){
+      del_lock($this->dns);
+    }
   }
 
 
index 241c8387088cd2a26fa248d8b3d159788809a075..7866fad1cfb8aed09c808c3ecc427f06685384ab 100644 (file)
@@ -24,7 +24,6 @@ if ($remove_lock){
         if(session::is_set('systems')){
                 $systems = session::get('systems');
                 $systems->remove_lock();
-                del_lock ($ui->dn);
                 session::un_set ('systems');
         }
 } else {