Code

Made snapshot stuff php4 compatible ...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 13 Jun 2006 07:43:01 +0000 (07:43 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 13 Jun 2006 07:43:01 +0000 (07:43 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3793 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_divListSystem.inc
plugins/admin/systems/class_systemManagement.inc

index fd43f1cb3b1d6fef00148c0c8d67208c468c99ec..7b0097267bcc4bb8fda4cfb153c77909a50ad70b 100644 (file)
@@ -230,62 +230,6 @@ class divListSystem extends MultiSelectWindow
     MultiSelectWindow :: save_object();  
 
 
-    /* check for posts */
-    $once = true;
-    foreach($_POST as $name => $value){
-
-      /* Create a new snapshot, display a dialog */
-      if(preg_match("/^CreateSnapShot_/",$name) && $once){
-        $once = false;
-        $entry = preg_replace("/^CreateSnapShot_/","",$name);
-        $entry = base64_decode(preg_replace("/_[xy]$/","",$entry));
-        $this->parent->systab = new SnapShotDialog($this->config,$entry,$this->parent); 
-      }
-
-      /* Restore a snapshot, display a dialog with all snapshots of the current object */
-      if(preg_match("/^RestoreSnapShot_/",$name) && $once){
-        $once = false;
-        $entry = preg_replace("/^RestoreSnapShot_/","",$name);
-        $entry = base64_decode(preg_replace("/_[xy]$/","",$entry));
-        $this->parent->systab = new SnapShotDialog($this->config,$entry,$this->parent); 
-        $this->parent->systab->Restore = true;
-      }
-
-      /* Restore one of the already deleted objects */
-      if(preg_match("/^RestoreDeletedSnapShot_/",$name) && $once){
-        $once = false;
-        $entry = "ou=systems,".$this->selectedBase;  
-        $this->parent->systab = new SnapShotDialog($this->config,$entry,$this->parent); 
-        $this->parent->systab->Restore      = true;
-        $this->parent->systab->DeletedOnes  = true;
-      }
-    }
-
-    /* Create a new snapshot requested, check 
-       the given attributes and create the snapshot*/
-    if(isset($_POST['CreateSnapshot'])){
-      $this->parent->systab->save_object();
-      $msgs = $this->parent->systab->check();
-      if(count($msgs)){
-        foreach($msgs as $msg){
-          print_red($msg);
-        }
-      }else{
-        $this->parent->dn =  $this->parent->systab->dn;
-        $this->parent->create_snapshot("snapshot",$this->parent->systab->CurrentDescription);
-        $this->parent->systab = NULL;
-      }
-    }
-
-    /* Restore is requested, restore the object with the posted dn .*/ 
-    if((isset($_POST['RestoreSnapshot'])) && (isset($_POST['SnapShot']))){
-      $entry =trim($_POST['SnapShot']);
-      if(!empty($entry)){    
-        $entry = base64_decode($entry);
-        $this->parent->restore_snapshot($entry);
-        $this->parent->systab = NULL;
-      }
-    }
   }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 697ec135c4cd400774d972ea7f4176d571ee9596..b5cb920631d070859799237f6b500b4f08f58cf8 100644 (file)
@@ -513,6 +513,62 @@ class systems extends plugin
   function save_object()
   {
     $this->DivListSystem->save_object();
+    /* check for posts */
+    $once = true;
+    foreach($_POST as $name => $value){
+
+      /* Create a new snapshot, display a dialog */
+      if(preg_match("/^CreateSnapShot_/",$name) && $once){
+        $once = false;
+        $entry = preg_replace("/^CreateSnapShot_/","",$name);
+        $entry = base64_decode(preg_replace("/_[xy]$/","",$entry));
+        $this->systab = new SnapShotDialog($this->config,$entry,$this); 
+      }
+
+      /* Restore a snapshot, display a dialog with all snapshots of the current object */
+      if(preg_match("/^RestoreSnapShot_/",$name) && $once){
+        $once = false;
+        $entry = preg_replace("/^RestoreSnapShot_/","",$name);
+        $entry = base64_decode(preg_replace("/_[xy]$/","",$entry));
+        $this->systab = new SnapShotDialog($this->config,$entry,$this); 
+        $this->systab->Restore = true;
+      }
+
+      /* Restore one of the already deleted objects */
+      if(preg_match("/^RestoreDeletedSnapShot_/",$name) && $once){
+        $once = false;
+        $entry = "ou=systems,".$this->selectedBase;  
+        $this->systab = new SnapShotDialog($this->config,$entry,$this); 
+        $this->systab->Restore      = true;
+        $this->systab->DeletedOnes  = true;
+      }
+    }
+
+    /* Create a new snapshot requested, check 
+       the given attributes and create the snapshot*/
+    if(isset($_POST['CreateSnapshot'])){
+      $this->systab->save_object();
+      $msgs = $this->systab->check();
+      if(count($msgs)){
+        foreach($msgs as $msg){
+          print_red($msg);
+        }
+      }else{
+        $this->dn =  $this->parent->systab->dn;
+        $this->create_snapshot("snapshot",$this->parent->systab->CurrentDescription);
+        $this->systab = NULL;
+      }
+    }
+
+    /* Restore is requested, restore the object with the posted dn .*/ 
+    if((isset($_POST['RestoreSnapshot'])) && (isset($_POST['SnapShot']))){
+      $entry =trim($_POST['SnapShot']);
+      if(!empty($entry)){
+        $entry = base64_decode($entry);
+        $this->parent->restore_snapshot($entry);
+        $this->parent->systab = NULL;
+      }
+    }
   }