Project

General

Profile

Download (39.9 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	interfaces_ppps_edit.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6

    
7
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9
	Copyright (C) 2010 Gabriel B. <gnoahb@gmail.com>.
10
	All rights reserved.
11
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
12
	All rights reserved.
13

    
14
	Redistribution and use in source and binary forms, with or without
15
	modification, are permitted provided that the following conditions are met:
16

    
17
	1. Redistributions of source code must retain the above copyright notice,
18
	   this list of conditions and the following disclaimer.
19

    
20
	2. Redistributions in binary form must reproduce the above copyright
21
	   notice, this list of conditions and the following disclaimer in the
22
	   documentation and/or other materials provided with the distribution.
23

    
24
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
25
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
26
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
28
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
	POSSIBILITY OF SUCH DAMAGE.
34
*/
35
/*
36
	pfSense_MODULE:	interfaces
37
*/
38

    
39
##|+PRIV
40
##|*IDENT=page-interfaces-ppps-edit
41
##|*NAME=Interfaces: PPPs: Edit page
42
##|*DESCR=Allow access to the 'Interfaces: PPPs: Edit' page.
43
##|*MATCH=interfaces_ppps_edit.php*
44
##|-PRIV
45

    
46
require("guiconfig.inc");
47
require("functions.inc");
48

    
49
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_ppps.php');
50

    
51
define("CRON_MONTHLY_PATTERN", "0 0 1 * *");
52
define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
53
define("CRON_DAILY_PATTERN", "0 0 * * *");
54
define("CRON_HOURLY_PATTERN", "0 * * * *");
55

    
56
if (!is_array($config['ppps']['ppp'])) {
57
	$config['ppps']['ppp'] = array();
58
}
59

    
60
$a_ppps = &$config['ppps']['ppp'];
61

    
62
$iflist = get_configured_interface_with_descr();
63
$portlist = get_interface_list();
64
$portlist = array_merge($portlist, $iflist);
65

    
66
if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) {
67
	foreach ($config['vlans']['vlan'] as $vlan) {
68
		$portlist[$vlan['vlanif']] = $vlan;
69
	}
70
}
71

    
72
if (is_numericint($_GET['id'])) {
73
	$id = $_GET['id'];
74
}
75
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
76
	$id = $_POST['id'];
77
}
78

    
79
if (isset($id) && $a_ppps[$id]) {
80
	$pconfig['ptpid'] = $a_ppps[$id]['ptpid'];
81
	$pconfig['type'] = $a_ppps[$id]['type'];
82
	//$pconfig['if'] = $a_ppps[$id]['if'];
83
	$pconfig['interfaces'] = $a_ppps[$id]['ports'];
84
	$pconfig['username'] = $a_ppps[$id]['username'];
85
	$pconfig['password'] = base64_decode($a_ppps[$id]['password']);
86
	if (isset($a_ppps[$id]['ondemand'])) {
87
		$pconfig['ondemand'] = true;
88
	}
89
	$pconfig['idletimeout'] = $a_ppps[$id]['idletimeout'];
90
	$pconfig['uptime'] = $a_ppps[$id]['uptime'];
91
	$pconfig['descr'] = $a_ppps[$id]['descr'];
92
	$pconfig['bandwidth'] = explode(",",$a_ppps[$id]['bandwidth']);
93
	$pconfig['mtu'] = explode(",",$a_ppps[$id]['mtu']);
94
	$pconfig['mru'] = explode(",",$a_ppps[$id]['mru']);
95
	$pconfig['mrru'] = explode(",",$a_ppps[$id]['mrru']);
96
	if (isset($a_ppps[$id]['shortseq'])) {
97
		$pconfig['shortseq'] = true;
98
	}
99
	if (isset($a_ppps[$id]['acfcomp'])) {
100
		$pconfig['acfcomp'] = true;
101
	}
102
	if (isset($a_ppps[$id]['protocomp'])) {
103
		$pconfig['protocomp'] = true;
104
	}
105
	if (isset($a_ppps[$id]['vjcomp'])) {
106
		$pconfig['vjcomp'] = true;
107
	}
108
	if (isset($a_ppps[$id]['tcpmssfix'])) {
109
		$pconfig['tcpmssfix'] = true;
110
	}
111
	switch ($a_ppps[$id]['type']) {
112
		case "ppp":
113
			$pconfig['initstr'] = base64_decode($a_ppps[$id]['initstr']);
114
			$pconfig['simpin'] = $a_ppps[$id]['simpin'];
115
			$pconfig['pin-wait'] = $a_ppps[$id]['pin-wait'];
116
			$pconfig['apn'] = $a_ppps[$id]['apn'];
117
			$pconfig['apnum'] = $a_ppps[$id]['apnum'];
118
			$pconfig['phone'] = $a_ppps[$id]['phone'];
119
			$pconfig['connect-timeout'] = $a_ppps[$id]['connect-timeout'];
120
			$pconfig['localip'] = explode(",",$a_ppps[$id]['localip']);
121
			$pconfig['gateway'] = explode(",",$a_ppps[$id]['gateway']);
122
			break;
123
		case "l2tp":
124
		case "pptp":
125
			$pconfig['localip'] = explode(",",$a_ppps[$id]['localip']);
126
			$pconfig['subnet'] = explode(",",$a_ppps[$id]['subnet']);
127
			$pconfig['gateway'] = explode(",",$a_ppps[$id]['gateway']);
128
		case "pppoe":
129
			$pconfig['provider'] = $a_ppps[$id]['provider'];
130
			if (isset($a_ppps[$id]['provider']) and empty($a_ppps[$id]['provider'])) {
131
				$pconfig['null_service'] = true;
132
			}
133
			/* ================================================ */
134
			/* = force a connection reset at a specific time? = */
135
			/* ================================================ */
136

    
137
			if (isset($a_ppps[$id]['pppoe-reset-type'])) {
138
				$pconfig['pppoe-reset-type'] = $a_ppps[$id]['pppoe-reset-type'];
139
				$itemhash = getMPDCRONSettings($a_ppps[$id]['if']);
140
				$cronitem = $itemhash['ITEM'];
141
				if (isset($cronitem)) {
142
					$resetTime = "{$cronitem['minute']} {$cronitem['hour']} {$cronitem['mday']} {$cronitem['month']} {$cronitem['wday']}";
143
				} else {
144
					$resetTime = NULL;
145
				}
146

    
147
				if ($a_ppps[$id]['pppoe-reset-type'] == "custom") {
148
					$resetTime_a = explode(" ", $resetTime);
149
					$pconfig['pppoe_pr_custom'] = true;
150
					$pconfig['pppoe_resetminute'] = $resetTime_a[0];
151
					$pconfig['pppoe_resethour'] = $resetTime_a[1];
152
					/*  just initialize $pconfig['pppoe_resetdate'] if the
153
					 *  corresponding item contains appropriate numeric values.
154
					 */
155
					if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*") {
156
						$pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y");
157
					}
158
				} else if ($a_ppps[$id]['pppoe-reset-type'] == "preset") {
159
					$pconfig['pppoe_pr_preset'] = true;
160
					switch ($resetTime) {
161
						case CRON_MONTHLY_PATTERN:
162
							$pconfig['pppoe_monthly'] = true;
163
							break;
164
						case CRON_WEEKLY_PATTERN:
165
							$pconfig['pppoe_weekly'] = true;
166
							break;
167
						case CRON_DAILY_PATTERN:
168
							$pconfig['pppoe_daily'] = true;
169
							break;
170
						case CRON_HOURLY_PATTERN:
171
							$pconfig['pppoe_hourly'] = true;
172
							break;
173
					}
174
				}
175
			}
176
			break;
177
	}
