removed domain length restriction

This commit is contained in:
Roland Gruber 2013-01-05 15:14:12 +00:00
parent d888e15643
commit 2cbc46444e
1 changed files with 2 additions and 12 deletions

View File

@ -306,9 +306,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
$this->messages['subnet'][1] = array('ERROR', _('Account %s:') . ' dhcp_settings_subnetMask', _('The subnet mask is invalid.'));
$this->messages['ranges_reload'][0] = array('INFO', _('The DHCP ranges were changed to fit for the new subnet.'));
$this->messages['ips_reload'][0] = array('INFO', 'The fixed IP addresses were changed to fit for the new subnet.');
$this->messages['domainname'][1] = array('ERROR', _('The domain name needs to have at least 3 characters.'));
$this->messages['domainname'][2] = array('ERROR', _('The domain name includes invalid characters. Valid characters are A-Z, a-z, 0-9, ".", "_","-".'));
$this->messages['domainname'][4] = array('ERROR', _('Account %s:') . ' dhcp_settings_domainName', _('The domain name needs to have at least 3 characters.'));
$this->messages['domainname'][5] = array('ERROR', _('Account %s:') . ' dhcp_settings_domainName', _('The domain name includes invalid characters. Valid characters are A-Z, a-z, 0-9, ".", "_","-".'));
}
@ -380,10 +378,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
// Check domainname:
if (!empty($_POST['domainname'])) $_POST['domainname'] = trim($_POST['domainname']);
if (!empty($_POST['domainname'])) {
if (strlen($_POST['domainname'])<3) {
$errors[] = $this->messages['domainname'][1];
}
elseif (!preg_match("/^[A-Za-z0-9\\._-]*$/", $_POST['domainname'])) {
if (!preg_match("/^[A-Za-z0-9\\._-]*$/", $_POST['domainname'])) {
$errors[] = $this->messages['domainname'][2];
}
}
@ -789,12 +784,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
}
// domain name
if ($rawAccounts[$i][$ids['dhcp_settings_domainName']] != "") {
if (strlen($rawAccounts[$i][$ids['dhcp_settings_domainName']])<3) {
$error = $this->messages['domainname'][4];
array_push($error, $i);
$messages[] = $error;
}
elseif (preg_match("/^[A-Za-z0-9\\._-]*$/", $rawAccounts[$i][$ids['dhcp_settings_domainName']])) {
if (preg_match("/^[A-Za-z0-9\\._-]*$/", $rawAccounts[$i][$ids['dhcp_settings_domainName']])) {
$partialAccounts[$i]['dhcpOption'][] = "domain-name \"".$rawAccounts[$i][$ids['dhcp_settings_domainName']]."\"";
}
else {