Code

Updated manufacturer detection
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 Jun 2010 13:03:59 +0000 (13:03 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 Jun 2010 13:03:59 +0000 (13:03 +0000)
-Do not call on each request

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

gosa-plugins/systems/admin/systems/class_termDNS.inc

index 716027dc7b5a705312edbe17372ad8b861f701c7..9c1fc70ccaf634e7876bd74ef5fb5b02764512ee 100644 (file)
@@ -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();