Revision 80bc7a5c
Added by Marcus Brown over 15 years ago
usr/local/www/interfaces_mlppp_edit.php | ||
---|---|---|
6 | 6 |
|
7 | 7 |
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. |
8 | 8 |
All rights reserved. |
9 |
Copyright (C) 2010 Gabriel B. <gnoahb@gmail.com>. |
|
10 |
All rights reserved. |
|
9 | 11 |
|
10 | 12 |
Redistribution and use in source and binary forms, with or without |
11 | 13 |
modification, are permitted provided that the following conditions are met: |
... | ... | |
41 | 43 |
|
42 | 44 |
require("guiconfig.inc"); |
43 | 45 |
|
44 |
if (!is_array($config['mlppps']['mlppp']))
|
|
45 |
$config['mlppps']['mlppp'] = array();
|
|
46 |
if (!is_array($config['ppps']['ppp']))
|
|
47 |
$config['ppps']['ppp'] = array();
|
|
46 | 48 |
|
47 |
$a_mlppps = &$config['mlppps']['mlppp'];
|
|
49 |
$a_ppps = &$config['ppps']['ppp'];
|
|
48 | 50 |
|
49 | 51 |
$portlist = get_interface_list(); |
50 | 52 |
|
... | ... | |
52 | 54 |
if (isset($_POST['id'])) |
53 | 55 |
$id = $_POST['id']; |
54 | 56 |
|
55 |
if (isset($id) && $a_mlppps[$id]) { |
|
56 |
$pconfig['if'] = $a_mlppps[$id]['if']; |
|
57 |
$pconfig['mlpppif'] = $a_mlppps[$id]['mlpppif']; |
|
58 |
$pconfig['username'] = $a_mlppps[$id]['username']; |
|
59 |
$pconfig['password'] = $a_mlppps[$id]['password']; |
|
60 |
$pconfig['service'] = $a_mlppps[$id]['service']; |
|
61 |
$pconfig['ondemand'] = $a_mlppps[$id]['ondemand']; |
|
62 |
$pconfig['timeout'] = $a_mlppps[$id]['timeout']; |
|
57 |
if (isset($id) && $a_ppps[$id]) { |
|
58 |
$pconfig['type'] = $a_ppps[$id]['type']; |
|
59 |
$pconfig['username'] = $a_ppps[$id]['username']; |
|
60 |
$pconfig['password'] = $a_ppps[$id]['password']; |
|
61 |
if (isset($a_ppps[$id]['defaultgw'])) |
|
62 |
$pconfig['defaultgw'] = true; |
|
63 |
$pconfig['ondemand'] = $a_ppps[$id]['ondemand']; |
|
64 |
$pconfig['idletimeout'] = $a_ppps[$id]['idletimeout']; |
|
65 |
$pconfig['descr'] = $a_ppps[$id]['descr']; |
|
66 |
if ($a_ppps[$id]['type'] == "ppp") { |
|
67 |
$pconfig['serialports'] = $a_ppps[$id]['serialports']; |
|
68 |
$pconfig['initstr'] = base64_decode($a_ppps[$id]['initstr']); |
|
69 |
$pconfig['simpin'] = $a_ppps[$id]['simpin']; |
|
70 |
$pconfig['pin-wait'] = $a_ppps[$id]['pin-wait']; |
|
71 |
$pconfig['apn'] = $a_ppps[$id]['apn']; |
|
72 |
$pconfig['apnum'] = $a_ppps[$id]['apnum']; |
|
73 |
$pconfig['phone'] = $a_ppps[$id]['phone']; |
|
74 |
$pconfig['connect-timeout'] = $a_ppps[$id]['connect-timeout']; |
|
75 |
$pconfig['localip'] = $a_ppps[$id]['localip']; |
|
76 |
$pconfig['gateway'] = $a_ppps[$id]['gateway']; |
|
77 |
} |
|
78 |
if ($a_ppps[$id]['type'] == "pptp") { |
|
79 |
$pconfig['interfaces'] = $a_ppps[$id]['interfaces']; |
|
80 |
$pconfig['localip'] = $a_ppps[$id]['localip']; |
|
81 |
$pconfig['subnet'] = $a_ppps[$id]['subnet']; |
|
82 |
$pconfig['gateway'] = $a_ppps[$id]['gateway']; |
|
83 |
} |
|
84 |
if ($a_ppps[$id]['type'] == "pppoe") { |
|
85 |
$pconfig['interfaces'] = $a_ppps[$id]['interfaces']; |
|
86 |
$pconfig['provider']; |
|
87 |
/* ================================================ */ |
|
88 |
/* = force a connection reset at a specific time? = */ |
|
89 |
/* ================================================ */ |
|
90 |
|
|
91 |
if (isset($wancfg['pppoe']['pppoe-reset-type'])) { |
|
92 |
$resetTime = getMPDResetTimeFromConfig(); |
|
93 |
$pconfig['pppoe_preset'] = true; |
|
94 |
if ($wancfg['pppoe']['pppoe-reset-type'] == "custom") { |
|
95 |
$resetTime_a = split(" ", $resetTime); |
|
96 |
$pconfig['pppoe_pr_custom'] = true; |
|
97 |
$pconfig['pppoe_resetminute'] = $resetTime_a[0]; |
|
98 |
$pconfig['pppoe_resethour'] = $resetTime_a[1]; |
|
99 |
/* just initialize $pconfig['pppoe_resetdate'] if the |
|
100 |
* coresponding item contains appropriate numeric values. |
|
101 |
*/ |
|
102 |
if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*") |
|
103 |
$pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y"); |
|
104 |
} else if ($wancfg['pppoe']['pppoe-reset-type'] == "preset") { |
|
105 |
$pconfig['pppoe_pr_preset'] = true; |
|
106 |
switch ($resetTime) { |
|
107 |
case CRON_MONTHLY_PATTERN: |
|
108 |
$pconfig['pppoe_monthly'] = true; |
|
109 |
break; |
|
110 |
case CRON_WEEKLY_PATTERN: |
|
111 |
$pconfig['pppoe_weekly'] = true; |
|
112 |
break; |
|
113 |
case CRON_DAILY_PATTERN: |
|
114 |
$pconfig['pppoe_daily'] = true; |
|
115 |
break; |
|
116 |
case CRON_HOURLY_PATTERN: |
|
117 |
$pconfig['pppoe_hourly'] = true; |
|
118 |
break; |
|
119 |
} |
|
120 |
} |
|
121 |
} |
|
122 |
|
|
123 |
|
|
63 | 124 |
} |
64 | 125 |
|
65 | 126 |
if ($_POST) { |
66 | 127 |
|
67 | 128 |
unset($input_errors); |
68 | 129 |
$pconfig = $_POST; |
130 |
|
|
131 |
/* filter out spaces from descriptions */ |
|
132 |
$_POST['descr'] = remove_bad_chars($_POST['descr']); |
|
133 |
/* okay first of all, cause we are just hiding the PPPoE HTML |
|
134 |
* fields releated to PPPoE resets, we are going to unset $_POST |
|
135 |
* vars, if the reset feature should not be used. Otherwise the |
|
136 |
* data validation procedure below, may trigger a false error |
|
137 |
* message. |
|
138 |
*/ |
|
139 |
if (empty($_POST['pppoe_preset'])) { |
|
140 |
unset($_POST['pppoe_pr_type']); |
|
141 |
unset($_POST['pppoe_resethour']); |
|
142 |
unset($_POST['pppoe_resetminute']); |
|
143 |
unset($_POST['pppoe_resetdate']); |
|
144 |
unset($_POST['pppoe_pr_preset_val']); |
|
145 |
} |
|
69 | 146 |
|
70 | 147 |
/* input validation */ |
71 |
$reqdfields = explode(" ", "if tag"); |
|
72 |
$reqdfieldsn = explode(",", "Parent interface,mlppp tag"); |
|
73 |
|
|
74 |
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); |
|
75 | 148 |
|
76 |
if ($_POST['tag'] && (!is_numericint($_POST['tag']) || ($_POST['tag'] < '1') || ($_POST['tag'] > '4094'))) { |
|
77 |
$input_errors[] = "The mlppp tag must be an integer between 1 and 4094."; |
|
149 |
switch($_POST['type']) { |
|
150 |
case "PPP": |
|
151 |
$reqdfields = explode(" ", "serialports, phone"); |
|
152 |
$reqdfieldsn = explode(",", "Serial Port(s), Phone Number"); |
|
153 |
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); |
|
154 |
break; |
|
155 |
case "PPPoE": |
|
156 |
if ($_POST['ondemand']) { |
|
157 |
$reqdfields = explode(" ", "interfaces username password dialondemand idletimeout"); |
|
158 |
$reqdfieldsn = explode(",", "Link Interface(s),PPPoE username,PPPoE password,Dial on demand,Idle timeout value"); |
|
159 |
} else { |
|
160 |
$reqdfields = explode(" ", "interfaces username password"); |
|
161 |
$reqdfieldsn = explode(",", "Link Interface(s),PPPoE username,PPPoE password"); |
|
162 |
} |
|
163 |
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); |
|
164 |
break; |
|
165 |
case "PPTP": |
|
166 |
if ($_POST['ondemand']) { |
|
167 |
$reqdfields = explode(" ", "interfaces username password localip subnet gateway dialondemand idletimeout"); |
|
168 |
$reqdfieldsn = explode(",", "Link Interface(s),PPTP username,PPTP password,PPTP local IP address,PPTP subnet,PPTP remote IP address,Dial on demand,Idle timeout value"); |
|
169 |
} else { |
|
170 |
$reqdfields = explode(" ", "interfaces username password localip subnet gateway"); |
|
171 |
$reqdfieldsn = explode(",", "Link Interface(s),PPTP username,PPTP password,PPTP local IP address,PPTP subnet,PPTP remote IP address"); |
|
172 |
} |
|
173 |
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); |
|
174 |
break; |
|
78 | 175 |
} |
79 |
|
|
80 |
foreach ($a_mlppps as $mlppp) { |
|
81 |
if (isset($id) && ($a_mlppps[$id]) && ($a_mlppps[$id] === $mlppp)) |
|
176 |
if (($_POST['provider'] && !is_domain($_POST['provider']))) |
|
177 |
$input_errors[] = "The service name contains invalid characters."; |
|
178 |
if (($_POST['idletimeout'] != "") && !is_numericint($_POST['idletimeout'])) |
|
179 |
$input_errors[] = "The idle timeout value must be an integer."; |
|
180 |
if ($_POST['pppoe_resethour'] <> "" && !is_numericint($_POST['pppoe_resethour']) && |
|
181 |
$_POST['pppoe_resethour'] >= 0 && $_POST['pppoe_resethour'] <=23) |
|
182 |
$input_errors[] = gettext("A valid PPPoE reset hour must be specified (0-23)."); |
|
183 |
if ($_POST['pppoe_resetminute'] <> "" && !is_numericint($_POST['pppoe_resetminute']) && |
|
184 |
$_POST['pppoe_resetminute'] >= 0 && $_POST['pppoe_resetminute'] <=59) |
|
185 |
$input_errors[] = gettext("A valid PPPoE reset minute must be specified (0-59)."); |
|
186 |
if ($_POST['pppoe_resetdate'] <> "" && !is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))) |
|
187 |
$input_errors[] = gettext("A valid PPPoE reset date must be specified (mm/dd/yyyy)."); |
|
188 |
if (($_POST['localip'] && !is_ipaddr($_POST['localip']))) |
|
189 |
$input_errors[] = "A valid PPTP local IP address must be specified."; |
|
190 |
if (($_POST['subnet'] && !is_numeric($_POST['subnet']))) |
|
191 |
$input_errors[] = "A valid PPTP subnet bit count must be specified."; |
|
192 |
if (($_POST['gateway'] && !is_ipaddr($_POST['gateway']))) |
|
193 |
$input_errors[] = "A valid PPTP remote IP address must be specified."; |
|
194 |
|
|
195 |
if ($_POST['mtu'] && ($_POST['mtu'] < 576)) |
|
196 |
$input_errors[] = "The MTU must be greater than 576 bytes."; |
|
197 |
if ($_POST['mru'] && ($_POST['mru'] < 576)) |
|
198 |
$input_errors[] = "The MRU must be greater than 576 bytes."; |
|
199 |
/* |
|
200 |
foreach ($a_ppps as $ppp) { |
|
201 |
if (isset($id) && ($a_ppps[$id]) && ($a_ppps[$id] === $ppp)) |
|
82 | 202 |
continue; |
83 | 203 |
|
84 |
if (($mlppp['if'] == $_POST['if']) && ($mlppp['tag'] == $_POST['tag'])) {
|
|
85 |
$input_errors[] = "A mlppp with the tag {$mlppp['tag']} is already defined on this interface.";
|
|
204 |
if ($ppp['serialport'] == $_POST['serialport']) {
|
|
205 |
$input_errors[] = "Port is in use";
|
|
86 | 206 |
break; |
87 | 207 |
} |
88 | 208 |
} |
89 |
if (is_array($config['qinqs']['qinqentry'])) { |
|
90 |
foreach ($config['qinqs']['qinqentry'] as $qinq) |
|
91 |
if ($qinq['tag'] == $_POST['tag'] && $qinq['if'] == $_POST['if']) |
|
92 |
$input_errors[] = "A QinQ mlppp exists with this tag please remove it to use this tag with."; |
|
93 |
} |
|
209 |
*/ |
|
94 | 210 |
|
95 | 211 |
if (!$input_errors) { |
96 |
$mlppp = array(); |
|
97 |
$mlppp['if'] = $_POST['if']; |
|
98 |
$mlppp['tag'] = $_POST['tag']; |
|
99 |
$mlppp['descr'] = $_POST['descr']; |
|
100 |
$mlppp['mlpppif'] = "{$_POST['if']}_mlppp{$_POST['tag']}"; |
|
101 |
|
|
102 |
$mlppp['mlpppif'] = interface_mlppp_configure($mlppp); |
|
103 |
if ($mlppp['mlpppif'] == "" || !stristr($mlppp['mlpppif'], "mlppp")) |
|
104 |
$input_errors[] = "Error occured creating interface, please retry."; |
|
105 |
else { |
|
106 |
if (isset($id) && $a_mlppps[$id]) |
|
107 |
$a_mlppps[$id] = $mlppp; |
|
108 |
else |
|
109 |
$a_mlppps[] = $mlppp; |
|
110 |
|
|
111 |
write_config(); |
|
112 |
|
|
113 |
$confif = convert_real_interface_to_friendly_interface_name($mlppp['mlpppif']); |
|
114 |
if ($confif <> "") |
|
115 |
interface_configure($confif); |
|
212 |
$ppp = array(); |
|
213 |
$ppp['type'] = $_POST['type']; |
|
214 |
$ppp['username'] = $_POST['username']; |
|
215 |
$ppp['password'] = $_POST['password']; |
|
216 |
$ppp['defaultgw'] = $_POST['defaultgw'] ? true : false; |
|
217 |
/* if ($_POST['defaultgw'] == "on") |
|
218 |
$ppp['defaultgw'] = true; |
|
219 |
else |
|
220 |
unset($ppp['defaultgw']); |
|
221 |
*/ |
|
222 |
$ppp['ondemand'] = $_POST['ondemand'] ? true : false; |
|
223 |
if ($_POST['ondemand']) |
|
224 |
$ppp['idletimeout'] = $_POST['idletimeout']; |
|
225 |
else |
|
226 |
unset($ppp['idletimeout']); |
|
227 |
$ppp['descr'] = $_POST['descr']; |
|
228 |
switch($_POST['type']) { |
|
229 |
case "ppp": |
|
230 |
$ppp['ipaddr'] = "ppp"; |
|
231 |
$ppp['serialports'] = implode(',', $_POST['serialports']); |
|
232 |
if (!empty($_POST['initstr'])) |
|
233 |
$ppp['initstr'] = base64_encode($_POST['initstr']); |
|
234 |
else |
|
235 |
unset($ppp['initstr']); |
|
236 |
if (!empty($_POST['simpin'])) { |
|
237 |
$ppp['simpin'] = $_POST['simpin']; |
|
238 |
$ppp['pin-wait'] = $_POST['pin-wait']; |
|
239 |
} else { |
|
240 |
unset($ppp['simpin']); |
|
241 |
unset($ppp['pin-wait']); |
|
242 |
} |
|
116 | 243 |
|
117 |
header("Location: interfaces_mlppp.php"); |
|
118 |
exit; |
|
244 |
if (!empty($_POST['apn'])){ |
|
245 |
$ppp['apn'] = $_POST['apn']; |
|
246 |
if (!empty($_POST['apnum'])) |
|
247 |
$ppp['apnum'] = $_POST['apnum']; |
|
248 |
else |
|
249 |
$ppp['apnum'] = "1"; |
|
250 |
} else { |
|
251 |
unset($ppp['apn']); |
|
252 |
unset($ppp['apnum']); |
|
253 |
} |
|
254 |
$ppp['phone'] = $_POST['phone']; |
|
255 |
$ppp['localip'] = $_POST['localip']; |
|
256 |
$ppp['gateway'] = $_POST['gateway']; |
|
257 |
if (!empty($_POST['connect-timeout'])) |
|
258 |
$ppp['connect-timeout'] = $_POST['connect-timeout']; |
|
259 |
else |
|
260 |
unset($ppp['connect-timeout']); |
|
261 |
break; |
|
262 |
case "pppoe": |
|
263 |
$ppp['ipaddr'] = "pppoe"; |
|
264 |
$ppp['interfaces'] = implode(',', $_POST['interfaces']); |
|
265 |
$ppp['provider'] = $_POST['provider']; |
|
266 |
break; |
|
267 |
case "pptp": |
|
268 |
$ppp['ipaddr'] = "pptp"; |
|
269 |
$ppp['interfaces'] = implode(',', $_POST['interfaces']); |
|
270 |
$ppp['localip'] = $_POST['localip']; |
|
271 |
$ppp['subnet'] = $_POST['subnet']; |
|
272 |
$ppp['gateway'] = $_POST['gateway']; |
|
273 |
break; |
|
119 | 274 |
} |
275 |
$iflist = get_configured_interface_list(); |
|
276 |
foreach ($iflist as $if) { |
|
277 |
if ($config['interfaces'][$if]['if'] == basename($a_ppps[$id]['port'])) |
|
278 |
$config['interfaces'][$if]['if'] = basename($ppp['port']); |
|
279 |
} |
|
280 |
|
|
281 |
if (isset($id) && $a_ppps[$id]) |
|
282 |
$a_ppps[$id] = $ppp; |
|
283 |
else |
|
284 |
$a_ppps[] = $ppp; |
|
285 |
|
|
286 |
write_config(); |
|
287 |
|
|
288 |
header("Location: interfaces_mlppp.php"); |
|
289 |
exit; |
|
120 | 290 |
} |
121 | 291 |
} |
292 |
|
|
122 | 293 |
$closehead = false; |
123 | 294 |
$pgtitle = array("Interfaces","MLPPP","Edit"); |
124 | 295 |
include("head.inc"); |
125 |
$types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP"/*, "l2tp" => "L2TP", "tcp" => "TCP", "udp" => "UDP", "ng" => "Netgraph" */); |
|
296 |
$types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP"/*, "l2tp" => "L2TP", "tcp" => "TCP", "udp" => "UDP", "ng" => "Netgraph" */ );
|
|
126 | 297 |
|
127 | 298 |
|
128 | 299 |
?> |
129 | 300 |
|
130 | 301 |
<script type="text/javascript"> |
302 |
|
|
131 | 303 |
function updateType(t){ |
132 | 304 |
switch(t) { |
133 |
<?php |
|
134 |
/* OK, so this is sick using php to generate javascript, but it needed to be done */ |
|
135 |
foreach ($types as $key => $val) { |
|
136 |
echo " case \"{$key}\": {\n"; |
|
137 |
$t = $types; |
|
138 |
foreach ($t as $k => $v) { |
|
139 |
if ($k != $key) { |
|
140 |
echo " $('{$k}').hide();\n"; |
|
141 |
} |
|
142 |
|
|
305 |
case "select": { |
|
306 |
document.getElementById("ppp").style.display = 'none'; |
|
307 |
document.getElementById("pppoe").style.display = 'none'; |
|
308 |
document.getElementById("pptp").style.display = 'none'; |
|
309 |
document.getElementById("interface").style.display = 'none'; |
|
310 |
document.getElementById("serialport").style.display = 'none'; |
|
311 |
break; |
|
143 | 312 |
} |
144 |
if ($key == "ppp"){ |
|
145 |
echo " $('serialports').show();\n"; |
|
146 |
echo " $('ports').hide();\n"; |
|
147 |
} else { |
|
148 |
if ($key == "select") { |
|
149 |
echo " $('ports').hide();\n"; |
|
150 |
echo " $('serialports').hide();\n"; |
|
151 |
} |
|
152 |
else { |
|
153 |
echo " $('ports').show();\n"; |
|
154 |
echo " $('serialports').hide();\n"; |
|
155 |
} |
|
313 |
case "ppp": { |
|
314 |
document.getElementById("select").style.display = 'none'; |
|
315 |
document.getElementById("pppoe").style.display = 'none'; |
|
316 |
document.getElementById("pptp").style.display = 'none'; |
|
317 |
document.getElementById("interface").style.display = 'none'; |
|
318 |
document.getElementById("serialport").style.display = ''; |
|
319 |
break; |
|
320 |
} |
|
321 |
case "pppoe": { |
|
322 |
document.getElementById("select").style.display = 'none'; |
|
323 |
document.getElementById("ppp").style.display = 'none'; |
|
324 |
document.getElementById("pptp").style.display = 'none'; |
|
325 |
document.getElementById("interface").style.display = 'none'; |
|
326 |
document.getElementById("serialport").style.display = 'none'; |
|
327 |
break; |
|
328 |
} |
|
329 |
case "pptp": { |
|
330 |
document.getElementById("select").style.display = 'none'; |
|
331 |
document.getElementById("ppp").style.display = 'none'; |
|
332 |
document.getElementById("pppoe").style.display = 'none'; |
|
333 |
document.getElementById("interface").style.display = 'none'; |
|
334 |
document.getElementById("serialport").style.display = 'none'; |
|
335 |
break; |
|
156 | 336 |
} |
157 |
echo " }\n"; |
|
158 |
} |
|
159 |
?> |
|
160 | 337 |
} |
161 | 338 |
$(t).show(); |
162 | 339 |
} |
163 |
|
|
164 | 340 |
function show_allcfg(obj) { |
165 | 341 |
if (obj.checked) |
166 | 342 |
$('allcfg').show(); |
... | ... | |
250 | 426 |
</select> |
251 | 427 |
</td> |
252 | 428 |
</tr> |
253 |
<tr style="display:none;" name="ports" id="ports" >
|
|
429 |
<tr style="display:none" name="interface" id="interface" >
|
|
254 | 430 |
<td width="22%" valign="top" class="vncellreq">Member interface(s)</td> |
255 | 431 |
<td width="78%" class="vtable"> |
256 |
<select name="members[]" multiple="true" class="formselect">
|
|
432 |
<select name="interfaces[]" multiple="true" class="formselect">
|
|
257 | 433 |
<?php |
258 | 434 |
foreach ($portlist as $ifn => $ifinfo) |
259 | 435 |
if (is_jumbo_capable($ifn)) { |
260 | 436 |
echo "<option value=\"{$ifn}\""; |
261 |
if ($ifn == $pconfig['if'])
|
|
437 |
if (stristr($pconfig['interfaces'], $ifn))
|
|
262 | 438 |
echo "selected"; |
263 | 439 |
echo ">"; |
264 | 440 |
echo htmlspecialchars($ifn . " (" . $ifinfo['mac'] . ")"); |
... | ... | |
269 | 445 |
<br/><span class="vexpl">Interfaces participating in the multilink connection.</span> |
270 | 446 |
</td> |
271 | 447 |
</tr> |
272 |
<tr style="display:none;" name="serialports" id="serialports">
|
|
448 |
<tr style="display:none" name="serialport" id="serialport">
|
|
273 | 449 |
<td width="22%" valign="top" class="vncellreq">Member interface(s)</td> |
274 | 450 |
<td width="78%" class="vtable"> |
275 |
<select name="serport" id="serport" multiple="true" class="formselect">
|
|
451 |
<select name="serialports[]" multiple="true" class="formselect">
|
|
276 | 452 |
<?php |
277 | 453 |
$serportlist = glob("/dev/cua*"); |
278 | 454 |
$modems = glob("/dev/modem*"); |
... | ... | |
287 | 463 |
} |
288 | 464 |
?> |
289 | 465 |
</select> |
466 |
<br/><span class="vexpl">Serial Ports participating in the multilink connection.</span> |
|
467 |
<p/> |
|
468 |
<a href='#' onClick='javascript:prefill_att();'>ATT</A> |
|
469 |
<a href='#' onClick='javascript:prefill_sprint();'>Sprint</A> |
|
470 |
<a href='#' onClick='javascript:prefill_vzw();'>Verizon</A> |
|
290 | 471 |
</td> |
291 | 472 |
</tr> |
292 | 473 |
|
293 | 474 |
<tr> |
294 | 475 |
<td valign="top" class="vncell">Username</td> |
295 | 476 |
<td class="vtable"> |
296 |
<input name="username" type="text" class="formfld unknown" id="username" size="10" value="<?=htmlspecialchars($pconfig['username']);?>">
|
|
477 |
<input name="username" type="text" class="formfld usr" id="username" size="10" value="<?=htmlspecialchars($pconfig['username']);?>">
|
|
297 | 478 |
</td> |
298 | 479 |
</tr> |
299 | 480 |
<tr> |
300 | 481 |
<td valign="top" class="vncell">Password</td> |
301 | 482 |
<td class="vtable"> |
302 |
<input name="password" type="text" class="formfld unknown" id="password" size="2" value="<?=htmlspecialchars($pconfig['password']);?>">
|
|
483 |
<input name="password" type="text" class="formfld pwd" id="password" value="<?=htmlspecialchars($pconfig['password']);?>">
|
|
303 | 484 |
</td> |
304 | 485 |
</tr> |
305 | 486 |
<tr> |
... | ... | |
319 | 500 |
<tr> |
320 | 501 |
<td valign="top" class="vncell">Idle Timeout</td> |
321 | 502 |
<td class="vtable"> |
322 |
<input name="timeout" type="text" class="formfld unknown" id="timeout" size="6" value="<?=htmlspecialchars($pconfig['timeout']);?>"> |
|
503 |
<input name="timeout" type="text" class="formfld unknown" id="timeout" size="6" value="<?=htmlspecialchars($pconfig['idletimeout']);?>">
|
|
323 | 504 |
<br> <span class="vexpl">Idle Timeout goes with the OnDemand selection above. If OnDemand is not checked this is ignored.</span> |
324 | 505 |
</td> |
325 | 506 |
</tr> |
... | ... | |
333 | 514 |
<tr> |
334 | 515 |
<td colspan="2" valign="top" height="16"></td> |
335 | 516 |
</tr> |
336 |
|
|
337 |
<tr style="display:none;" name="select" id="select"> |
|
517 |
<tr style="display:none" name="select" id="select"> |
|
338 | 518 |
</tr> |
339 |
<tr style="display:none;" name="ppp" id="ppp">
|
|
519 |
<tr style="display:none" name="ppp" id="ppp"> |
|
340 | 520 |
<td colspan="2" style="padding:0px;"> |
341 | 521 |
<table width="100%" border="0" cellpadding="6" cellspacing="0"> |
342 | 522 |
<tr> |
343 | 523 |
<td colspan="2" valign="top" class="listtopic">PPP configuration</td> |
344 | 524 |
</tr> |
345 |
<tr> |
|
346 |
<td width="22%" valign="top" class="vncell">Pre-fill Settings</td> |
|
347 |
<td width="78%" class="vtable"> |
|
348 |
<a href='#' onClick='javascript:prefill_att();'>ATT</A> |
|
349 |
<a href='#' onClick='javascript:prefill_sprint();'>Sprint</A> |
|
350 |
<a href='#' onClick='javascript:prefill_vzw();'>Verizon</A> |
|
351 |
</td> |
|
352 |
</tr> |
|
353 | 525 |
<tr> |
354 | 526 |
<td width="22%" valign="top" class="vncell">Init String</td> |
355 | 527 |
<td width="78%" class="vtable"> |
356 |
<input type="text" size="40" class="formfld unknown" id="initstr" name="initstr"><?=htmlspecialchars($pconfig['initstr']);?> |
|
357 |
<br><span class="vexpl">Note: Enter the modem initialization string here. Do NOT include the "AT" string at the beginning of the command.</span> |
|
528 |
<input type="text" size="40" class="formfld unknown" id="initstr" name="initstr" value="<?=htmlspecialchars($pconfig['initstr']);?>"> |
|
529 |
<br><span class="vexpl">Note: Enter the modem initialization string here. Do NOT include the "AT" string at the beginning of the command. Many modern USB 3G |
|
530 |
modems don't need an initialization string.</span> |
|
358 | 531 |
</td> |
359 | 532 |
</tr> |
360 | 533 |
<tr> |
... | ... | |
405 | 578 |
<br><span class="vexpl">Note: Enter the remote IP here if not automatically assigned. This is where the packets will be routed.</span> |
406 | 579 |
</td> |
407 | 580 |
</tr> |
408 |
<tr> |
|
409 | 581 |
<tr> |
410 | 582 |
<td width="22%" valign="top" class="vncell">Connection Timeout</td> |
411 | 583 |
<td width="78%" class="vtable"> |
... | ... | |
416 | 588 |
</table> |
417 | 589 |
</td> |
418 | 590 |
</tr> |
419 |
<tr style="display:none;" name="pppoe" id="pppoe">
|
|
591 |
<tr style="display:none" name="pppoe" id="pppoe"> |
|
420 | 592 |
<td colspan="2" style="padding:0px;"> |
421 | 593 |
<table width="100%" border="0" cellpadding="6" cellspacing="0"> |
422 | 594 |
<tr> |
... | ... | |
428 | 600 |
<br> <span class="vexpl">Hint: this field can usually be left empty</span> |
429 | 601 |
</td> |
430 | 602 |
</tr> |
603 |
<tr> |
|
604 |
<td width="22%" valign="top" class="vncell"><?=gettext("Periodic reset");?></td> |
|
605 |
<td width="78%" class="vtable"> |
|
606 |
<input name="pppoe_preset" type="checkbox" id="pppoe_preset" value="yes" <?php if ($pconfig['pppoe_preset']) echo "checked=\"checked\""; ?> onclick="show_periodic_reset(this);" /> |
|
607 |
<?= gettext("enable periodic PPPoE resets"); ?> |
|
608 |
<br /> |
|
609 |
<?php if ($pconfig['pppoe_preset']): ?> |
|
610 |
<table id="presetwrap" cellspacing="0" cellpadding="0" width="100%"> |
|
611 |
<?php else: ?> |
|
612 |
<table id="presetwrap" cellspacing="0" cellpadding="0" width="100%" style="display: none;"> |
|
613 |
<?php endif; ?> |
|
614 |
<tr> |
|
615 |
<td align="left" valign="top"> |
|
616 |
<p style="margin: 4px; padding: 4px 0 4px 0; width: 94%;"> |
|
617 |
<input name="pppoe_pr_type" type="radio" id="pppoe_pr_custom" value="custom" <?php if ($pconfig['pppoe_pr_custom']) echo "checked=\"checked\""; ?> onclick="if (this.checked) { Effect.Appear('pppoecustomwrap', { duration: 0.0 }); Effect.Fade('pppoepresetwrap', { duration: 0.0 }); }" /> |
|
618 |
<?= gettext("provide a custom reset time"); ?> |
|
619 |
<br /> |
|
620 |
<input name="pppoe_pr_type" type="radio" id="pppoe_pr_preset" value="preset" <?php if ($pconfig['pppoe_pr_preset']) echo "checked=\"checked\""; ?> onclick="if (this.checked) { Effect.Appear('pppoepresetwrap', { duration: 0.0 }); Effect.Fade('pppoecustomwrap', { duration: 0.0 }); }" /> |
|
621 |
<?= gettext("select reset time from a preset"); ?> |
|
622 |
</p> |
|
623 |
<?php if ($pconfig['pppoe_pr_custom']): ?> |
|
624 |
<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoecustomwrap"> |
|
625 |
<?php else: ?> |
|
626 |
<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoecustomwrap"> |
|
627 |
<?php endif; ?> |
|
628 |
<input type="text" name="pppoe_resethour" class="fd_incremental_inp_range_0_23 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resethour" value="<?= $pconfig['pppoe_resethour']; ?>" size="3" /> |
|
629 |
<?= gettext("hour (0-23)"); ?><br /> |
|
630 |
<input type="text" name="pppoe_resetminute" class="fd_incremental_inp_range_0_59 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resetminute" value="<?= $pconfig['pppoe_resetminute']; ?>" size="3" /> |
|
631 |
<?= gettext("minute (0-59)"); ?><br /> |
|
632 |
<input name="pppoe_resetdate" type="text" class="w8em format-m-d-y highlight-days-67" id="pppoe_resetdate" maxlength="10" size="10" value="<?=htmlspecialchars($pconfig['pppoe_resetdate']);?>" /> |
|
633 |
<?= gettext("reset at a specific date (mm/dd/yyyy)"); ?> |
|
634 |
<br /> <br /> |
|
635 |
<span class="red"><strong>Note: </strong></span> |
|
636 |
If you leave the date field empty, the reset will be executed each day at the time you did specify using the minutes and hour field. |
|
637 |
</p> |
|
638 |
<?php if ($pconfig['pppoe_pr_preset']): ?> |
|
639 |
<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoepresetwrap"> |
|
640 |
<?php else: ?> |
|
641 |
<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoepresetwrap"> |
|
642 |
<?php endif; ?> |
|
643 |
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_monthly" value="monthly" <?php if ($pconfig['pppoe_monthly']) echo "checked=\"checked\""; ?> /> |
|
644 |
<?= gettext("reset at each month ('0 0 1 * *')"); ?> |
|
645 |
<br /> |
|
646 |
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_weekly" value="weekly" <?php if ($pconfig['pppoe_weekly']) echo "checked=\"checked\""; ?> /> |
|
647 |
<?= gettext("reset at each week ('0 0 * * 0')"); ?> |
|
648 |
<br /> |
|
649 |
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_daily" value="daily" <?php if ($pconfig['pppoe_daily']) echo "checked=\"checked\""; ?> /> |
|
650 |
<?= gettext("reset at each day ('0 0 * * *')"); ?> |
|
651 |
<br /> |
|
652 |
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_hourly" value="hourly" <?php if ($pconfig['pppoe_hourly']) echo "checked=\"checked\""; ?> /> |
|
653 |
<?= gettext("reset at each hour ('0 * * * *')"); ?> |
|
654 |
</p> |
|
655 |
</td> |
|
656 |
</tr> |
|
657 |
</table> |
|
658 |
</td> |
|
659 |
</tr> |
|
431 | 660 |
</table> |
432 | 661 |
</td> |
433 | 662 |
</tr> |
434 |
|
|
435 |
<tr style="display:none;" name="pptp" id="pptp"> |
|
663 |
<tr style="display:none" name="pptp" id="pptp"> |
|
436 | 664 |
<td colspan="2" style="padding:0px;"> |
437 | 665 |
<table width="100%" border="0" cellpadding="6" cellspacing="0"> |
438 | 666 |
<tr> |
... | ... | |
441 | 669 |
<tr> |
442 | 670 |
<td width="22%" width="100" valign="top" class="vncellreq">Local IP address</td> |
443 | 671 |
<td width="78%" class="vtable"> |
444 |
<input name="pptp_local" type="text" class="formfld unknown" id="pptp_local" size="20" value="<?=htmlspecialchars($pconfig['pptp_local']);?>">
|
|
672 |
<input name="localip" type="text" class="formfld unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>">
|
|
445 | 673 |
/ |
446 |
<select name="pptp_subnet" class="formselect" id="pptp_subnet">
|
|
674 |
<select name="subnet" class="formselect" id="subnet">
|
|
447 | 675 |
<?php for ($i = 31; $i > 0; $i--): ?> |
448 | 676 |
<option value="<?=$i;?>" <?php if ($i == $pconfig['pptp_subnet']) echo "selected"; ?>> |
449 | 677 |
<?=$i;?> |
... | ... | |
455 | 683 |
<tr> |
456 | 684 |
<td width="22%" width="100" valign="top" class="vncellreq">Remote IP address</td> |
457 | 685 |
<td width="78%" class="vtable"> |
458 |
<input name="pptp_remote" type="text" class="formfld unknown" id="pptp_remote" size="20" value="<?=htmlspecialchars($pconfig['pptp_remote']);?>">
|
|
686 |
<input name="gateway" type="text" class="formfld unknown" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>">
|
|
459 | 687 |
</td> |
460 | 688 |
</tr> |
461 | 689 |
</table> |
... | ... | |
465 | 693 |
<td colspan="2" valign="top" height="16"></td> |
466 | 694 |
</tr> |
467 | 695 |
<tr> |
468 |
<td colspan="2" valign="top" class="listtopic">Advanced Options <a href="javascript:swapOptions();" class="navlnk">-</a></td>
|
|
696 |
<td colspan="2" valign="top" class="listtopic">Advanced Options</td> |
|
469 | 697 |
</tr> |
470 |
<tr name="advanced" id="postMoreOptions"> |
|
471 |
<td colspan="2" style="padding:0px;"> |
|
472 |
<table width="100%" border="0" cellpadding="6" cellspacing="0"> |
|
473 |
<tr> |
|
474 |
<td width="22%" width="100" valign="top" class="vncell">Bandwidth</td> |
|
475 |
<td class="vtable"> |
|
476 |
<input name="bandwidth" type="text" class="formfld unknown" id="bandwidth" size="6" value="<?=htmlspecialchars($pconfig['bandwidth']);?>"> (bits/sec) |
|
477 |
<br> <span class="vexpl">Set Bandwidth for each link if links have different bandwidths, otherwise, leave blank.</span> |
|
478 |
</td> |
|
479 |
</tr> |
|
480 |
<tr> |
|
481 |
<td width="22%" width="100" valign="top" class="vncell">Link MTU</td> |
|
482 |
<td class="vtable"> |
|
483 |
<input name="bandwidth" type="text" class="formfld unknown" id="bandwidth" size="6" value="<?=htmlspecialchars($pconfig['bandwidth']);?>"> |
|
484 |
<br> <span class="vexpl">Set Bandwidth for each link if links have different bandwidths, otherwise, leave blank.</span> |
|
485 |
</td> |
|
486 |
</tr> |
|
487 |
<tr> |
|
488 |
<td width="22%" width="100" valign="top" class="vncell">Link MRU</td> |
|
489 |
<td class="vtable"> |
|
490 |
<input name="bandwidth" type="text" class="formfld unknown" id="bandwidth" size="6" value="<?=htmlspecialchars($pconfig['bandwidth']);?>"> |
|
491 |
<br> <span class="vexpl">Set Bandwidth for each link if links have different bandwidths, otherwise, leave blank.</span> |
|
492 |
</td> |
|
493 |
</tr> |
|
494 |
</table> |
|
698 |
<tr> |
|
699 |
<td width="22%" valign="top" class="vncell">Options</td> |
|
700 |
<td width="39%" class="vtable"> |
|
701 |
<input type="checkbox" value="on" id="defaultgw" name="defaultgw" <?php if (isset($pconfig['defaultgw'])) echo "checked"; ?>>Disable vjcomp(compression). |
|
702 |
</td> |
|
703 |
<td width="39%" class="vtable"> |
|
704 |
<input type="checkbox" value="on" id="defaultgw" name="defaultgw" <?php if (isset($pconfig['defaultgw'])) echo "checked"; ?>>Enable tcpmssfix. |
|
495 | 705 |
</td> |
496 | 706 |
</tr> |
497 |
|
|
707 |
<tr> |
|
708 |
<td width="22%" width="100" valign="top" class="vncell">Bandwidth</td> |
|
709 |
<td width="78%" class="vtable"> |
|
710 |
<input name="bandwidth" type="text" class="formfld unknown" id="bandwidth" size="6" value="<?=htmlspecialchars($pconfig['bandwidth']);?>"> (bits/sec) |
|
711 |
<br> <span class="vexpl">Set Bandwidth for each link *if* links have different bandwidths, otherwise, leave blank.</span> |
|
712 |
</td> |
|
713 |
</tr> |
|
714 |
<tr> |
|
715 |
<td width="22%" width="100" valign="top" class="vncell">Link MTU/MRU</td> |
|
716 |
<td width="39%" class="vtable"> |
|
717 |
<input name="mtu" type="text" class="formfld unknown" id="mtu" size="6" value="<?=htmlspecialchars($pconfig['mtu']);?>"> |
|
718 |
<br> <span class="vexpl">Set MTU for each link if links have different bandwidths, otherwise, leave blank.</span> |
|
719 |
</td> |
|
720 |
<? /*</tr> |
|
721 |
<tr> |
|
722 |
<td width="22%" width="100" valign="top" class="vncell">Link MRU</td> */?> |
|
723 |
<td width="39%" class="vtable"> |
|
724 |
<input name="mru" type="text" class="formfld unknown" id="mru" size="6" value="<?=htmlspecialchars($pconfig['mru']);?>"> |
|
725 |
<br> <span class="vexpl">Set MRU for each link separated by commas, otherwise, leave blank.</span> |
|
726 |
</td> |
|
727 |
</tr> |
|
498 | 728 |
<tr> |
499 | 729 |
<td width="22%" valign="top"> </td> |
500 | 730 |
<td width="78%"> |
501 |
<input type="hidden" name="mlpppif" value="<?=$pconfig['mlpppif']; ?>"> |
|
502 | 731 |
<input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" value="Cancel" onclick="history.back()"> |
503 |
<?php if (isset($id) && $a_mlppps[$id]): ?>
|
|
732 |
<?php if (isset($id) && $a_ppps[$id]): ?> |
|
504 | 733 |
<input name="id" type="hidden" value="<?=$id;?>"> |
505 | 734 |
<?php endif; ?> |
506 | 735 |
</td> |
Also available in: Unified diff
Still working on GUI for mlppp. . .