178

    
179
} else {
180
	$pconfig['ptpid'] = interfaces_ptpid_next();
181
}
182

    
183
if ($_POST) {
184

    
185
	unset($input_errors);
186
	$pconfig = $_POST;
187

    
188
	/* okay first of all, cause we are just hiding the PPPoE HTML
189
	 * fields related to PPPoE resets, we are going to unset $_POST
190
	 * vars, if the reset feature should not be used. Otherwise the
191
	 * data validation procedure below, may trigger a false error
192
	 * message.
193
	 */
194
	if (empty($_POST['pppoe-reset-type'])) {
195
		unset($_POST['pppoe_resethour']);
196
		unset($_POST['pppoe_resetminute']);
197
		unset($_POST['pppoe_resetdate']);
198
		unset($_POST['pppoe_pr_preset_val']);
199
	}
200

    
201
	/* input validation */
202
	switch ($_POST['type']) {
203
		case "ppp":
204
			$reqdfields = explode(" ", "interfaces phone");
205
			$reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Phone Number"));
206
			do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
207
			break;
208
		case "pppoe":
209
			if ($_POST['ondemand']) {
210
				$reqdfields = explode(" ", "interfaces username passwordfld ondemand idletimeout");
211
				$reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"),gettext("Dial on demand"),gettext("Idle timeout value"));
212
			} else {
213
				$reqdfields = explode(" ", "interfaces username passwordfld");
214
				$reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"));
215
			}
216
			do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
217
			break;
218
		case "l2tp":
219
		case "pptp":
220
			if ($_POST['ondemand']) {
221
				$reqdfields = explode(" ", "interfaces username passwordfld localip subnet gateway ondemand idletimeout");
222
				$reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"),gettext("Local IP address"),gettext("Subnet"),gettext("Remote IP address"),gettext("Dial on demand"),gettext("Idle timeout value"));
223
			} else {
224
				$reqdfields = explode(" ", "interfaces username passwordfld localip subnet gateway");
225
				$reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"),gettext("Local IP address"),gettext("Subnet"),gettext("Remote IP address"));
226
			}
227
			do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
228
			break;
229
		default:
230
			$input_errors[] = gettext("Please choose a Link Type.");
231
			break;
232
	}
233
	if ($_POST['type'] == "ppp" && count($_POST['interfaces']) > 1) {
234
		$input_errors[] = gettext("Multilink connections (MLPPP) using the PPP link type is not currently supported. Please select only one Link Interface.");
235
	}
236
	if ($_POST['provider'] && !is_domain($_POST['provider'])) {
237
		$input_errors[] = gettext("The Service name contains invalid characters.");
238
	}
239
	if ($_POST['provider'] && $_POST['null_service']) {
240
		$input_errors[] = gettext("Do not specify both a Service name and a NULL Service name.");
241
	}
242
	if (($_POST['idletimeout'] != "") && !is_numericint($_POST['idletimeout'])) {
243
		$input_errors[] = gettext("The idle timeout value must be an integer.");
244
	}
245
	if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resethour'] <> "" && !is_numericint($_POST['pppoe_resethour']) &&
246
	    $_POST['pppoe_resethour'] >= 0 && $_POST['pppoe_resethour'] <=23) {
247
		$input_errors[] = gettext("A valid PPPoE reset hour must be specified (0-23).");
248
	}
249
	if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetminute'] <> "" && !is_numericint($_POST['pppoe_resetminute']) &&
250
	    $_POST['pppoe_resetminute'] >= 0 && $_POST['pppoe_resetminute'] <=59) {
251
		$input_errors[] = gettext("A valid PPPoE reset minute must be specified (0-59).");
252
	}
