Revision 9fbd8f71
Added by Viktor Gurov over 5 years ago
src/usr/local/www/services_dhcpv6.php | ||
---|---|---|
145 | 145 |
$pconfig['enable'] = isset($config['dhcpdv6'][$if]['enable']); |
146 | 146 |
$pconfig['ddnsdomain'] = $config['dhcpdv6'][$if]['ddnsdomain']; |
147 | 147 |
$pconfig['ddnsdomainprimary'] = $config['dhcpdv6'][$if]['ddnsdomainprimary']; |
148 |
$pconfig['ddnsdomainsecondary'] = $config['dhcpdv6'][$if]['ddnsdomainsecondary']; |
|
148 | 149 |
$pconfig['ddnsdomainkeyname'] = $config['dhcpdv6'][$if]['ddnsdomainkeyname']; |
149 | 150 |
$pconfig['ddnsdomainkeyalgorithm'] = $config['dhcpdv6'][$if]['ddnsdomainkeyalgorithm']; |
150 | 151 |
$pconfig['ddnsdomainkey'] = $config['dhcpdv6'][$if]['ddnsdomainkey']; |
... | ... | |
310 | 311 |
if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime']))) { |
311 | 312 |
$input_errors[] = gettext("The maximum lease time must be at least 60 seconds and higher than the default lease time."); |
312 | 313 |
} |
313 |
if ($_POST['ddnsupdate'] && !is_domain($_POST['ddnsdomain'])) { |
|
314 |
$input_errors[] = gettext("A valid domain name must be specified for the dynamic DNS registration."); |
|
315 |
} |
|
316 |
if ($_POST['ddnsupdate'] && !is_ipaddrv4($_POST['ddnsdomainprimary'])) { |
|
317 |
$input_errors[] = gettext("A valid primary domain name server IPv4 address must be specified for the dynamic domain name."); |
|
318 |
} |
|
319 |
if ($_POST['ddnsupdate'] && (!$_POST['ddnsdomainkeyname'] || !$_POST['ddnsdomainkeyalgorithm'] || !$_POST['ddnsdomainkey'])) { |
|
320 |
$input_errors[] = gettext("A valid domain key name, algorithm and secret must be specified."); |
|
314 |
if ($_POST['ddnsupdate']) { |
|
315 |
if (!is_domain($_POST['ddnsdomain'])) { |
|
316 |
$input_errors[] = gettext("A valid domain name must be specified for the dynamic DNS registration."); |
|
317 |
} |
|
318 |
if (!is_ipaddr($_POST['ddnsdomainprimary'])) { |
|
319 |
$input_errors[] = gettext("A valid primary domain name server IP address must be specified for the dynamic domain name."); |
|
320 |
} |
|
321 |
if (!empty($_POST['ddnsdomainsecondary']) && !is_ipaddr($_POST['ddnsdomainsecondary'])) { |
|
322 |
$input_errors[] = gettext("A valid secondary domain name server IP address must be specified for the dynamic domain name."); |
|
323 |
} |
|
324 |
if (!$_POST['ddnsdomainkeyname'] || !$_POST['ddnsdomainkeyalgorithm'] || !$_POST['ddnsdomainkey']) { |
|
325 |
$input_errors[] = gettext("A valid domain key name, algorithm and secret must be specified."); |
|
326 |
} |
|
327 |
if (preg_match('/[^A-Za-z0-9\-_]/', $_POST['ddnsdomainkeyname'])) { |
|
328 |
$input_errors[] = gettext("The domain key name may only contain the characters a-z, A-Z, 0-9, '-' and '_'"); |
|
329 |
} |
|
330 |
if ($_POST['ddnsdomainkey'] && !base64_decode($_POST['ddnsdomainkey'], true)) { |
|
331 |
$input_errors[] = gettext("The domain key secret must be a Base64 encoded value."); |
|
332 |
} |
|
321 | 333 |
} |
322 | 334 |
if ($_POST['domainsearchlist']) { |
323 | 335 |
$domain_array = preg_split("/[ ;]+/", $_POST['domainsearchlist']); |
... | ... | |
450 | 462 |
$config['dhcpdv6'][$if]['enable'] = ($_POST['enable']) ? true : false; |
451 | 463 |
$config['dhcpdv6'][$if]['ddnsdomain'] = $_POST['ddnsdomain']; |
452 | 464 |
$config['dhcpdv6'][$if]['ddnsdomainprimary'] = $_POST['ddnsdomainprimary']; |
465 |
$config['dhcpdv6'][$if]['ddnsdomainsecondary'] = (!empty($_POST['ddnsdomainsecondary'])) ? $_POST['ddnsdomainsecondary'] : ''; |
|
453 | 466 |
$config['dhcpdv6'][$if]['ddnsdomainkeyname'] = $_POST['ddnsdomainkeyname']; |
454 | 467 |
$config['dhcpdv6'][$if]['ddnsdomainkeyalgorithm'] = $_POST['ddnsdomainkeyalgorithm']; |
455 | 468 |
$config['dhcpdv6'][$if]['ddnsdomainkey'] = $_POST['ddnsdomainkey']; |
... | ... | |
798 | 811 |
|
799 | 812 |
$section->addInput(new Form_IpAddress( |
800 | 813 |
'ddnsdomainprimary', |
801 |
'DDNS Server IP',
|
|
814 |
'Primary DDNS address',
|
|
802 | 815 |
$pconfig['ddnsdomainprimary'], |
803 |
'V4' |
|
804 |
))->setHelp('Enter the primary domain name server IPv4 address for the dynamic domain name.'); |
|
816 |
'BOTH' |
|
817 |
))->setHelp('Enter the primary domain name server IP address for the dynamic domain name.'); |
|
818 |
|
|
819 |
$section->addInput(new Form_IpAddress( |
|
820 |
'ddnsdomainsecondary', |
|
821 |
'Secondary DDNS address', |
|
822 |
$pconfig['ddnsdomainsecondary'], |
|
823 |
'BOTH' |
|
824 |
))->setHelp('Enter the secondary domain name server IP address for the dynamic domain name.'); |
|
805 | 825 |
|
806 | 826 |
$section->addInput(new Form_Input( |
807 | 827 |
'ddnsdomainkeyname', |
... | ... | |
829 | 849 |
'DDNS Domain Key secret', |
830 | 850 |
'text', |
831 | 851 |
$pconfig['ddnsdomainkey'] |
832 |
))->setHelp('Enter the dynamic DNS domain key secret which will be used to register client names in the DNS server.'); |
|
852 |
))->setAttribute('placeholder', 'Base64 encoded string') |
|
853 |
->setHelp('Enter the dynamic DNS domain key secret which will be used to register client names in the DNS server.'); |
|
833 | 854 |
|
834 | 855 |
$section->addInput(new Form_Select( |
835 | 856 |
'ddnsclientupdates', |
... | ... | |
1122 | 1143 |
!$pconfig['ddnsforcehostname'] && |
1123 | 1144 |
empty($pconfig['ddnsdomain']) && |
1124 | 1145 |
empty($pconfig['ddnsdomainprimary']) && |
1146 |
empty($pconfig['ddnsdomainsecondary']) && |
|
1125 | 1147 |
empty($pconfig['ddnsdomainkeyname']) && |
1126 | 1148 |
(empty($pconfig['ddnsdomainkeyalgorithm']) || ($pconfig['ddnsdomainkeyalgorithm'] == "hmac-md5")) && |
1127 | 1149 |
empty($pconfig['ddnsdomainkey']) && |
... | ... | |
1142 | 1164 |
hideInput('ddnsdomain', !showadvdns); |
1143 | 1165 |
hideCheckbox('ddnsforcehostname', !showadvdns); |
1144 | 1166 |
hideInput('ddnsdomainprimary', !showadvdns); |
1167 |
hideInput('ddnsdomainsecondary', !showadvdns); |
|
1145 | 1168 |
hideInput('ddnsdomainkeyname', !showadvdns); |
1146 | 1169 |
hideInput('ddnsdomainkeyalgorithm', !showadvdns); |
1147 | 1170 |
hideInput('ddnsdomainkey', !showadvdns); |
Also available in: Unified diff
DHCPv6 service Dynamic DNS fix. Issue #10346