summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f5c81c7)
raw | patch | inline | side by side (parent: f5c81c7)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 13 Mar 2008 14:59:26 +0000 (14:59 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 13 Mar 2008 14:59:26 +0000 (14:59 +0000) |
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 e1bf7566fafe97228454b20cf846c0f19af3c502..ad7ed984263a09df28ff0c2cda2a96e8d51e12ca 100644 (file)
/* 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? */
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 4e0d3fdcd1d25e1afde42ba42b3ec5fd6dea01e2..87f4f247abb362aa0118bd658747defef2587426 100644 (file)
/* All required fields are set? */
if ($this->cn == ""){
- $message[]= _("Required field 'Name' is not filled.");
+ $message[]= msgPool::required(_("Name"));
}
/* cn already used? */
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;
}
}
/* 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 47cd4875069bb40ade41b796a59ce315e288357c..1b945354238c060d073dc39fd6155b10ad47794a 100644 (file)
/* 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 f5d90af0fa79b5532cf9c471cae8ef35917a4321..40c2d78903f0b3689e14c6f3b2f20c4a75cd67f3 100644 (file)
/* All required fields are set? */
if ($this->cn == ""){
- $message[]= _("Required field 'Name' is not filled.");
+ $message[]= msgPool::required(_("Name"));
}
/* cn already used? */
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 13c5bccd3884a47bc1b2e7f4b535a736cf06b4b5..eb08362d76d482fff52cc01b99c0071dc439fe3f 100644 (file)
$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 047dd27d33b1296509e915be359afd60f82cff11..c521b30487569ed59ac6a46186683754daa834c9 100644 (file)
/* All required fields are set? */
if ($this->cn == ""){
- $message[]= _("Required field 'Name' is not filled.");
+ $message[]= msgPool::required(_("Name"));
}
/* Check lease times */
"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]/");
}
}
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 dad9fd4dd596fd0de017c4d8fa6f5cb51d1e7bc9..04b9ceb8035af21bc79d3d41ac956dc1972cef9a 100644 (file)
/* 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? */
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;
}
}
/* 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 b59584a40198f24b2c6a8670f7f1c26fc88a6cde..efca699cc797d6140cbb1a2b1d7aec2e448e167f 100644 (file)
}
}
} 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;
}
/* 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;
}
} else {
-# $display= $this->show_header(_("Add DHCP service"),
-
-# _("This server has DHCP features disabled. You can enable them by clicking below."));
return ($display);
}