253
	if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetdate'] <> "" && !is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))) {
254
		$input_errors[] = gettext("A valid PPPoE reset date must be specified (mm/dd/yyyy).");
255
	}
256
	if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetdate'] <> "" && is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))) {
257
		$date_nums = explode("/",$_POST['pppoe_resetdate']);
258
		if ($date_nums[0] < 1 || $date_nums[0] > 12) {
259
			$input_errors[] = gettext("A valid PPPoE reset month must be specified (1-12) in the Custom PPPoE Periodic reset fields.");
260
		}
261
		if ($date_nums[1] < 1 || $date_nums[1] > 31) {
262
			$input_errors[] = gettext("A valid PPPoE reset day of month must be specified (1-31) in the Custom PPPoE Periodic reset fields. No checks are done on valid # of days per month");
263
		}
264
		if ($date_nums[2] < date("Y")) {
265
			$input_errors[] = gettext("A valid PPPoE reset year must be specified. Don't select a year in the past!");
266
		}
267
	}
268

    
269
	foreach ($_POST['interfaces'] as $iface) {
270
		if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface])) {
271
			$input_errors[] = sprintf(gettext("A valid local IP address must be specified for %s."),$iface);
272
		}
273
		if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface])) {
274
			$input_errors[] = sprintf(gettext("A valid gateway IP address OR hostname must be specified for %s."),$iface);
275
		}
276
		if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface])) {
277
			$input_errors[] = sprintf(gettext("The bandwidth value for %s must be an integer."),$iface);
278
		}
279
		if ($_POST['mtu'][$iface] && ($_POST['mtu'][$iface] < 576)) {
280
			$input_errors[] = sprintf(gettext("The MTU for %s must be greater than 576 bytes."),$iface);
281
		}
282
		if ($_POST['mru'][$iface] && ($_POST['mru'][$iface] < 576)) {
283
			$input_errors[] = sprintf(gettext("The MRU for %s must be greater than 576 bytes."),$iface);
284
		}
285
	}
286

    
287
/*
288
	foreach ($a_ppps as $ppp) {
289
		if (isset($id) && ($a_ppps[$id]) && ($a_ppps[$id] === $ppp)) {
290
			continue;
291
		}
292

    
293
		if ($ppp['serialport'] == $_POST['serialport']) {
294
			$input_errors[] = "Serial port is in use";
295
			break;
296
		}
297
	}
298
*/
299

    
300
	if (!$input_errors) {
301
		$ppp = array();
302
		$ppp['ptpid'] = $_POST['ptpid'];
303
		$ppp['type'] = $_POST['type'];
304
		$ppp['if'] = $ppp['type'].$ppp['ptpid'];
305
		$ppp['ports'] = implode(',',$_POST['interfaces']);
306
		$ppp['username'] = $_POST['username'];
307
		$ppp['password'] = base64_encode($_POST['passwordfld']);
308
		$ppp['ondemand'] = $_POST['ondemand'] ? true : false;
309
		if (!empty($_POST['idletimeout'])) {
310
			$ppp['idletimeout'] = $_POST['idletimeout'];
311
		} else {
312
			unset($ppp['idletimeout']);
313
		}
314
		$ppp['uptime'] = $_POST['uptime'] ? true : false;
315
		if (!empty($_POST['descr'])) {
316
			$ppp['descr'] = $_POST['descr'];
317
		} else {
318
			unset($ppp['descr']);
319
		}
320

    
321
		// Loop through fields associated with an individual link/port and make an array of the data
322
		$port_fields = array("localip", "gateway", "subnet", "bandwidth", "mtu", "mru", "mrru");
323
		foreach ($_POST['interfaces'] as $iface) {
324
			foreach ($port_fields as $field_label) {
325
				if (isset($_POST[$field_label][$iface])) {
326
					$port_data[$field_label][] = $_POST[$field_label][$iface];
327
				}
328
			}
329
		}
330

    
331
		switch ($_POST['type']) {
332
			case "ppp":
333
				if (!empty($_POST['initstr'])) {
334
					$ppp['initstr'] = base64_encode($_POST['initstr']);
335
				} else {
336
					unset($ppp['initstr']);
337
				}
338
				if (!empty($_POST['simpin'])) {
339
					$ppp['simpin'] = $_POST['simpin'];
340
					$ppp['pin-wait'] = $_POST['pin-wait'];
341
				} else {
342
					unset($ppp['simpin']);
343
					unset($ppp['pin-wait']);
344
				}
345

    
346
				if (!empty($_POST['apn'])) {
347
					$ppp['apn'] = $_POST['apn'];
348
					$ppp['apnum'] = $_POST['apnum'];
349
				} else {
350
					unset($ppp['apn']);
351
					unset($ppp['apnum']);
352
				}
353
				$ppp['phone'] = $_POST['phone'];
354
				$ppp['localip'] = implode(',',$port_data['localip']);
355
				$ppp['gateway'] = implode(',',$port_data['gateway']);
356
				if (!empty($_POST['connect-timeout'])) {
357
					$ppp['connect-timeout'] = $_POST['connect-timeout'];
358
				} else {
359
					unset($ppp['connect-timeout']);
360
				}
361
				break;
362
			case "pppoe":
363
				if (!empty($_POST['provider'])) {
364
					$ppp['provider'] = $_POST['provider'];
365
				} else {
366
					unset($ppp['provider']);
367
					$ppp['provider'] = $_POST['null_service'] ? true : false;
368
				}
369
				if (!empty($_POST['pppoe-reset-type'])) {
370
					$ppp['pppoe-reset-type'] = $_POST['pppoe-reset-type'];
371
				} else {
372
					unset($ppp['pppoe-reset-type']);
373
				}
374

    
375
				break;
376
			case "pptp":
377
			case "l2tp":
378
				$ppp['localip'] = implode(',',$port_data['localip']);
379
				$ppp['subnet'] = implode(',',$port_data['subnet']);
380
				$ppp['gateway'] = implode(',',$port_data['gateway']);
381
				break;
382
			default:
383
				break;
384

    
385
		}
386

    
387
		$ppp['shortseq'] = $_POST['shortseq'] ? true : false;
388
		$ppp['acfcomp'] = $_POST['acfcomp'] ? true : false;
389
		$ppp['protocomp'] = $_POST['protocomp'] ? true : false;
390
		$ppp['vjcomp'] = $_POST['vjcomp'] ? true : false;
391
		$ppp['tcpmssfix'] = $_POST['tcpmssfix'] ? true : false;
392
		$ppp['bandwidth'] = implode(',', $port_data['bandwidth']);
393
		if (is_array($port_data['mtu'])) {
394
			$ppp['mtu'] = implode(',', $port_data['mtu']);
395
		}
396
		if (is_array($port_data['mru'])) {
397
			$ppp['mru'] = implode(',', $port_data['mru']);
398
		}
399
		if (is_array($port_data['mrru'])) {
400
			$ppp['mrru'] = implode(',', $port_data['mrru']);
401
		}
402

    
403
		/* handle_pppoe_reset is called here because if user changes Link Type from PPPoE to another type we
404
		must be able to clear the config data in the <cron> section of config.xml if it exists
405
		*/
406
		handle_pppoe_reset($_POST);
407

    
408
		if (isset($id) && $a_ppps[$id]) {
409
			$a_ppps[$id] = $ppp;
410
		} else {
411
			$a_ppps[] = $ppp;
412
		}
413

    
414
		write_config();
415
		configure_cron();
416

    
417
		foreach ($iflist as $pppif => $ifdescr) {
418
			if ($config['interfaces'][$pppif]['if'] == $ppp['if']) {
419
				interface_ppps_configure($pppif);
420
			}
421
		}
422
		header("Location: interfaces_ppps.php");
423
		exit;
424
	}
