Code

Added fix from stable.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Nov 2007 08:53:23 +0000 (08:53 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Nov 2007 08:53:23 +0000 (08:53 +0000)
Not tested yet.

- Add new objects to object group first, then save.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7767 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_systemManagement.inc

index 4b8198c4a51eaad307fe37d0f5c316131f1abfd4..42addca64d541877bcd6990828c8a43e07ef35e4 100644 (file)
@@ -736,20 +736,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();
-
         /* 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.
@@ -761,7 +747,6 @@ class systems extends plugin
 
         if(isset($_SESSION['SelectedSystemType'])){
           $SelectedSystemType= $_SESSION['SelectedSystemType'];
-          unset($_SESSION['SelectedSystemType']);
           if($SelectedSystemType['ogroup'] != "none"){
             $og = new ogroup($this->config,$SelectedSystemType['ogroup']);
             if($og){
@@ -769,6 +754,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();
+
+        if(isset($_SESSION['SelectedSystemType'])){
+          unset($_SESSION['SelectedSystemType']);
           if(!isset($ldap)){
             $ldap = $this->config->get_ldap_link();
           }