Commit 1ffc2f54 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) regression services_upnp.php

parent 6dbd996d
...@@ -83,6 +83,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -83,6 +83,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($pconfig['enable']) && (empty($pconfig['enable_upnp']) && empty($pconfig['enable_natpmp']))) { if (!empty($pconfig['enable']) && (empty($pconfig['enable_upnp']) && empty($pconfig['enable_natpmp']))) {
$input_errors[] = gettext('At least one of \'UPnP\' or \'NAT-PMP\' must be allowed'); $input_errors[] = gettext('At least one of \'UPnP\' or \'NAT-PMP\' must be allowed');
} }
if (!empty($pconfig['iface_array'])) {
foreach($pconfig['iface_array'] as $iface) { foreach($pconfig['iface_array'] as $iface) {
if ($iface == 'wan') { if ($iface == 'wan') {
$input_errors[] = gettext('It is a security risk to specify WAN in the \'Interface\' field'); $input_errors[] = gettext('It is a security risk to specify WAN in the \'Interface\' field');
...@@ -90,6 +91,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -90,6 +91,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$input_errors[] = gettext('You cannot select the external interface as an internal interface.'); $input_errors[] = gettext('You cannot select the external interface as an internal interface.');
} }
} }
}
if (!empty($pconfig['overridewanip']) && !is_ipaddr($pconfig['overridewanip'])) { if (!empty($pconfig['overridewanip']) && !is_ipaddr($pconfig['overridewanip'])) {
$input_errors[] = gettext('You must specify a valid ip address in the \'Override WAN address\' field'); $input_errors[] = gettext('You must specify a valid ip address in the \'Override WAN address\' field');
} }
...@@ -225,12 +227,12 @@ include("head.inc"); ...@@ -225,12 +227,12 @@ include("head.inc");
<td><a id="help_for_iface_array" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Interfaces (generally LAN)");?></td> <td><a id="help_for_iface_array" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Interfaces (generally LAN)");?></td>
<td> <td>
<select class="selectpicker" name="iface_array[]" multiple="multiple"> <select class="selectpicker" name="iface_array[]" multiple="multiple">
<option value="lo0" <?=in_array('lo0', $pconfig['iface_array']) ? "selected=\"selected\"" : "";?>> <option value="lo0" <?=!empty($pconfig['iface_array']) && in_array('lo0', $pconfig['iface_array']) ? "selected=\"selected\"" : "";?>>
<?=gettext("Localhost");?> <?=gettext("Localhost");?>
</option> </option>
<?php <?php
foreach (get_configured_interface_with_descr() as $iface => $ifacename):?> foreach (get_configured_interface_with_descr() as $iface => $ifacename):?>
<option value="<?=$iface;?>" <?=in_array($iface, $pconfig['iface_array']) ? "selected=\"selected\"" : "";?>> <option value="<?=$iface;?>" <?=!empty($pconfig['iface_array']) && in_array($iface, $pconfig['iface_array']) ? "selected=\"selected\"" : "";?>>
<?=htmlspecialchars($ifacename);?> <?=htmlspecialchars($ifacename);?>
</option> </option>
<?php <?php
......
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