Code

Updated termdns
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Jun 2010 15:34:17 +0000 (15:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Jun 2010 15:34:17 +0000 (15:34 +0000)
-Updated auto completion feature form ip and mac addresses. It uses the gosa ng if available

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

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

index ccfe124651fb1a60f2387f1d14ad920fb0ebd934..7acfd33fbc0bd103f38d3fd6991ecc8f511f2cf9 100644 (file)
@@ -302,15 +302,25 @@ class termDNS extends plugin
  
     /* Check for autonet button */
     if (isset($_POST['autonet']) && ($this->acl_is_writeable("ipHostNumber") || $this->acl_is_writeable("macAddress"))){
-      $d= new gosaSupportDaemon(TRUE, 0.5);
-      $res= $d->_send("<xml><header>gosa_network_completition</header>".
-          "<source>GOSA</source><target>GOSA</target><hostname>".$this->cn."</hostname></xml>", TRUE);
-      if (isset($res['XML']['IP']) && $this->acl_is_writeable("ipHostNumber")){
-        $this->ipHostNumber= $res['XML']['IP'];
-      }
-      if (isset($res['XML']['MAC']) && $this->acl_is_writeable("macAddress")){
-        $this->macAddress= $res['XML']['MAC'];
-      }
+
+        if ($this->config->get_cfg_value("core","gosaRpcServer") != ""){
+            $rpc = $this->config->getRpcHandle();
+            $res = $rpc->networkCompletion($this->cn);
+            if(isset($res['ip']) && tests::is_ip($res['ip'])) $this->ipHostNumber= $res['ip'];
+            if(isset($res['mac']) && tests::is_mac($res['mac'])) $this->macAddress= $res['mac'];
+
+        }elseif ($config->get_cfg_value("core","gosaSupportURI") != ""){
+
+            $d= new gosaSupportDaemon(TRUE, 0.5);
+            $res= $d->_send("<xml><header>gosa_network_completition</header>".
+                    "<source>GOSA</source><target>GOSA</target><hostname>".$this->cn."</hostname></xml>", TRUE);
+            if (isset($res['XML']['IP']) && $this->acl_is_writeable("ipHostNumber")){
+                $this->ipHostNumber= $res['XML']['IP'];
+            }
+            if (isset($res['XML']['MAC']) && $this->acl_is_writeable("macAddress")){
+                $this->macAddress= $res['XML']['MAC'];
+            }
+        }
     }