425
} // end if ($_POST)
426

    
427
$closehead = false;
428
$pgtitle = array(gettext("Interfaces"),gettext("PPPs"),gettext("Edit"));
429
$shortcut_section = "interfaces";
430
include("head.inc");
431

    
432
$types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP",  "l2tp" => "L2TP"/*, "tcp" => "TCP", "udp" => "UDP"*/);
433

    
434
?>
435
	<script type="text/javascript" src="/javascript/numericupdown/js/numericupdown.js"></script>
436
	<link href="/javascript/numericupdown/css/numericupdown.css" rel="stylesheet" type="text/css" />
437
	<script type="text/javascript" src="/javascript/datepicker/js/datepicker.js"></script>
438
	<link href="/javascript/datepicker/css/datepicker.css" rel="stylesheet" type="text/css"/>
439
	<script type="text/javascript">
440
	//<![CDATA[
441
		jQuery(document).ready(function() { updateType(<?php echo "'{$pconfig['type']}'";?>); });
442
	//]]>
443
	</script>
444
</head>
445
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" >
446
<?php include("fbegin.inc"); ?>
447
<?php if ($input_errors) print_input_errors($input_errors); ?>
448
<form action="interfaces_ppps_edit.php" method="post" name="iform" id="iform">
449
	<table id="interfacetable" width="100%" border="0" cellpadding="6" cellspacing="0" summary="interfaces ppps edit">
450
		<tr>
451
			<td colspan="2" valign="top" class="listtopic"><?= gettext("PPPs configuration"); ?></td>
452
		</tr>
453
		<tr>
454
			<td valign="middle" class="vncell"><strong><?= gettext("Link Type"); ?></strong></td>
455
			<td class="vtable">
456
				<select name="type" onchange="updateType(this.value);" class="formselect" id="type">
457
				<?php
458
					foreach ($types as $key => $opt) {
459
						echo "<option onclick=\"updateType('{$key}');\"";
460
						if ($key == $pconfig['type']) {
461
							echo " selected=\"selected\"";
462
						}
463
						echo " value=\"{$key}\" >" . htmlspecialchars($opt) . "</option>";
464
					}
465
				?>
466
				</select>
467
			</td>
468
		</tr>
469
		<tr name="interface" id="interface" >
470
			<td width="22%" valign="top" class="vncellreq"><?= gettext("Link interface(s)"); ?></td>
471
			<td width="78%" class="vtable">
472
				<select style="vertical-align:top" name="interfaces[]" multiple="multiple" class="formselect" size="4" onchange="show_hide_linkfields(this.options);">
473
					<option></option>
474
				</select>
475
				<br />
476
				<span class="vexpl"><?= gettext("Select at least two interfaces for Multilink (MLPPP) connections."); ?></span>
477
			</td>
478
		</tr>
479
		<tr style="display:none" name="portlists" id="portlists">
480
			<td id="serialports">
481
			<?php
482
				$selected_ports = explode(',',$pconfig['interfaces']);
483
				if (!is_dir("/var/spool/lock")) {
484
					mwexec("/bin/mkdir -p /var/spool/lock");
485
				}
486
				// $serialports = pfSense_get_modem_devices();
487
				$serialports = glob("/dev/cua?[0-9]{,.[0-9]}", GLOB_BRACE);
488
				$serport_count = 0;
489
				foreach ($serialports as $port) {
490
					$serport_count++;
491
					echo $port.",".trim($port);
492
					if (in_array($port, $selected_ports)) {
493
						echo ",1|";
494
					} else {
495
						echo ",|";
496
					}
497
				}
498
				echo $serport_count;
