From 90633eb78eb71734805ccda2e8c6199fb1892e88 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 12 Jan 2010 07:11:18 +0000 Subject: [PATCH] Handle ARP New Devices too git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15144 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/goto/class_ArpNewDevice.inc | 8 +++--- .../admin/systems/class_systemManagement.inc | 28 ++++++++++++++++++- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc b/gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc index 4901c2fdd..534eb44ce 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc @@ -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); diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index da3ad1e12..3558878d1 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -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(""); -- 2.30.2