From 0bb24056170877b8411375ca52ad873d1db431df Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 12 Nov 2007 08:45:59 +0000 Subject: [PATCH] Fixed handling for new systems. - Add the system to the selected objectGroup first. - Then save the system as selected system type. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7766 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_systemManagement.inc | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index 4ca3ab71a..77c6eb364 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -507,21 +507,6 @@ class systems extends plugin /* Save, or display error message? */ if (count($message) == 0){ - /* Save terminal data to ldap */ - if(isset($_SESSION['SelectedSystemType']['ogroup']) && $_SESSION['SelectedSystemType']['ogroup'] != 'none'){ - foreach (array("workservice", "termservice") as $cls){ - if (isset($this->systab->by_object[$cls])){ - $this->systab->by_object[$cls]->gotoXMouseport= ""; - $this->systab->by_object[$cls]->gotoXMouseType= ""; - $this->systab->by_object[$cls]->gotoXResolution= ""; - $this->systab->by_object[$cls]->gotoXColordepth= ""; - } - } - } - - $this->systab->save(); - gosa_log ("System object'".$this->dn."' has been saved"); - /* Incoming behavior; you can select a system type and an ogroup membership. * If this object is an Incoming object, $_SESSION['SelectedSystemType'] isset. * Check if we must add the new object to an object group. @@ -540,6 +525,24 @@ class systems extends plugin $og->save(); } } + } + + /* Save terminal data to ldap */ + if(isset($_SESSION['SelectedSystemType']['ogroup']) && $_SESSION['SelectedSystemType']['ogroup'] != 'none'){ + foreach (array("workservice", "termservice") as $cls){ + if (isset($this->systab->by_object[$cls])){ + $this->systab->by_object[$cls]->gotoXMouseport= ""; + $this->systab->by_object[$cls]->gotoXMouseType= ""; + $this->systab->by_object[$cls]->gotoXResolution= ""; + $this->systab->by_object[$cls]->gotoXColordepth= ""; + } + } + } + + $this->systab->save(); + gosa_log ("System object'".$this->dn."' has been saved"); + + if(isset($_SESSION['SelectedSystemType'])){ if(!isset($ldap)){ $ldap = $this->config->get_ldap_link(); } @@ -552,6 +555,7 @@ class systems extends plugin $ldap->cd($this->config->current['BASE']); } + /* Terminal has been saved successfully, remove lock from LDAP. */ if ($this->dn != "new"){ -- 2.30.2