Commit 57bb583c authored by Franco Fichtner's avatar Franco Fichtner

interfaces: add missing validation for previous #1052

parent e86885cb
......@@ -3416,7 +3416,7 @@ function interface_dhcpv6_configure($interface = 'wan', $wancfg)
$dhcp6cconf = file_get_contents($dhcp6cfile);
$dhcp6cconf = DHCP6_Config_File_Substitutions($wancfg, $wanif, $dhcp6cconf);
} else {
log_error(sprintf('DHCP6 config file override does not exist: %s', $dhcp6cfile));
log_error(sprintf('DHCP6 config file override does not exist: "%s"', $dhcp6cfile));
}
}
......@@ -3739,7 +3739,7 @@ EOD;
$dhclientconf = file_get_contents($dhclientfile);
$dhclientconf = DHCP_Config_File_Substitutions($wancfg, $wanif, $dhclientconf);
} else {
log_error(sprintf('DHCP config file override does not exist: %s', $dhclientfile));
log_error(sprintf('DHCP config file override does not exist: "%s"', $dhclientfile));
}
}
......
......@@ -611,6 +611,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (in_array($a_interfaces[$if]['ipaddr'], array("ppp", "pppoe", "pptp", "l2tp"))) {
$input_errors[] = sprintf(gettext("You have to reassign the interface to be able to configure as %s."),$pconfig['type']);
}
if (!empty($pconfig['adv_dhcp_config_file_override'] && !file_exists($pconfig['adv_dhcp_config_file_override_path']))) {
$input_errors[] = sprintf(gettext('The DHCP override file "%s" does not exist.'), $pconfig['adv_dhcp_config_file_override_path']);
}
break;
case "ppp":
$reqdfields = explode(" ", "ports phone");
......@@ -654,6 +657,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$reqdfieldsn = array(gettext("IPv6 address"),gettext("Subnet bit count"),gettext("Gateway"));
do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
break;
case "dhcp6":
if (!empty($pconfig['adv_dhcp6_config_file_override'] && !file_exists($pconfig['adv_dhcp6_config_file_override_path']))) {
$input_errors[] = sprintf(gettext('The DHCPv6 override file "%s" does not exist.'), $pconfig['adv_dhcp6_config_file_override_path']);
}
break;
case "none":
if (isset($config['virtualip']['vip'])) {
foreach ($config['virtualip']['vip'] as $vip) {
......@@ -2046,7 +2054,7 @@ include("head.inc");
</td>
</tr>
<tr class="dhcp_file_override">
<td><a id="help_for_dhcp_config_file_override_path" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Config File Override");?>
<td><a id="help_for_dhcp_config_file_override_path" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Configuration File Override");?>
<td>
<input name="adv_dhcp_config_file_override_path" type="text" id="adv_dhcp_config_file_override_path" value="<?=$pconfig['adv_dhcp_config_file_override_path'];?>" />
<div class="hidden" for="help_for_dhcp_config_file_override_path">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment