From: hickert Date: Mon, 12 Nov 2007 08:45:59 +0000 (+0000) Subject: Fixed handling for new systems. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0bb24056170877b8411375ca52ad873d1db431df;hp=feec7760adeb4c2e682f764601e4f15fa5b1405d;p=gosa.git 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 --- 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"){