Commit a1c151e8 authored by Franco Fichtner's avatar Franco Fichtner

openvpn: fix server not saving interface without IP

PR: https://forum.opnsense.org/index.php?topic=1529.0
parent 1deb58a5
...@@ -351,6 +351,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -351,6 +351,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
if (strpos($pconfig['interface'], "|") !== false) { if (strpos($pconfig['interface'], "|") !== false) {
list($server['interface'], $server['ipaddr']) = explode("|", $pconfig['interface']); list($server['interface'], $server['ipaddr']) = explode("|", $pconfig['interface']);
} else {
$server['interface'] = $pconfig['interface'];
} }
$server['custom_options'] = str_replace("\r\n", "\n", $pconfig['custom_options']); $server['custom_options'] = str_replace("\r\n", "\n", $pconfig['custom_options']);
...@@ -861,17 +863,13 @@ function tuntap_change() { ...@@ -861,17 +863,13 @@ function tuntap_change() {
$interfaces['lo0'] = "Localhost"; $interfaces['lo0'] = "Localhost";
$interfaces['any'] = "any"; $interfaces['any'] = "any";
foreach ($interfaces as $iface => $ifacename) : foreach ($interfaces as $iface => $ifacename) :
$selected = ""; $selected = '';
if ($iface == $pconfig['interface']) { if ($iface == $pconfig['interface']) {
$selected = "selected=\"selected\""; $selected = ' selected="selected"';
} }
?> ?>
<option value="<?=$iface; <option value="<?=$iface; ?>"<?=$selected;?>><?=htmlspecialchars($ifacename);?></option>
?>" <?=$selected;?>> <?php endforeach; ?>
<?=htmlspecialchars($ifacename);?>
</option>
<?php
endforeach; ?>
</select> <br /> </select> <br />
</td> </td>
</tr> </tr>
......
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