Code

Handle ARP New Devices too
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 12 Jan 2010 07:11:18 +0000 (07:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 12 Jan 2010 07:11:18 +0000 (07:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15144 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc
gosa-plugins/systems/admin/systems/class_systemManagement.inc

index 4901c2fddd75d48dd7dee0d26db90d8d03b44698..534eb44ce70761980e6caf0d9bb7eb4ae0ca0df2 100644 (file)
@@ -12,7 +12,7 @@ class ArpNewDevice extends plugin
   var $SystemTypes       = array();
 
   var $ObjectGroup    = "none";
-  var $SystemType     = "workstation";
+  var $SystemType     = "gotoWorkstation";
 
   var $gotoIntegration = FALSE;
 
@@ -35,9 +35,9 @@ class ArpNewDevice extends plugin
     asort($tmp, SORT_LOCALE_STRING);
     $this->ObjectGroups= $tmp;
 
-    $this->SystemTypes =array("workstation"=>_("Workstation"), "terminal"=>_("Terminal"), "server"=>_("Server"));
+    $this->SystemTypes =array("gotoWorkstation"=>_("Workstation"), "gotoTermminal"=>_("Terminal"), "goServer"=>_("Server"));
     if(class_available("opsi")){
-      $this->SystemTypes["opsi_client"]= _("Windows workstation");
+      $this->SystemTypes["FAKE_OC_OpsiHost"]= _("Windows workstation");
     }
   }
 
@@ -58,7 +58,7 @@ class ArpNewDevice extends plugin
     }
     $this->netConfigDNS->cn= $this->cn;
 
-    $map = array("workstation" => "W","terminal" => "T","server" => "S", "opsi_client" => "O");
+    $map = array("gotoWorkstation" => "W","gotoTerminal" => "T","goServer" => "S", "FAKE_OC_OpsiHost" => "O");
     $smarty->assign("netconfig", $this->netConfigDNS->execute());
     $smarty->assign("ogroups", $tmp[$map[$this->SystemType]]);
     $smarty->assign("SystemTypes"     ,$this->SystemTypes);
index da3ad1e127755719999fa55d3349b9b3111922a6..3558878d19bef7843804e0e8125ce0e8d9f8f586 100644 (file)
@@ -515,10 +515,15 @@ class systemManagement extends management
       reset($this->activationQueue);
       $dn = key($this->activationQueue);
       $data= $this->activationQueue[$dn];
+      unset($this->activationQueue[$dn]);
 
+      // Validate the given system type.
       if(!isset($data['SS'])) continue;
-
       $sysType = $data['SS'];
+      if(!isset($pInfo[$sysType])){
+        trigger_error('Unknown type \''.$sysType.'\'!');
+        continue;
+      }
       $type = $pInfo[$sysType];
 
       // Get target type definition 
@@ -630,6 +635,27 @@ class systemManagement extends management
 
   protected function saveChanges()
   {
+  
+    // Handle 'New Unknown Devices' here.
+    if($this->tabObject instanceOf ArpNewDeviceTabs){
+      $this->tabObject->save_object();
+
+      if($this->tabObject->by_object['ArpNewDevice']->gotoIntegration){
+        $message = $this->tabObject->check();
+        if(count($message)){
+          msg_dialog::displayChecks($message);
+        }else{
+          $this->tabObject->save();
+          $this->activationQueue[$this->tabObject->dn]=array();
+          $this->closeDialogs();
+          $this->systemTypeChosen();
+        
+        }
+        return;
+      }
+    }
+
+    //
     $str = management::saveChanges();
     if($this->tabObject) return("");