499
			?>
500
			</td>
501
			<td id="ports">
502
			<?php
503
				$port_count = 0;
504
				foreach ($portlist as $ifn => $ifinfo) {
505
				$port_count++;
506
					$string = "";
507
					if (is_array($ifinfo)) {
508
						$string .= $ifn;
509
						if ($ifinfo['mac']) {
510
							$string .= " ({$ifinfo['mac']})";
511
						}
512
					} else {
513
						$string .= $ifinfo;
514
					}
515
					$string .= ",{$ifn}";
516
					echo htmlspecialchars($string);
517
					if (in_array($ifn, $selected_ports)) {
518
						echo ",1|";
519
					} else {
520
						echo ",|";
521
					}
522
				}
523
				echo $port_count;
524
				if ($serport_count > $port_count) {
525
					$port_count = $serport_count;
526
				}
527
			?>
528
			</td>
529
			<td style="display:none" name="port_count" id="port_count"><?=htmlspecialchars($port_count);?></td>
530
		</tr>
531
		<tr>
532
			<td width="22%" valign="top" class="vncell"><?= gettext("Description"); ?></td>
533
			<td width="78%" class="vtable">
534
				<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
535
				<br />
536
				<span class="vexpl"><?= gettext("You may enter a description here for your reference. Description will appear in the \"Interfaces Assign\" select lists."); ?></span>
537
			</td>
538
		</tr>
539
		<tr style="display:none" name="select" id="select"><td style="display:none"></td></tr>
540
		<?php
541
			$k=0;
542
		?>
543
		<tr style="display:none" name="ppp_provider" id="ppp_provider">
544
			<td width="22%" valign="top" class="vncell">
545
				<?= gettext("Service Provider"); ?>
546
			</td>
547
			<td width="78%" class="vtable">
548
				<table border="0" cellpadding="0" cellspacing="0" summary="service provider">
549
					<tr id="trcountry" style="display:none">
550
						<td><?= gettext("Country:"); ?> &nbsp;&nbsp;</td>
551
						<td>
552
							<select class="formselect" name="country" id="country" onchange="providers_list()">
553
								<option></option>
554
							</select>
555
						</td>
556
					</tr>
557
					<tr id="trprovider" style="display:none">
558
						<td><?= gettext("Provider:"); ?> &nbsp;&nbsp;</td>
559
						<td>
560
							<select class="formselect" name="provider" id="provider" onchange="providerplan_list()">
561
								<option></option>
562
							</select>
563
						</td>
564
					</tr>
565
					<tr id="trproviderplan" style="display:none">
566
						<td><?= gettext("Plan:"); ?> &nbsp;&nbsp;</td>
567
						<td>
568
							<select class="formselect" name="providerplan" id="providerplan" onchange="prefill_provider()">
569
								<option></option>
570
							</select>
571
						</td>
572
					</tr>
573
				</table>
574
				<br /><span class="vexpl"><?= gettext("Select to fill in data for your service provider."); ?></span>
575
			</td>
576
		</tr>
577
		<tr>
578
			<td width="22%" valign="top" class="vncell"><?= gettext("Username"); ?></td>
579
			<td width="78%" class="vtable">
580
				<input name="username" type="text" class="formfld user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>" />
581
			</td>
582
		</tr>
583
		<tr>
584
			<td width="22%" valign="top" class="vncell"><?= gettext("Password"); ?></td>
585
			<td width="78%" class="vtable">
586
				<input name="passwordfld" type="password" class="formfld pwd" id="passwordfld" size="20" value="<?=htmlspecialchars($pconfig['password']);?>" />
587
			</td>
588
		</tr>
589

    
590
		<tr style="display:none" name="phone_num" id="phone_num">
591
			<td width="22%" valign="top" class="vncellreq"><?= gettext("Phone Number"); ?></td>
592
			<td width="78%" class="vtable">
593
				<input name="phone" type="text" class="formfld unknown" id="phone" size="40" value="<?=htmlspecialchars($pconfig['phone']);?>" />
594
				<br />
595
				<span class="vexpl"><?= gettext("Note: Typically *99# for GSM networks and #777 for CDMA networks"); ?></span>
596
			</td>
597
		</tr>
598
		<tr style="display:none" name="apn_" id="apn_">
599
			<td width="22%" valign="top" class="vncell"><?= gettext("Access Point Name (APN)"); ?></td>
600
			<td width="78%" class="vtable">
601
				<input name="apn" type="text" class="formfld unknown" id="apn" size="40" value="<?=htmlspecialchars($pconfig['apn']);?>" />
602
			</td>
603
		</tr>
604

    
605
		<tr style="display:none" name="ppp" id="ppp">
606
			<td colspan="2" style="padding:0px;">
607
				<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="advanced">
608
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
609
						<td width="22%" valign="top" class="vncell"><?= gettext("APN number (optional)"); ?></td>
610
						<td width="78%" class="vtable">
611
							<input name="apnum" type="text" class="formfld unknown" id="apnum" size="2" value="<?=htmlspecialchars($pconfig['apnum']);?>" />
612
							<br />
613
							<span class="vexpl"><?= gettext("Note: Defaults to 1 if you set APN above. Ignored if you set no APN above."); ?></span>
614
						</td>
615
					</tr>
616
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
617
						<td width="22%" valign="top" class="vncell"><?= gettext("SIM PIN"); ?></td>
618
						<td width="78%" class="vtable">
619
							<input name="simpin" type="text" class="formfld unknown" id="simpin" size="12" value="<?=htmlspecialchars($pconfig['simpin']);?>" />
620
						</td>
621
					</tr>
622

    
623
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
624
						<td width="22%" valign="top" class="vncell"><?= gettext("SIM PIN wait"); ?></td>
