Code

Updated opsi generic
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 28 Sep 2009 06:23:41 +0000 (06:23 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 28 Sep 2009 06:23:41 +0000 (06:23 +0000)
-Do not save anything while we haven't read all data from the gosa-si.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14358 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc

index 52c4ed89f2433ec20f802e8168c7e04cb5126c59..22476bae9b9ed3890dfc3fe4b79927ff34698126 100644 (file)
@@ -234,6 +234,13 @@ class opsiGeneric extends plugin
    */
   public function check()
   {
+  
+    // In case of initialization problem, we do not save anything.
+    // We can skip checks here, the date isn't usable.
+    if($this->init_failed){ 
+      return;
+    };
+
     $messages = plugin::check();
     $messages= array_merge($messages, $this->netConfigDNS->check());
 
@@ -403,6 +410,9 @@ class opsiGeneric extends plugin
    */
   public function save()
   {
+    if($this->init_failed){ 
+      return;
+    }
     
     /* Check if we have to create a new opsi client
         or just have to save client modifications.
@@ -567,6 +577,9 @@ class opsiGeneric extends plugin
    */  
   public function remove_from_parent()
   {
+    if($this->init_failed){ 
+      return;
+    }
     $this->netConfigDNS->remove_from_parent();
 
     $this->opsi->del_client($this->hostId);