Code

Removed auto_network_hook
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Feb 2008 16:59:49 +0000 (16:59 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Feb 2008 16:59:49 +0000 (16:59 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8969 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index a231665c480e3c71f115c149b8c6ab7dab26e75e..81dcc4eccc95e1b86fdea2e681813a218bf4b934 100644 (file)
@@ -4,7 +4,6 @@ class termDNS extends plugin
 {
   /* attribute list for save action */
   var $ignore_account = true;
-  var $autonet        = false;
 
   /* Basic informations 
    */
@@ -87,16 +86,6 @@ class termDNS extends plugin
     }
 
 
-    /************
-     * Autonetwork hook 
-     ************/
-    /* Do we have autonet support? */
-    if (isset($this->config->data['MAIN']['AUTO_NETWORK_HOOK'])){
-      $this->autonet= true;
-    }
-
-
     /************
      * DNS
      ************/
@@ -211,25 +200,17 @@ class termDNS extends plugin
     $display= "";
 
     $smarty->assign("staticAddress", ""); 
-    $smarty->assign("autonet", $this->autonet);
  
     /* Check for autonet button */
-    if ($this->autonet && isset($_POST['autonet'])){
-      $cmd= $this->config->data['MAIN']['AUTO_NETWORK_HOOK'];
-      if(!empty($cmd) && $this->cn != ""){
-        $res = shell_exec($cmd." ".$this->cn);
-        if(!$res){
-          print_red(sprintf(_("Can't execute specified AUTO_NETWORK_HOOK '%s'. Please check your gosa.conf."),$cmd));
-        } else {
-          $res= split(';', trim($res));
-          if (isset($res[0]) && $res[0] != ""){
-            $this->ipHostNumber= $res[0];
-          }
-          if (isset($res[1]) && $res[1] != ""){
-            $this->macAddress= $res[1];
-          }
-        }
-      }
+    if (isset($_POST['autonet'])){
+       $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->ipHostNumber= $res['XML']['IP'];
+       }
+       if (isset($res['XML']['MAC'])){
+               $this->macAddress= $res['XML']['MAC'];
+       }
     }
     
   
index 1685ee88d272ffaccd3d5834abca870219e4aa01..d2461a82504bd9e6eae3f1f5215aba76c5f663af 100644 (file)
@@ -26,9 +26,7 @@
 {render acl=$macAddressACL}
             <input     name="macAddress"       id="macAddress" size=25 maxlength=80    value="{$macAddress}">
 {/render}
-            {if $autonet==true}
-                                           <input type="submit" name="autonet" value="{t}Autodetect{/t}">
-            {/if}
+           <input type="submit" name="autonet" value="{t}Autodetect{/t}">
           </td>
                                </tr>
         {if $dhcpEnabled}