From a063e95e6a1e33c48ca144f34a8e734189440f4f Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 4 Mar 2008 10:04:20 +0000 Subject: [PATCH] Updates git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9299 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_baseSelectDialog.inc | 20 ++++++++ .../admin/systems/class_componentGeneric.inc | 35 ++++++++++---- .../admin/systems/class_divListSystem.inc | 20 ++++++++ .../systems/class_divListSystemService.inc | 20 ++++++++ .../admin/systems/class_servGeneric.inc | 31 ++++++++---- .../admin/systems/class_serverService.inc | 25 ++++++++-- .../admin/systems/class_systemManagement.inc | 34 ++++++------- .../systems/admin/systems/class_termDNS.inc | 48 ++++++++++++++----- gosa-plugins/systems/admin/systems/main.inc | 36 +++++++------- .../admin/systems/tabs_arpnewdevice.inc | 20 ++++++++ .../systems/admin/systems/tabs_component.inc | 20 ++++++++ .../systems/admin/systems/tabs_server.inc | 20 ++++++++ 12 files changed, 260 insertions(+), 69 deletions(-) diff --git a/gosa-plugins/systems/admin/systems/class_baseSelectDialog.inc b/gosa-plugins/systems/admin/systems/class_baseSelectDialog.inc index 04275e0de..74d3cf24b 100644 --- a/gosa-plugins/systems/admin/systems/class_baseSelectDialog.inc +++ b/gosa-plugins/systems/admin/systems/class_baseSelectDialog.inc @@ -1,4 +1,24 @@ "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* Generic terminal attributes */ var $interfaces= array(); var $ignore_account= TRUE; @@ -183,20 +198,20 @@ class componentGeneric extends plugin $this->dn= "cn=".$this->cn.",".get_ou('componentou').$this->base; if ($this->cn == "" ){ - $message[]= _("The required field 'Component name' is not set."); + $message[]= msgPool::required(_("Component name")); } /* Check if given name is a valid host/dns name */ if(!tests::is_dns_name($this->cn)){ - $message[] = _("Please specify a valid name for this object."); + $message[]= msgPool::invalid(_("Component name"), $this->cn, "/[a-z0-9\.\-]/i"); } /* To check for valid ip*/ if($this->netConfigDNS->ipHostNumber == ""){ - $message[]= _("The required field IP address is empty."); + $message[]= msgPool::required(_("IP address")); } else { if (!tests::is_ip($this->netConfigDNS->ipHostNumber)){ - $message[]= _("The field IP address contains an invalid address."); + $message[]= msgPool::invalid(_("IP address"), "", "", "192.168.1.2"); } } @@ -210,7 +225,7 @@ class componentGeneric extends plugin continue; } if ($attrs['dn'] != $this->orig_dn){ - $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn); + $message[]= msgPool::duplicated(_("Component name")); break; } } diff --git a/gosa-plugins/systems/admin/systems/class_divListSystem.inc b/gosa-plugins/systems/admin/systems/class_divListSystem.inc index 5c5a9703f..d99b291ea 100644 --- a/gosa-plugins/systems/admin/systems/class_divListSystem.inc +++ b/gosa-plugins/systems/admin/systems/class_divListSystem.inc @@ -1,4 +1,24 @@ "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* Generic terminal attributes */ var $ignore_account= TRUE; var $interfaces= array(); @@ -323,12 +338,12 @@ class servgeneric extends plugin /* must: cn */ if ($this->cn == ""){ - $message[]= _("The required field 'Server name' is not set."); + msgPool::required(_("Server name")); } /* Check if given name is a valid host/dns name */ if(!tests::is_dns_name($this->cn)){ - $message[] = _("Please specify a valid name for this object."); + $message[]= msgPool::invalid(_("Server name"), $this->cn, "/[a-z0-9\.\-]/i"); } if ($this->orig_dn != $this->dn){ @@ -339,7 +354,7 @@ class servgeneric extends plugin while ($attrs= $ldap->fetch()){ if ($attrs['dn'] != $this->orig_dn){ if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,".get_ou('incomingou')."/",$attrs['dn']) && preg_match("/,".get_ou('serverou')."/",$attrs['dn'])){ - $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn); + $message[]= msgPool::duplicated(_("Server name")); break; } } diff --git a/gosa-plugins/systems/admin/systems/class_serverService.inc b/gosa-plugins/systems/admin/systems/class_serverService.inc index e3a344890..c984753b7 100644 --- a/gosa-plugins/systems/admin/systems/class_serverService.inc +++ b/gosa-plugins/systems/admin/systems/class_serverService.inc @@ -1,4 +1,24 @@ "Config object" , "dn"=>"Object dn"); - /* attribute list for save action */ var $ignore_account = TRUE; var $attributes = array(); diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index 066503860..e5d66afcc 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -1,21 +1,23 @@ dhcpEnabled && $this->dhcp_is_Account && $this->dhcpParentNode != "" && count($this->dhcpHostEntry) == 0){ +# if($this->dhcpEnabled && $this->dhcp_is_Account && $this->dhcpParentNode != "" && count($this->dhcpHostEntry) == 0){ # $message[] =_("You have not configured your dhcp settings yet."); - } +# } /* Check if mac and ip are already used */ if(!empty($this->ipHostNumber) && $this->DNS_is_account && $this->ipHostNumber != $this->orig_ipHostNumber && in_array("ip:".$this->ipHostNumber,$this->used_ip_mac)){ - $message[] =_("The specified IP address is already in use."); + $message[]= msgPool::duplicated(_("IP address")); } if(!empty($this->macAddress) && $this->dhcp_is_Account && $this->macAddress != $this->orig_macAddress && in_array("mac:".$this->macAddress,$this->used_ip_mac)){ - print_red(sprintf(_("The specified MAC address '%s' for this system '%s' is already in use."),$this->macAddress,$this->cn)); + $message[]= msgPool::duplicated(_("MAC address")); } /* Check if ip must be given */ if(($this->IPisMust)||($this->DNS_is_account)){ if (empty($this->ipHostNumber)){ - $message[]= _("The required field 'IP-address' is not set."); + $message[]= msgPool::required(_("IP address")); } if (!tests::is_ip($this->ipHostNumber)){ - $message[]= _("Wrong IP format in field IP-address."); + $message[]= msgPool::invalid(_("IP address"), "", "", "192.168.1.10"); } } /* Check if mac is empty */ if ($this->macAddress == "" ){ - $message[]= _("The required field 'MAC-address' is not set."); + $message[]= msgPool::required(_("IP address")); } if(!tests::is_mac($this->macAddress)){ - $message[]=(_("The given macaddress is invalid. There must be 6 2byte segments seperated by ':'.")); + $message[]= msgPool::invalid(_("MAC address"), "", "", "00:0C:7F:31:33:F1"); } /* only perfrom this checks if this is a valid DNS account */ @@ -535,7 +555,7 @@ class termDNS extends plugin $tmp2 = $tmp[$this->dnsEntry['zoneName']]; if(!$this->netmaskIsCoherent($tmp2)){ //this->dnsEntry['zoneName'])){ $tmp2 = preg_replace("/^.*\//","",$tmp2); - $message[] =sprintf(_("The specified IP address '%s' is not matching the selected reverse zone entry '%s'."),$this->ipHostNumber,$tmp2); + $message[] =sprintf(_("The IP address '%s' is not part of the selected reverse zone '%s'!"),$this->ipHostNumber,$tmp2); } /* Walk through all entries and detect duplicates or mismatches @@ -547,7 +567,7 @@ class termDNS extends plugin if(!isset($checkArray[$values['type']][$values['value']])){ $checkArray[$values['type']][$values['value']] = 0; }else{ - $message[] = sprintf(_("Found duplicate value for record type '%s'."),$values['type']); + $message[] = sprintf(_("Record type '%s' is duplicated!"),$values['type']); } /* Check if given entries in $onlyOnce are used more than once @@ -555,7 +575,7 @@ class termDNS extends plugin if(isset($onlyOnce[$values['type']])){ $onlyOnce[$values['type']] ++; if($onlyOnce[$values['type']] > 1){ - $message[] = sprintf(_("Found more than one entry for the uniqe record type '%s'."),$values['type']); + $message[] = sprintf(_("Uniq record type '%s' is duplicated!"),$values['type']); } } @@ -566,14 +586,16 @@ class termDNS extends plugin /* Check if there is an aRecord defined which uses the same IP as used in IPhostAddress */ if(($values['type'] == "aRecord")&&($values['value'] == $this->ipHostNumber)){ - $message[]=sprintf(_("The device IP '%s' is added as 'A Record', this will be done automatically, please remove the record."), + #TODO: Where's the problem here? + $message[]=sprintf(_("The IP address '%s' will is added as 'A Record', this will be done automatically, please remove the record."), $this->ipHostNumber); } /* only lower-case is allowed in record entries ... */ if($values['value'] != strtolower($values['value'])){ - $message[] = sprintf(_("Only lowercase is allowed, please check your '%ss'."),$values['type']); + #TODO: What's in values['value']? Something for a propper message? + $message[] = sprintf(_("Only lowercase records are allowed, please check your '%ss'."),$values['type']); } } } diff --git a/gosa-plugins/systems/admin/systems/main.inc b/gosa-plugins/systems/admin/systems/main.inc index a43df0999..2eaf67921 100644 --- a/gosa-plugins/systems/admin/systems/main.inc +++ b/gosa-plugins/systems/admin/systems/main.inc @@ -1,22 +1,24 @@