625
						<td width="78%" class="vtable">
626
							<input name="pin-wait" type="text" class="formfld unknown" id="pin-wait" size="2" value="<?=htmlspecialchars($pconfig['pin-wait']);?>" />
627
							<br />
628
							<span class="vexpl"><?= gettext("Note: Time to wait for SIM to discover network after PIN is sent to SIM (seconds)."); ?></span>
629
						</td>
630
					</tr>
631
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
632
						<td width="22%" valign="top" class="vncell"><?= gettext("Init String"); ?></td>
633
						<td width="78%" class="vtable">
634
							<input type="text" size="40" class="formfld unknown" id="initstr" name="initstr" value="<?=htmlspecialchars($pconfig['initstr']);?>" />
635
							<br />
636
							<span class="vexpl"><?= gettext("Note: Enter the modem initialization string here. Do NOT include the \"AT\"" .
637
							" string at the beginning of the command. Many modern USB 3G modems don't need an initialization string."); ?></span>
638
						</td>
639
					</tr>
640
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
641
						<td width="22%" valign="top" class="vncell"><?= gettext("Connection Timeout"); ?></td>
642
						<td width="78%" class="vtable">
643
							<input name="connect-timeout" type="text" class="formfld unknown" id="connect-timeout" size="2" value="<?=htmlspecialchars($pconfig['connect-timeout']);?>" />
644
							<br />
645
							<span class="vexpl"><?= gettext("Note: Enter timeout in seconds for connection to be established (sec.) Default is 45 sec."); ?></span>
646
						</td>
647
					</tr>
648
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
649
						<td valign="top" class="vncell"><?= gettext("Uptime Logging"); ?></td>
650
						<td class="vtable">
651
							<input type="checkbox" value="on" id="uptime" name="uptime" <?php if (isset($pconfig['uptime'])) echo "checked=\"checked\""; ?> /> <?= gettext("Enable persistent logging of connection uptime."); ?>
652
							<br />
653
							<span class="vexpl"><?= gettext("This option causes cumulative uptime to be recorded and displayed on the Status Interfaces page."); ?></span>
654
						</td>
655
					</tr>
656
				</table>
657
			</td>
658
		</tr>
659
		<tr style="display:none" name="pppoe" id="pppoe">
660
			<td colspan="2" style="padding:0px;">
661
				<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="service name">
662
					<tr>
663
						<td width="22%" valign="top" class="vncell"><?= gettext("Service name"); ?></td>
664
						<td width="78%" class="vtable"><input name="provider" type="text" class="formfld unknown" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>" />&nbsp;&nbsp;
665
							<input type="checkbox" value="on" id="null_service" name="null_service" <?php if (isset($pconfig['null_service'])) echo "checked=\"checked\""; ?> /> <?= gettext("Configure a NULL Service name"); ?>
666
							<br />
667
							<span class="vexpl"><?= gettext("Hint: this field can usually be left empty. Service name will not be configured if this field is empty. Check the \"Configure NULL\" box to configure a blank Service name."); ?></span>
668
						</td>
669
					</tr>
670
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
671
						<td width="22%" valign="top" class="vncell"><?=gettext("Periodic reset");?></td>
672
						<td width="78%" class="vtable">
673
							<table id="presetwrap" cellspacing="0" cellpadding="0" width="100%" summary="periodic reset">
674
								<tr>
675
									<td align="left" valign="top">
676
										<p style="margin: 4px; padding: 4px 0 4px 0; width: 94%;">
677
										<select style="vertical-align:top" id="reset_type" name="pppoe-reset-type" class="formselect" onchange="show_reset_settings(this.value);">
678
											<option value = ""><?= gettext("Disabled"); ?></option>
679
											<option value="custom" <?php if ($pconfig['pppoe-reset-type'] == "custom") echo "selected=\"selected\""; ?>><?= gettext("Custom"); ?></option>
680
											<option value="preset" <?php if ($pconfig['pppoe-reset-type'] == "preset") echo "selected=\"selected\""; ?>><?= gettext("Pre-Set"); ?></option>
681
										</select> <?= gettext("Select a reset timing type"); ?>
682
										</p>
683
										<?php if ($pconfig['pppoe_pr_custom']): ?>
684
											<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoecustomwrap">
685
										<?php else: ?>
686
											<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoecustomwrap">
687
										<?php endif; ?>
688
										<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" />
689
										<?= gettext("hour (0-23)"); ?><br />
690
										<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" />
691
										<?= gettext("minute (0-59)"); ?><br />
692
										<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']);?>" />
693
										<?= gettext("reset at a specific date (mm/dd/yyyy)"); ?>
694
										<br />&nbsp;<br />
695
										<span class="red"><strong><?=gettext("Note:");?></strong></span>
696
										<?= gettext("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."); ?>
697
										</p>
698
										<?php if ($pconfig['pppoe_pr_preset']): ?>
699
											<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoepresetwrap">
700
										<?php else: ?>
701
											<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoepresetwrap">
702
										<?php endif; ?>
703
										<input name="pppoe_pr_preset_val" type="radio" id="pppoe_monthly" value="monthly" <?php if ($pconfig['pppoe_monthly']) echo "checked=\"checked\""; ?> />
704
										<?= gettext("reset at each month ('0 0 1 * *')"); ?>
705
										<br />
706
										<input name="pppoe_pr_preset_val" type="radio" id="pppoe_weekly" value="weekly" <?php if ($pconfig['pppoe_weekly']) echo "checked=\"checked\""; ?> />
707
										<?= gettext("reset at each week ('0 0 * * 0')"); ?>
708
										<br />
