Code

Fixed handling for new systems.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Nov 2007 08:45:59 +0000 (08:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Nov 2007 08:45:59 +0000 (08:45 +0000)
- 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

plugins/admin/systems/class_systemManagement.inc

index 4ca3ab71ae585b3ca0faea85314b06daa45c6916..77c6eb364a81306ab70508cbad81cafd843834d2 100644 (file)
@@ -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"){