From: cajus Date: Mon, 29 May 2006 11:03:33 +0000 (+0000) Subject: Added network autodetect button X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ec41d11684518dc02c72de7d60dc38a5bb1e4c89;p=gosa.git Added network autodetect button git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3543 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_servRepositorySetup.inc b/plugins/admin/systems/class_servRepositorySetup.inc index 4b885bbd9..8fec23baa 100644 --- a/plugins/admin/systems/class_servRepositorySetup.inc +++ b/plugins/admin/systems/class_servRepositorySetup.inc @@ -166,8 +166,8 @@ class servRepositorySetup extends plugin if(!empty($cmd)){ $res = shell_exec($cmd); $res2 = trim($res); - if((!$res)){ - print_red(sprintf(_("Can't execute specified REPOSITORY_HOOK '%s' please check your gosa.conf."),$cmd)); + if(!$res){ + print_red(sprintf(_("Can't execute specified REPOSITORY_HOOK '%s'. Please check your gosa.conf."),$cmd)); }elseif(empty($res2)){ print_red(sprintf(_("The specified REPOSITORY_HOOK '%s', specified in your gosa.conf, returns an empty string."),$cmd)); }else{ diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index 06af668eb..66152454e 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -8,7 +8,8 @@ class termDNS extends plugin var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); /* attribute list for save action */ - var $ignore_account = TRUE; + var $ignore_account = true; + var $autonet = false; /* Basic informations */ @@ -44,6 +45,12 @@ class termDNS extends plugin if(isset($this->attrs['cn'][0])){ $this->OrigCn = $this->attrs['cn'][0]; + $this->cn = $this->attrs['cn'][0]; + } + + /* Do we have autonet support? */ + if (isset($this->config->data['MAIN']['AUTO_NETWORK_HOOK'])){ + $this->autonet= true; } /* Hide all dns specific code, if dns is not available @@ -115,6 +122,25 @@ class termDNS extends plugin $smarty->assign("staticAddress", ""); + /* 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]; + } + } + } + } + /* There is no dns available */ if($this->DNSenabled == false){ @@ -128,6 +154,12 @@ class termDNS extends plugin $smarty->assign($attr,$this->$attr); } $smarty->assign("staticAddress","*"); + + if ($this->autonet){ + $smarty->assign("autonet", "true"); + } else { + $smarty->assign("autonet", ""); + } $display.= $smarty->fetch(get_template_path('network.tpl', TRUE)); return($display); }else{ diff --git a/plugins/admin/systems/network.tpl b/plugins/admin/systems/network.tpl index a2188b575..2cfaf0e80 100644 --- a/plugins/admin/systems/network.tpl +++ b/plugins/admin/systems/network.tpl @@ -9,10 +9,16 @@ - + {$staticAddress} + {if $autonet==true} +   + + + {/if} {if $DNS_is_account==true}