709
										<input name="pppoe_pr_preset_val" type="radio" id="pppoe_daily" value="daily" <?php if ($pconfig['pppoe_daily']) echo "checked=\"checked\""; ?> />
710
										<?= gettext("reset at each day ('0 0 * * *')"); ?>
711
										<br />
712
										<input name="pppoe_pr_preset_val" type="radio" id="pppoe_hourly" value="hourly" <?php if ($pconfig['pppoe_hourly']) echo "checked=\"checked\""; ?> />
713
										<?= gettext("reset at each hour ('0 * * * *')"); ?>
714
										</p>
715
									</td>
716
								</tr>
717
							</table>
718
						</td>
719
					</tr>
720
				</table>
721
			</td>
722
		</tr>
723

    
724
<?php
725
	for ($j=0; $j < $port_count; $j++) :
726
?>
727

    
728
		<tr style="display:none" id="gw_fields<?=$j;?>">
729
			<td width="22%" id="localiplabel<?=$j;?>" valign="top" class="vncell"><?= gettext("Local IP"); ?></td>
730
			<td width="78%" class="vtable">
731
				<input name="localip[]" type="text" class="formfld unknown" id="localip<?=$j;?>" size="20"  value="<?=htmlspecialchars($pconfig['localip'][$j]);?>" />
732
				/
733
				<select name="subnet[]" class="formselect" id="subnet<?=$j;?>" disabled="disabled">
734
				<?php for ($i = 31; $i > 0; $i--): ?>
735
					<option value="<?=$i;?>"<?php if ($i == $pconfig['subnet'][$j]) echo " selected=\"selected\""; ?>><?=$i;?></option>
736
				<?php endfor; ?>
737
				</select> <?= gettext("IP Address"); ?>
738
			</td>
739
		</tr>
740
		<tr style="display:none" id="ip_fields<?=$j;?>">
741
			<td width="22%" id="gatewaylabel<?=$j;?>" valign="top" class="vncell"></td>
742
			<td width="78%" class="vtable">
743
				<input name="gateway[]" type="text" class="formfld unknown" id="gateway<?=$j;?>" size="20" value="<?=htmlspecialchars($pconfig['gateway'][$j]);?>" /><?= gettext("IP Address OR Hostname"); ?>
744
			</td>
745
		</tr>
746
<?php
747
	endfor;
748
?>
749

    
750
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
751
			<td colspan="2" valign="top" height="16"></td>
752
		</tr>
753
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
754
			<td colspan="2" valign="top" class="listtopic"><?= gettext("Advanced Options"); ?></td>
755
		</tr>
756
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
757
			<td valign="top" class="vncell"><?= gettext("Dial On Demand"); ?></td>
758
			<td class="vtable">
759
				<input type="checkbox" value="on" id="ondemand" name="ondemand" <?php if (isset($pconfig['ondemand'])) echo "checked=\"checked\""; ?> /> <?= gettext("Enable Dial-on-Demand mode"); ?>
760
				<br />
761
				<span class="vexpl"><?= gettext("This option causes the interface to operate in dial-on-demand mode. Do NOT enable if you want your link to be always up. " .
762
				"The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected."); ?> </span>
763
			</td>
764
		</tr>
765
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
766
			<td valign="top" class="vncell"><?= gettext("Idle Timeout"); ?></td>
767
			<td class="vtable">
768
				<input name="idletimeout" type="text" class="formfld unknown" id="idletimeout" size="12" value="<?=htmlspecialchars($pconfig['idletimeout']);?>" /> <?= gettext("(seconds) Default is 0, which disables the timeout feature."); ?>
769
				<br />
770
				<span class="vexpl"><?= gettext("If no incoming or outgoing packets are transmitted for the entered number of seconds the connection is brought down.");?>
771
				<br />
772
				<?=gettext("When the idle timeout occurs, if the dial-on-demand option is enabled, mpd goes back into dial-on-demand mode. Otherwise, the interface is brought down and all associated routes removed."); ?></span>
773
			</td>
774
		</tr>
775
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
776
			<td width="22%" valign="top" class="vncell"><?= gettext("Compression"); ?></td>
777
			<td width="78%" class="vtable">
778
				<input type="checkbox" value="on" id="vjcomp" name="vjcomp" <?php if (isset($pconfig['vjcomp'])) echo "checked=\"checked\""; ?> />&nbsp;<?= gettext("Disable vjcomp(compression) (auto-negotiated by default)."); ?>
779
				<br />
780
				<span class="vexpl"><?=gettext("This option enables Van Jacobson TCP header compression, which saves several bytes per TCP data packet. " .
781
				"You almost always want this option. This compression ineffective for TCP connections with enabled modern extensions like time " .
782
				"stamping or SACK, which modify TCP options between sequential packets.");?></span>
783
			</td>
784
		</tr>
785
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
786
			<td width="22%" valign="top" class="vncell"><?= gettext("TCPmssFix"); ?></td>
787
			<td width="78%" class="vtable">
788
				<input type="checkbox" value="on" id="tcpmssfix" name="tcpmssfix" <?php if (isset($pconfig['tcpmssfix'])) echo "checked=\"checked\""; ?> />&nbsp;<?= gettext("Disable tcpmssfix (enabled by default)."); ?>
789
				<br />
790
				<span class="vexpl"><?=gettext("This option causes mpd to adjust incoming and outgoing TCP SYN segments so that the requested maximum segment size is not greater than the amount ".
791
				"allowed by the interface MTU. This is necessary in many setups to avoid problems caused by routers that drop ICMP Datagram Too Big messages. Without these messages, ".
792
				"the originating machine sends data, it passes the rogue router then hits a machine that has an MTU that is not big enough for the data. Because the IP Don't Fragment option is set, ".
793
				"this machine sends an ICMP Datagram Too Big message back to the originator and drops the packet. The rogue router drops the ICMP message and the originator never ".
794
				"gets to discover that it must reduce the fragment size or drop the IP Don't Fragment option from its outgoing data.");?></span>
