From ec7f0e4f177c1f017c8c6b2f28f83bb0adc4bf55 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 13 Jun 2006 07:43:01 +0000 Subject: [PATCH] Made snapshot stuff php4 compatible ... git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3793 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_divListSystem.inc | 56 ------------------- .../admin/systems/class_systemManagement.inc | 56 +++++++++++++++++++ 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index fd43f1cb3..7b0097267 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -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: diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index 697ec135c..b5cb92063 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -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; + } + } } -- 2.30.2