From: hickert Date: Thu, 13 Mar 2008 14:59:26 +0000 (+0000) Subject: msgPool X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c9df416bef93b341309964b008754b5a51adeb69;p=gosa.git msgPool git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9749 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpGroup.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpGroup.inc index e1bf7566f..ad7ed9842 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpGroup.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpGroup.inc @@ -87,10 +87,10 @@ class dhcpGroup extends dhcpPlugin /* All required fields are set? */ if ($this->cn == ""){ - $message[]= _("Required field 'Name' is not filled."); + $message[]= msgPool::required(_("Name")); } if (!preg_match('/^[a-z0-9_-]*$/i', $this->cn)){ - $message[]= _("Field 'Name' contains illegal characters."); + $message[]= msgPool::invalid(_("Name"),$this->cn,"/[a-z0-9_-]/i"); } /* cn already used? */ @@ -98,7 +98,7 @@ class dhcpGroup extends dhcpPlugin foreach($cache as $dn => $dummy){ if (preg_match("/^cn=".$this->cn.",/", $dn) && count($dummy)){ - $message[]= _("The name for this host section is already used!"); + $message[]= msgPool::duplicated(_("Name")); break; } } diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpHost.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpHost.inc index 4e0d3fdcd..87f4f247a 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpHost.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpHost.inc @@ -134,7 +134,7 @@ class dhcpHost extends dhcpPlugin /* All required fields are set? */ if ($this->cn == ""){ - $message[]= _("Required field 'Name' is not filled."); + $message[]= msgPool::required(_("Name")); } /* cn already used? */ @@ -142,7 +142,7 @@ class dhcpHost extends dhcpPlugin foreach($cache as $dn => $dummy){ if (preg_match("/^cn=".$this->cn.",/", $dn) && count($dummy)){ - $message[]= _("The name for this host section is already used!"); + $message[]= msgPool::duplicated(_("Name")); break; } } @@ -151,7 +151,7 @@ class dhcpHost extends dhcpPlugin /* Check syntax of MAC address */ $check= preg_replace('/^[^\s]*\s/', '', $this->dhcpHWAddress); if (!preg_match('/^([0-9a-fA-F]{1,2}:){5}[0-9a-fA-F]{1,2}$/', $check)){ - $message[]= _("The hardware address specified by you is not valid!"); + $message[]= msgPool::invalid(_("Hardware address")); } /* Check external plugins */ diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc index 47cd48750..1b9453542 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc @@ -39,7 +39,7 @@ class dhcpNetwork extends plugin /* Check for iteraction */ if (isset($_POST['add_dns']) && $_POST['addserver'] != ""){ if (!preg_match('/^[0-9a-z.-]+$/', get_post('addserver'))){ - msg_dialog::display(_("Error"), sprintf(_("'%s' is not a valid DNS server name!"), htmlentities(get_post('addserver'))), ERROR_DIALOG); + msg_dialog::display(_("Error"), msgPool::invalid(_("Name"),htmlentities(get_post('addserver')),"/[0-9a-z.-]/"), ERROR_DIALOG); } else { $servers= array(); if (isset($this->options['domain-name-servers'])){ diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPool.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPool.inc index f5d90af0f..40c2d7890 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPool.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPool.inc @@ -103,7 +103,7 @@ class dhcpPool extends dhcpPlugin /* All required fields are set? */ if ($this->cn == ""){ - $message[]= _("Required field 'Name' is not filled."); + $message[]= msgPool::required(_("Name")); } /* cn already used? */ @@ -111,22 +111,22 @@ class dhcpPool extends dhcpPlugin foreach($cache as $dn => $dummy){ if (preg_match("/^cn=".$this->cn.",/", $dn) && count($dummy)){ - $message[]= _("The name for this section is already used!"); + $message[]= msgPool::duplicated(_("Name")); break; } } } if ($this->dhcpRange == ""){ - $message[]= _("Required field 'Range' is not filled."); + $message[]= msgPool::required(_("Range")); } if (!tests::is_ip($this->range_start) || !tests::is_ip($this->range_stop)){ - $message[]= _("Field 'Range' contains invalid IP addresses."); + $message[]= msgPool::invalid(_("Range")); } if(!tests::is_ip_range($this->range_start,$this->range_stop)){ - $message[] = _("Field 'Range' contains invalid IP range."); + $message[]= msgPool::invalid(_("Range")); } /* Check if range is in the network */ diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpService.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpService.inc index 13c5bccd3..eb08362d7 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpService.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpService.inc @@ -137,13 +137,13 @@ class dhcpService extends dhcpPlugin $message= array(); if (!tests::is_id($this->statements['default-lease-time'])){ - $message[]= _('Default lease time needs to be numeric.'); + $message[]= msgPool::invalid(_("Lease time"),$this->statements['default-lease-time'],"/[0-9]/"); } if (!tests::is_id($this->statements['max-lease-time'])){ - $message[]= _('Maximum lease time needs to be numeric.'); + $message[]= msgPool::invalid(_("May lease time"),$this->statements['max-lease-time'],"/[0-9]/"); } if ($this->statements['default-lease-time'] > $this->statements['max-lease-time']){ - $message[]= _('Default lease time needs to smaller than the maximum lease time.'); + $message[]= msgPool::toobig(_("Default lease time"),_("Maximum lease time")); } /* Check external plugins */ diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc index 047dd27d3..c521b3048 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc @@ -142,7 +142,7 @@ class dhcpSharedNetwork extends dhcpPlugin /* All required fields are set? */ if ($this->cn == ""){ - $message[]= _("Required field 'Name' is not filled."); + $message[]= msgPool::required(_("Name")); } /* Check lease times */ @@ -151,7 +151,7 @@ class dhcpSharedNetwork extends dhcpPlugin "min-lease-time" => _("Min. lease time")) as $key => $val){ if (isset($this->statements[$key]) && $this->statements[$key] != "" && !tests::is_id($this->statements[$key])){ - $message[]= sprintf(_("The value specified as '%s' is not numeric!"), $val); + $message[]= msgPool::invalid($val,$this->statements[$key],"/[0-9]/"); } } @@ -160,7 +160,7 @@ class dhcpSharedNetwork extends dhcpPlugin foreach($cache as $dn => $dummy){ if (preg_match("/^cn=".$this->cn.",/", $dn) && count($dummy)){ - $message[]= _("The name for this host section is already used!"); + $message[]= msgPool::duplicated(_("Name")); break; } } diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSubnet.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSubnet.inc index dad9fd4dd..04b9ceb80 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSubnet.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSubnet.inc @@ -133,10 +133,10 @@ class dhcpSubnet extends dhcpPlugin /* All required fields are set? */ if ($this->cn == ""){ - $message[]= _("Required field 'Network address' is not filled."); + $message[]= msgPool::required(_("Network address")); } if ($this->dhcpNetMask == ""){ - $message[]= _("Required field 'Netmask' is not filled."); + $message[]= msgPool::required(_("Netmask")); } /* cn already used? */ @@ -144,7 +144,7 @@ class dhcpSubnet extends dhcpPlugin foreach($cache as $dn => $dummy){ if (preg_match("/^cn=".$this->cn.",/", $dn) && count($dummy)){ - $message[]= _("The name for this section is already used!"); + $message[]= msgPool::duplicated(_("Name")); break; } } @@ -153,14 +153,14 @@ class dhcpSubnet extends dhcpPlugin /* IP's? */ foreach(array('dhcpNetMask' => _("Netmask"), 'cn' => _("Network address"), 'range_start' => _("Range"), 'range_stop' => _("Range")) as $attr => $str){ if ($this->$attr != "" && !tests::is_ip($this->$attr)){ - $message[]= sprintf(_("The field '%s' contains an invalid IP address"), $str); + $message[]= msgPool::invalid($str,"","","192.168.0.23"); } } /* Check ip range */ if ($this->use_range){ if(!tests::is_ip_range($this->range_start,$this->range_stop)){ - $message[] = _("Field 'Range' contains invalid IP range."); + $message[]= msgPool::invalid(_("Network range")); } /* Check if range is in the network */ diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc index b59584a40..efca699cc 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc @@ -218,7 +218,7 @@ class servdhcp extends goService } } } else { - msg_dialog::display(_("Permission error"), _("You have no permission to remove DHCP sections!"), ERROR_DIALOG); + msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG); } $this->dialog= FALSE; } @@ -286,9 +286,6 @@ class servdhcp extends goService /* Show tab dialog headers */ if ($this->is_account){ -# $display= $this->show_header(_("Remove DHCP service"), -# _("This server has DHCP features enabled. You can disable them by clicking below.")); - if (!count($this->dhcpObjectCache)){ $attrs= array(); $attrs['dn']= 'cn=dhcp,'.$this->dn; @@ -305,9 +302,6 @@ class servdhcp extends goService } } else { -# $display= $this->show_header(_("Add DHCP service"), - -# _("This server has DHCP features disabled. You can enable them by clicking below.")); return ($display); }