795
			</td>
796
		</tr>
797
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
798
			<td width="22%" valign="top" class="vncell"><?=gettext("ShortSeq");?></td>
799
			<td width="78%" class="vtable">
800
				<input type="checkbox" value="on" id="shortseq" name="shortseq" <?php if (isset($pconfig['shortseq'])) echo "checked=\"checked\""; ?> />&nbsp;<?= gettext("Disable shortseq (auto-negotiated by default)."); ?>
801
				<br />
802
				<span class="vexpl"><?= gettext("This option is only meaningful if multi-link PPP is negotiated. It proscribes shorter multi-link fragment headers, saving two bytes on every frame. " .
803
				"It is not necessary to disable this for connections that are not multi-link."); ?></span>
804
			</td>
805
		</tr>
806
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
807
			<td width="22%" valign="top" class="vncell"><?=gettext("ACFComp"); ?></td>
808
			<td width="78%" class="vtable">
809
				<input type="checkbox" value="on" id="acfcomp" name="acfcomp" <?php if (isset($pconfig['acfcomp'])) echo "checked=\"checked\""; ?> />&nbsp;<?= gettext("Disable acfcomp (compression) (auto-negotiated by default)."); ?>
810
				<br />
811
				<span class="vexpl"><?= gettext("Address and control field compression. This option only applies to asynchronous link types. It saves two bytes per frame."); ?></span>
812
			</td>
813
		</tr>
814
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
815
			<td width="22%" valign="top" class="vncell"><?=gettext("ProtoComp"); ?></td>
816
			<td width="78%" class="vtable">
817
				<input type="checkbox" value="on" id="protocomp" name="protocomp" <?php if (isset($pconfig['protocomp'])) echo "checked=\"checked\""; ?> />&nbsp;<?= gettext("Disable protocomp (compression) (auto-negotiated by default)."); ?>
818
				<br />
819
				<span class="vexpl"><?= gettext("Protocol field compression. This option saves one byte per frame for most frames."); ?></span>
820
			</td>
821
		</tr>
822
		<tr id="advanced_" name="advanced_">
823
			<td>&nbsp;</td>
824
			<td>
825
				<p><input type="button" onclick="show_advanced(1)" value="<?=gettext("Show advanced options"); ?>" /></p>
826
			</td>
827
			<td style="display:none" id="adv_rows" name="adv_rows"><?=$k;?></td>
828
			<td style="display:none" id="adv_show" name="adv_show">0</td>
829
		</tr>
830
<?php
831
	for ($i=0; $i < $port_count; $i++) :
832
?>
833
		<tr style="display:none" id="link<?=$i;?>">
834
			<td width="22%" valign="top" id="linklabel<?=$i;?>" class="vncell"> <?=gettext("Link Parameters");?></td>
835
			<td class="vtable">
836
				<table name="link_parameters" border="0" cellpadding="6" cellspacing="0" summary="link parameters">
837
					<tr>
838
						<td width="22%" id="bwlabel<?=$i;?>" valign="top"class="vncell"> <?=gettext("Bandwidth");?></td>
839
						<td width="78%" class="vtable">
840
							<br />
841
							<input name="bandwidth[]" id="bandwidth<?=$i;?>" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['bandwidth'][$i]);?>" />
842
							<br />
843
							<span class="vexpl"><?=gettext("Set ONLY for MLPPP connections and ONLY when links have different bandwidths.");?></span>
844
						</td>
845
					</tr>
846
					<tr>
847
						<td width="22%" id="mtulabel<?=$i;?>" valign="top" class="vncell"> <?=gettext("MTU"); ?></td>
848
						<td width="78%" class="vtable">
849
							<input name="mtu[]" id="mtu<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mtu'][$i]);?>" />
850
							<br />
851
							<span class="vexpl"><?=gettext("MTU will default to 1492.");?></span>
852
						</td>
853
					</tr>
854
					<tr>
855
						<td width="22%" id="mrulabel<?=$i;?>" valign="top" class="vncell"> <?=gettext("MRU"); ?></td>
856
						<td width="78%" class="vtable">
857
							<input name="mru[]" id="mru<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mru'][$i]);?>" />
858
							<br />
859
							<span class="vexpl">MRU <?=gettext("will be auto-negotiated by default.");?></span>
860
						</td>
861
					</tr>
862
					<tr>
863
						<td width="22%" id="mrrulabel<?=$i;?>" valign="top" class="vncell"> <?=gettext("MRRU"); ?></td>
864
						<td width="78%" class="vtable">
865
							<input name="mrru[]" id="mrru<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mrru'][$i]);?>" />
866
							<br />
867
							<span class="vexpl"><?=gettext("Set ONLY for MLPPP connections.");?> MRRU <?=gettext("will be auto-negotiated by default.");?></span>
868
						</td>
869
					</tr>
870
				</table>
871
			</td>
872
		</tr>
873
<?php
874
	endfor;
875
?>
876
		<tr>
877
			<td width="22%" valign="top">&nbsp;</td>
878
			<td width="78%">
879
				<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
880
				<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
881
				<input name="ptpid" type="hidden" value="<?=htmlspecialchars($pconfig['ptpid']);?>" />
882
				<?php if (isset($id) && $a_ppps[$id]): ?>
883
					<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
884
				<?php endif; ?>
885
			</td>
886
		</tr>
887
	</table>
888
</form>
889
<?php include("fend.inc"); ?>
890
</body>
891
</html>
(108-108/252)