Commit 46a8d2f5 authored by Franco Fichtner's avatar Franco Fichtner

vpn: can't have zero clients

(cherry picked from commit fc381754)
parent 3e170015
...@@ -267,8 +267,9 @@ include("head.inc"); ...@@ -267,8 +267,9 @@ include("head.inc");
<td> <td>
<select id="n_l2tp_units" name="n_l2tp_units"> <select id="n_l2tp_units" name="n_l2tp_units">
<?php <?php
for ($x=0; $x<255; $x++) { $toselect = ($pconfig['n_l2tp_units'] > 0) ? $pconfig['n_l2tp_units'] : 16;
if ($x == $pconfig['n_l2tp_units']) { for ($x=1; $x<255; $x++) {
if ($x == $toselect) {
$SELECTED = " selected=\"selected\""; $SELECTED = " selected=\"selected\"";
} else { } else {
$SELECTED = ""; $SELECTED = "";
......
...@@ -325,8 +325,9 @@ legacy_html_escape_form_data($pconfig); ...@@ -325,8 +325,9 @@ legacy_html_escape_form_data($pconfig);
<td> <td>
<select id="n_pppoe_units" name="n_pppoe_units"> <select id="n_pppoe_units" name="n_pppoe_units">
<?php <?php
for ($x=0; $x<255; $x++):?> $toselect = ($pconfig['n_pppoe_units'] > 0) ? $pconfig['n_pppoe_units'] : 16;
<option value="<?=$x;?>" <?=$x == $pconfig['n_pppoe_units'] ? "selected=\"selected\"" : "" ;?>> for ($x=1; $x<255; $x++):?>
<option value="<?=$x;?>" <?=$x == $toselect ? "selected=\"selected\"" : "" ;?>>
<?=$x;?> <?=$x;?>
<?php <?php
endfor;?> endfor;?>
......
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