From c0d1a3da0b1d856916e15ee11684f3f1c24b3793 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 19 Oct 2007 12:09:54 +0000 Subject: [PATCH] Display unkonwn Device in system Management Ensure that dns name is set. Changed label from "Display name" to "Dns name" DNS is activated as default for arp devices. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7598 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/ArpNewDevice.tpl | 2 +- plugins/admin/systems/class_ArpNewDevice.inc | 5 +++++ plugins/admin/systems/class_systemManagement.inc | 2 ++ plugins/admin/systems/class_termDNS.inc | 16 +++++++++++++++- plugins/admin/systems/network.tpl | 8 ++++++-- 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/plugins/admin/systems/ArpNewDevice.tpl b/plugins/admin/systems/ArpNewDevice.tpl index a50832630..ae15569ef 100644 --- a/plugins/admin/systems/ArpNewDevice.tpl +++ b/plugins/admin/systems/ArpNewDevice.tpl @@ -3,7 +3,7 @@ diff --git a/plugins/admin/systems/class_ArpNewDevice.inc b/plugins/admin/systems/class_ArpNewDevice.inc index 763c4e8e3..f2d7a754c 100644 --- a/plugins/admin/systems/class_ArpNewDevice.inc +++ b/plugins/admin/systems/class_ArpNewDevice.inc @@ -11,9 +11,11 @@ class ArpNewDevice extends plugin function ArpNewDevice ($config, $dn= NULL, $parent= NULL) { plugin :: plugin($config,$dn); + $this->cn =""; $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses); $this->acl = "#all#"; $this->netConfigDNS->acl = $this->acl; + $this->netConfigDNS->force_dns(); } function execute() @@ -41,6 +43,9 @@ class ArpNewDevice extends plugin { $message= plugin::check(); $message= array_merge($message, $this->netConfigDNS->check()); + if(empty($this->cn)){ + $message[] = _("Please specify a valid dns name."); + } return($message); } diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index 3e6da3dde..c9974d227 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -740,6 +740,8 @@ class systems extends plugin $add= "- "._("New terminal"); }elseif (in_array_ics('gotoWorkstation', $value['objectClass'])){ $add= "- "._("New workstation"); + }elseif (in_array_ics('GOhard', $value['objectClass']) && !in_array_ics("gotoMode",$value['objectClass'])){ + $add= "- "._("Unknown device"); }elseif (in_array_ics('GOhard', $value['objectClass'])){ $add= "- "._("New Device"); } diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index 97abc0633..acc3ba3cb 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -30,7 +30,7 @@ class termDNS extends plugin var $initial_dhcpParentNode = ""; var $initial_dhcpHostEntry = array(); var $initial_dhcp_is_Account = FALSE; - + /* DNS attributes */ @@ -39,6 +39,7 @@ class termDNS extends plugin var $DNSinitially_was_account = false; var $dnsEntry = array(); var $DNSenabled = false; + var $hide_dns_check_box = FALSE; /* Terminal dns */ @@ -310,6 +311,8 @@ class termDNS extends plugin $smarty->assign("DNSaccountACL",chkacl($this->acl,"termDNS")); $smarty->assign("DNSAccount",$this->DNS_is_account); + $smarty->assign("hide_dns_check_box",$this->hide_dns_check_box); + $smarty->assign("Zones",$this->Zones); $smarty->assign("ZoneCnt",count($this->Zones)); $smarty->assign("ZoneKeys",($this->Zones)); @@ -406,6 +409,9 @@ class termDNS extends plugin }else{ $this->DNS_is_account = false; } + if($this->hide_dns_check_box){ + $this->DNS_is_account = true; + } } } @@ -839,6 +845,14 @@ class termDNS extends plugin } return($ret); } + + function force_dns() + { + if($this->DNSenabled){ + $this->DNS_is_account = TRUE; + $this->hide_dns_check_box = TRUE; + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/network.tpl b/plugins/admin/systems/network.tpl index 58515c594..be75f65e5 100644 --- a/plugins/admin/systems/network.tpl +++ b/plugins/admin/systems/network.tpl @@ -65,7 +65,10 @@ {if $DNS_is_account==true} - {if $ZoneCnt} + {if $ZoneCnt } + + {if !$hide_dns_check_box} + {if $DNSAccount == true} {/if} {t}Enable DNS for this device{/t} - + + {/if} {if $DNSAccount == true}
{else} -- 2.30.2