From e9ae44d5e11516eb4256879fc208cf457667ea19 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 4 Jun 2010 13:03:59 +0000 Subject: [PATCH] Updated manufacturer detection -Do not call on each request git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18850 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/admin/systems/class_termDNS.inc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc index 716027dc7..9c1fc70cc 100644 --- a/gosa-plugins/systems/admin/systems/class_termDNS.inc +++ b/gosa-plugins/systems/admin/systems/class_termDNS.inc @@ -34,6 +34,10 @@ class termDNS extends plugin var $additionalHostNumbers = array(); var $macAddress = ""; // Mac address + // Used in manufacturer detection + var $last_macAddress = ""; + var $manufacturer = ""; + var $orig_ipHostNumber = ""; // IP address var $orig_macAddress = ""; // Mac address @@ -371,14 +375,15 @@ class termDNS extends plugin $smarty->assign("dhcpParentNodeCnt",count($this->dhcpParentNodes)); // Assign network card manufacturer string - $smarty->assign("macManufacturer", ""); - if ($this->config->get_cfg_value("core","gosaRpcServer") != ""){ + if ($this->config->get_cfg_value("core","gosaRpcServer") != "" && + $this->macAddress != $this->last_macAddress){ $rpc = $this->config->getRpcHandle(); $res = $rpc->getMacManufacturer($this->macAddress); if($rpc->success()){ - $smarty->assign('macManufacturer',$rpc->getMacManufacturer($this->macAddress)); + $this->manufacturer = $rpc->getMacManufacturer($this->macAddress); } } + $smarty->assign("macManufacturer", $this->manufacturer); /********** * DNS Handling @@ -516,6 +521,8 @@ class termDNS extends plugin if(isset($_POST['network_tpl_posted'])){ + $this->last_macAddress = $this->macAddress; + /* Save all posted vars */ plugin::save_object(); -- 2.30.2