Project

General

Profile

Download (40.2 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
if (isset($_POST['referer'])) {
50
	$referer = $_POST['referer'];
51
} else {
52
	$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_ppps.php');
53
}
54

    
55
define("CRON_MONTHLY_PATTERN", "0 0 1 * *");
56
define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
57
define("CRON_DAILY_PATTERN", "0 0 * * *");
58
define("CRON_HOURLY_PATTERN", "0 * * * *");
59

    
60
if (!is_array($config['ppps']['ppp']))
61
	$config['ppps']['ppp'] = array();
62

    
63
$a_ppps = &$config['ppps']['ppp'];
64

    
65
$iflist = get_configured_interface_with_descr();
66
$portlist = get_interface_list();
67
$portlist = array_merge($portlist, $iflist);
68

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

    
75
if (is_numericint($_GET['id']))
76
	$id = $_GET['id'];
77
if (isset($_POST['id']) && is_numericint($_POST['id']))
78
	$id = $_POST['id'];
79
	
80
if (isset($id) && $a_ppps[$id]) {
81
	$pconfig['ptpid'] = $a_ppps[$id]['ptpid'];
82
	$pconfig['type'] = $a_ppps[$id]['type'];
83
	//$pconfig['if'] = $a_ppps[$id]['if'];
84
	$pconfig['interfaces'] = $a_ppps[$id]['ports'];
85
	$pconfig['username'] = $a_ppps[$id]['username'];
86
	$pconfig['password'] = base64_decode($a_ppps[$id]['password']);
87
	if (isset($a_ppps[$id]['ondemand']))
88
		$pconfig['ondemand'] = true;
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
	if (isset($a_ppps[$id]['acfcomp']))
99
		$pconfig['acfcomp'] = true;
100
	if (isset($a_ppps[$id]['protocomp']))
101
		$pconfig['protocomp'] = true;
102
	if (isset($a_ppps[$id]['vjcomp']))
103
		$pconfig['vjcomp'] = true;
104
	if (isset($a_ppps[$id]['tcpmssfix']))
105
		$pconfig['tcpmssfix'] = true;
106
	switch($a_ppps[$id]['type']) {
107
		case "ppp":
108
			$pconfig['initstr'] = base64_decode($a_ppps[$id]['initstr']);
109
			$pconfig['simpin'] = $a_ppps[$id]['simpin'];
110
			$pconfig['pin-wait'] = $a_ppps[$id]['pin-wait'];
111
			$pconfig['apn'] = $a_ppps[$id]['apn'];
112
			$pconfig['apnum'] = $a_ppps[$id]['apnum'];
113
			$pconfig['phone'] = $a_ppps[$id]['phone'];
114
			$pconfig['connect-timeout'] = $a_ppps[$id]['connect-timeout'];
115
			$pconfig['localip'] = explode(",",$a_ppps[$id]['localip']);
116
			$pconfig['gateway'] = explode(",",$a_ppps[$id]['gateway']);
117
			break;
118
		case "l2tp":
119
		case "pptp":
120
			$pconfig['localip'] = explode(",",$a_ppps[$id]['localip']);
121
			$pconfig['subnet'] = explode(",",$a_ppps[$id]['subnet']);
122
			$pconfig['gateway'] = explode(",",$a_ppps[$id]['gateway']);
123
		case "pppoe":
124
			$pconfig['provider'] = $a_ppps[$id]['provider'];
125
			if (isset($a_ppps[$id]['provider']) and empty($a_ppps[$id]['provider']))
126
				$pconfig['null_service'] = true;
127
			/* ================================================ */
128
			/* = force a connection reset at a specific time? = */
129
			/* ================================================ */
130
			
131
			if (isset($a_ppps[$id]['pppoe-reset-type'])) {
132
				$pconfig['pppoe-reset-type'] = $a_ppps[$id]['pppoe-reset-type'];
133
				$itemhash = getMPDCRONSettings($a_ppps[$id]['if']);
134
				$cronitem = $itemhash['ITEM'];
135
				if (isset($cronitem)) {
136
					$resetTime = "{$cronitem['minute']} {$cronitem['hour']} {$cronitem['mday']} {$cronitem['month']} {$cronitem['wday']}";
137
				} else {
138
					$resetTime = NULL;
139
				}
140
				
141
				if ($a_ppps[$id]['pppoe-reset-type'] == "custom") {
142
					$resetTime_a = explode(" ", $resetTime);
143
					$pconfig['pppoe_pr_custom'] = true;
144
					$pconfig['pppoe_resetminute'] = $resetTime_a[0];
145
					$pconfig['pppoe_resethour'] = $resetTime_a[1];
146
					/*  just initialize $pconfig['pppoe_resetdate'] if the
147
					 *  coresponding item contains appropriate numeric values.
148
					 */
149
					if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*") 
150
						$pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y");
151
				} else if ($a_ppps[$id]['pppoe-reset-type'] == "preset") {
152
					$pconfig['pppoe_pr_preset'] = true;
153
					switch ($resetTime) {
154
						case CRON_MONTHLY_PATTERN:
155
							$pconfig['pppoe_monthly'] = true;
156
							break;
157
						case CRON_WEEKLY_PATTERN:
158
							$pconfig['pppoe_weekly'] = true;
159
							break;
160
						case CRON_DAILY_PATTERN:
161
							$pconfig['pppoe_daily'] = true;
162
							break;
163
						case CRON_HOURLY_PATTERN:
164
							$pconfig['pppoe_hourly'] = true;
165
							break;
166
					}
167
				}
168
			}
169
			break;
170
	}
171
	
172
} else
173
	$pconfig['ptpid'] = interfaces_ptpid_next();
174

    
175
if ($_POST) {
176

    
177
	unset($input_errors);
178
	$pconfig = $_POST;
179
	
180
	/* okay first of all, cause we are just hiding the PPPoE HTML
181
	 * fields releated to PPPoE resets, we are going to unset $_POST
182
	 * vars, if the reset feature should not be used. Otherwise the
183
	 * data validation procedure below, may trigger a false error
184
	 * message.
185
	 */
186
	if (empty($_POST['pppoe-reset-type'])) {               
187
		unset($_POST['pppoe_resethour']);
188
		unset($_POST['pppoe_resetminute']);
189
		unset($_POST['pppoe_resetdate']);
190
		unset($_POST['pppoe_pr_preset_val']);
191
	}
192

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

    
266
/*
267
	foreach ($a_ppps as $ppp) {
268
		if (isset($id) && ($a_ppps[$id]) && ($a_ppps[$id] === $ppp))
269
			continue;
270

    
271
		if ($ppp['serialport'] == $_POST['serialport']) {
272
			$input_errors[] = "Serial port is in use";
273
			break;
274
		}
275
	}
276
*/	
277

    
278
	if (!$input_errors) {
279
		$ppp = array();
280
		$ppp['ptpid'] = $_POST['ptpid'];
281
		$ppp['type'] = $_POST['type'];
282
		$ppp['if'] = $ppp['type'].$ppp['ptpid'];
283
		$ppp['ports'] = implode(',',$_POST['interfaces']);
284
		$ppp['username'] = $_POST['username'];
285
		$ppp['password'] = base64_encode($_POST['passwordfld']);
286
		$ppp['ondemand'] = $_POST['ondemand'] ? true : false;
287
		if (!empty($_POST['idletimeout']))
288
			$ppp['idletimeout'] = $_POST['idletimeout'];
289
		else
290
			unset($ppp['idletimeout']);
291
		$ppp['uptime'] = $_POST['uptime'] ? true : false;
292
		if (!empty($_POST['descr']))
293
			$ppp['descr'] = $_POST['descr'];
294
		else
295
			unset($ppp['descr']);
296

    
297
		// Loop through fields associated with a individual link/port and make an array of the data
298
		$port_fields = array("localip", "gateway", "subnet", "bandwidth", "mtu", "mru", "mrru");
299
		foreach($_POST['interfaces'] as $iface){
300
			foreach($port_fields as $field_label){
301
				if (isset($_POST[$field_label][$iface]))
302
					$port_data[$field_label][] = $_POST[$field_label][$iface];
303
			}
304
		}		
305
				
306
		switch($_POST['type']) {
307
			case "ppp":
308
				if (!empty($_POST['initstr']))
309
					$ppp['initstr'] = base64_encode($_POST['initstr']);
310
				else
311
					unset($ppp['initstr']);
312
				if (!empty($_POST['simpin'])) {
313
					$ppp['simpin'] = $_POST['simpin'];
314
					$ppp['pin-wait'] = $_POST['pin-wait'];
315
				} else {
316
					unset($ppp['simpin']);
317
					unset($ppp['pin-wait']);
318
				}
319
				
320
				if (!empty($_POST['apn'])){
321
					$ppp['apn'] = $_POST['apn'];
322
					$ppp['apnum'] = $_POST['apnum'];
323
				} else {
324
					unset($ppp['apn']);
325
					unset($ppp['apnum']);
326
				}
327
				$ppp['phone'] = $_POST['phone'];
328
				$ppp['localip'] = implode(',',$port_data['localip']);
329
				$ppp['gateway'] = implode(',',$port_data['gateway']);
330
				if (!empty($_POST['connect-timeout']))
331
					$ppp['connect-timeout'] = $_POST['connect-timeout'];
332
				else
333
					unset($ppp['connect-timeout']);
334
				break;
335
			case "pppoe":
336
				if (!empty($_POST['provider']))
337
					$ppp['provider'] = $_POST['provider'];
338
				else{
339
					unset($ppp['provider']);
340
					$ppp['provider'] = $_POST['null_service'] ? true : false;
341
				}
342
				if (!empty($_POST['pppoe-reset-type']))
343
					$ppp['pppoe-reset-type'] = $_POST['pppoe-reset-type'];
344
				else
345
					unset($ppp['pppoe-reset-type']);
346
				
347
				break;
348
			case "pptp":
349
			case "l2tp":
350
				$ppp['localip'] = implode(',',$port_data['localip']);
351
				$ppp['subnet'] = implode(',',$port_data['subnet']);
352
				$ppp['gateway'] = implode(',',$port_data['gateway']);
353
				break;
354
			default:
355
				break;
356
			
357
		}
358
		
359
		$ppp['shortseq'] = $_POST['shortseq'] ? true : false;
360
		$ppp['acfcomp'] = $_POST['acfcomp'] ? true : false;
361
		$ppp['protocomp'] = $_POST['protocomp'] ? true : false;
362
		$ppp['vjcomp'] = $_POST['vjcomp'] ? true : false;
363
		$ppp['tcpmssfix'] = $_POST['tcpmssfix'] ? true : false;
364
		$ppp['bandwidth'] = implode(',', $port_data['bandwidth']);
365
		if (is_array($port_data['mtu']))
366
			$ppp['mtu'] = implode(',', $port_data['mtu']);
367
		if (is_array($port_data['mru']))
368
			$ppp['mru'] = implode(',', $port_data['mru']);
369
		if (is_array($port_data['mrru']))
370
			$ppp['mrru'] = implode(',', $port_data['mrru']);
371
		
372
		/* handle_pppoe_reset is called here because if user changes Link Type from PPPoE to another type we 
373
		must be able to clear the config data in the <cron> section of config.xml if it exists
374
		*/
375
		handle_pppoe_reset($_POST);
376

    
377
		if (isset($id) && $a_ppps[$id])
378
			$a_ppps[$id] = $ppp;
379
		else
380
			$a_ppps[] = $ppp;
381

    
382
		write_config();
383
		configure_cron();
384

    
385
		foreach ($iflist as $pppif => $ifdescr) {
386
			if ($config['interfaces'][$pppif]['if'] == $ppp['if'])
387
				interface_ppps_configure($pppif);
388
		}
389
		header("Location: interfaces_ppps.php");
390
		exit;
391
	}
392
} // end if($_POST)
393

    
394
$closehead = false;
395
$pgtitle = array(gettext("Interfaces"),gettext("PPPs"),gettext("Edit"));
396
$shortcut_section = "interfaces";
397
include("head.inc");
398

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

    
401
?>
402
	<script type="text/javascript" src="/javascript/numericupdown/js/numericupdown.js"></script>
403
	<link href="/javascript/numericupdown/css/numericupdown.css" rel="stylesheet" type="text/css" />
404
	<script type="text/javascript" src="/javascript/datepicker/js/datepicker.js"></script>
405
	<link href="/javascript/datepicker/css/datepicker.css" rel="stylesheet" type="text/css"/>
406
	<script type="text/javascript">
407
	//<![CDATA[
408
		jQuery(document).ready(function() { updateType(<?php echo "'{$pconfig['type']}'";?>); });
409
	//]]>
410
	</script>
411
</head>
412
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" >
413
<?php include("fbegin.inc"); ?>
414
<?php if ($input_errors) print_input_errors($input_errors); ?>
415
	<form action="interfaces_ppps_edit.php" method="post" name="iform" id="iform">
416
	  <table id="interfacetable" width="100%" border="0" cellpadding="6" cellspacing="0" summary="interfaces ppps edit">
417
		<tr>
418
			<td colspan="2" valign="top" class="listtopic"><?= gettext("PPPs configuration"); ?></td>
419
		</tr>
420
		<tr>
421
			<td valign="middle" class="vncell"><strong><?= gettext("Link Type"); ?></strong></td>
422
			<td class="vtable"> 
423
				<select name="type" onchange="updateType(this.value);" class="formselect" id="type">
424
				<?php 
425
					foreach ($types as $key => $opt) { 
426
						echo "<option onclick=\"updateType('{$key}');\"";
427
						if ($key == $pconfig['type']) 
428
							echo " selected=\"selected\"";
429
						echo " value=\"{$key}\" >" . htmlspecialchars($opt) . "</option>";
430
					} 
431
				?>
432
				</select> 
433
			</td>
434
		</tr>
435
		<tr name="interface" id="interface" >
436
			<td width="22%" valign="top" class="vncellreq"><?= gettext("Link interface(s)"); ?></td>
437
			<td width="78%" class="vtable">
438
				<select style="vertical-align:top" name="interfaces[]" multiple="multiple" class="formselect" size="4" onchange="show_hide_linkfields(this.options);">
439
					<option></option>
440
				</select>
441

    
442
				<br /><span class="vexpl"><?= gettext("Select at least two interfaces for Multilink (MLPPP) connections."); ?></span>
443
			</td>
444
		</tr>
445
		<tr style="display:none" name="portlists" id="portlists">
446
			<td id="serialports"><?php
447
				$selected_ports = explode(',',$pconfig['interfaces']);
448
				if (!is_dir("/var/spool/lock"))
449
					mwexec("/bin/mkdir -p /var/spool/lock");
450
				// $serialports = pfSense_get_modem_devices();
451
				// Match files in /dev starting with "cua" then:
452
				// [a-zA-Z] = any single alpha character e.g. like "cuau"
453
				// [0-9] = a digit from 0 to 9
454
				// stuff in {} = the various possible digit and dot combinations to allow an optional 2nd digit, dot, followed by 1 or 2 optional digits
455
				// This supports up to 100 device numbers (0 to 99), e.g. cuau0 cuau1 ... cuau10 cuau11 ... cuau99 and also possibilities like cuau1.1 cuau1.11 cuau11.1 cuau11.11
456
				$serialports = glob("/dev/cua[a-zA-Z][0-9]{,.[0-9],.[0-9][0-9],[0-9],[0-9].[0-9],[0-9].[0-9][0-9]}", GLOB_BRACE);
457
				$serport_count = 0;
458
				foreach ($serialports as $port) {
459
					$serport_count++;
460
					echo $port.",".trim($port);
461
					if (in_array($port,$selected_ports))
462
						echo ",1|";
463
					else
464
						echo ",|";
465
				}
466
				echo $serport_count;
467
			?></td>
468
			<td id="ports"><?php
469
				$port_count = 0;
470
				foreach ($portlist as $ifn => $ifinfo){
471
				$port_count++;
472
					$string = "";
473
					if (is_array($ifinfo)) {
474
						$string .= $ifn;
475
						if ($ifinfo['mac'])
476
						$string .= " ({$ifinfo['mac']})";	
477
					} else
478
						$string .= $ifinfo;
479
					$string .= ",{$ifn}";
480
					echo htmlspecialchars($string);
481
					if (in_array($ifn,$selected_ports))
482
						echo ",1|";
483
					else
484
						echo ",|";
485
				}
486
				echo $port_count;
487
				if($serport_count > $port_count)
488
					$port_count=$serport_count;
489
			?></td>
490
			<td style="display:none" name="port_count" id="port_count"><?=htmlspecialchars($port_count);?></td>
491
		</tr>
492
		<tr>
493
			<td width="22%" valign="top" class="vncell"><?= gettext("Description"); ?></td>
494
			<td width="78%" class="vtable">
495
				<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
496
				<br /> <span class="vexpl"><?= gettext("You may enter a description here for your reference. Description will appear in the \"Interfaces Assign\" select lists."); ?></span>
497
			</td>
498
		</tr>	
499
		<tr style="display:none" name="select" id="select"><td style="display:none"></td></tr>
500
		<?php $k=0; ?>
501
		<tr style="display:none" name="ppp_provider" id="ppp_provider">
502
			<td width="22%" valign="top" class="vncell"><?= gettext("Service Provider"); ?></td>
503
			<td width="78%" class="vtable">
504
				<table border="0" cellpadding="0" cellspacing="0" summary="service provider">
505
					<tr id="trcountry" style="display:none">
506
						<td><?= gettext("Country:"); ?> &nbsp;&nbsp;</td>
507
						<td>
508
							<select class="formselect" name="country" id="country" onchange="providers_list()">
509
								<option></option>
510
							</select>
511
						</td>
512
					</tr>
513
					<tr id="trprovider" style="display:none">
514
						<td><?= gettext("Provider:"); ?> &nbsp;&nbsp;</td>
515
						<td>
516
							<select class="formselect" name="provider" id="provider" onchange="providerplan_list()">
517
								<option></option>
518
							</select>
519
						</td>
520
					</tr>
521
					<tr id="trproviderplan" style="display:none">
522
						<td><?= gettext("Plan:"); ?> &nbsp;&nbsp;</td>
523
						<td>
524
							<select class="formselect" name="providerplan" id="providerplan" onchange="prefill_provider()">
525
								<option></option>
526
							</select>
527
						</td>
528
					</tr>
529
				</table>
530
				<br /><span class="vexpl"><?= gettext("Select to fill in data for your service provider."); ?></span>
531
			</td>
532
		</tr>
533
		<tr>
534
			<td width="22%" valign="top" class="vncell"><?= gettext("Username"); ?></td>
535
			<td width="78%" class="vtable">
536
			<input name="username" type="text" class="formfld user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>" />
537
			</td>
538
		</tr>
539
		<tr>
540
			<td width="22%" valign="top" class="vncell"><?= gettext("Password"); ?></td>
541
			<td width="78%" class="vtable">
542
			<input name="passwordfld" type="password" class="formfld pwd" id="passwordfld" size="20" value="<?=htmlspecialchars($pconfig['password']);?>" />
543
			</td>
544
		</tr>
545

    
546
		<tr style="display:none" name="phone_num" id="phone_num">
547
			<td width="22%" valign="top" class="vncellreq"><?= gettext("Phone Number"); ?></td>
548
			<td width="78%" class="vtable">
549
				<input name="phone" type="text" class="formfld unknown" id="phone" size="40" value="<?=htmlspecialchars($pconfig['phone']);?>" />
550
				<br /><span class="vexpl"><?= gettext("Note: Typically *99# for GSM networks and #777 for CDMA networks"); ?></span>
551
			</td>
552
		</tr>
553
		<tr style="display:none" name="apn_" id="apn_">
554
			<td width="22%" valign="top" class="vncell"><?= gettext("Access Point Name (APN)"); ?></td>
555
			<td width="78%" class="vtable">
556
				<input name="apn" type="text" class="formfld unknown" id="apn" size="40" value="<?=htmlspecialchars($pconfig['apn']);?>" />
557
			</td>
558
		</tr>
559
		
560
		<tr style="display:none" name="ppp" id="ppp">
561
			<td colspan="2" style="padding:0px;">
562
				<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="advanced">		
563
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
564
						<td width="22%" valign="top" class="vncell"><?= gettext("APN number (optional)"); ?></td>
565
						<td width="78%" class="vtable">
566
							<input name="apnum" type="text" class="formfld unknown" id="apnum" size="2" value="<?=htmlspecialchars($pconfig['apnum']);?>" />
567
							<br /><span class="vexpl"><?= gettext("Note: Defaults to 1 if you set APN above. Ignored if you set no APN above."); ?></span>
568
						</td>
569
					</tr>
570
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
571
						<td width="22%" valign="top" class="vncell"><?= gettext("SIM PIN"); ?></td>
572
						<td width="78%" class="vtable">
573
							<input name="simpin" type="text" class="formfld unknown" id="simpin" size="12" value="<?=htmlspecialchars($pconfig['simpin']);?>" />
574
						</td>
575
					</tr>
576
			
577
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
578
						<td width="22%" valign="top" class="vncell"><?= gettext("SIM PIN wait"); ?></td>
579
						<td width="78%" class="vtable">
580
							<input name="pin-wait" type="text" class="formfld unknown" id="pin-wait" size="2" value="<?=htmlspecialchars($pconfig['pin-wait']);?>" />
581
							<br /><span class="vexpl"><?= gettext("Note: Time to wait for SIM to discover network after PIN is sent to SIM (seconds)."); ?></span>
582
						</td>
583
					</tr>
584
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
585
						<td width="22%" valign="top" class="vncell"><?= gettext("Init String"); ?></td>
586
						<td width="78%" class="vtable">
587
							<input type="text" size="40" class="formfld unknown" id="initstr" name="initstr" value="<?=htmlspecialchars($pconfig['initstr']);?>" />
588
							<br /><span class="vexpl"><?= gettext("Note: Enter the modem initialization string here. Do NOT include the \"AT\"" . 
589
							" string at the beginning of the command. Many modern USB 3G modems don't need an initialization string."); ?></span>
590
						</td>
591
					</tr>
592
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
593
						<td width="22%" valign="top" class="vncell"><?= gettext("Connection Timeout"); ?></td>
594
						<td width="78%" class="vtable">
595
							<input name="connect-timeout" type="text" class="formfld unknown" id="connect-timeout" size="2" value="<?=htmlspecialchars($pconfig['connect-timeout']);?>" />
596
							<br /><span class="vexpl"><?= gettext("Note: Enter timeout in seconds for connection to be established (sec.) Default is 45 sec."); ?></span>
597
						</td>
598
					</tr>
599
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
600
						<td valign="top" class="vncell"><?= gettext("Uptime Logging"); ?></td>
601
						<td class="vtable">
602
							<input type="checkbox" value="on" id="uptime" name="uptime" <?php if (isset($pconfig['uptime'])) echo "checked=\"checked\""; ?> /> <?= gettext("Enable persistent logging of connection uptime."); ?> 
603
							<br /> <span class="vexpl"><?= gettext("This option causes cumulative uptime to be recorded and displayed on the Status Interfaces page."); ?></span>
604
						</td>
605
					</tr>
606
				</table>
607
			</td>
608
		</tr>
609
		<tr style="display:none" name="pppoe" id="pppoe">
610
			<td colspan="2" style="padding:0px;">
611
				<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="service name">
612
					<tr>
613
						<td width="22%" valign="top" class="vncell"><?= gettext("Service name"); ?></td>
614
						<td width="78%" class="vtable"><input name="provider" type="text" class="formfld unknown" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>" />&nbsp;&nbsp;
615
						<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"); ?> 
616
							<br /> <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>
617
						</td>
618
					</tr>
619
					<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
620
						<td width="22%" valign="top" class="vncell"><?=gettext("Periodic reset");?></td>
621
						<td width="78%" class="vtable">
622
							<table id="presetwrap" cellspacing="0" cellpadding="0" width="100%" summary="periodic reset">
623
								<tr>
624
									<td align="left" valign="top">
625
										<p style="margin: 4px; padding: 4px 0 4px 0; width: 94%;">
626
										<select style="vertical-align:top" id="reset_type" name="pppoe-reset-type" class="formselect" onchange="show_reset_settings(this.value);">
627
											<option value = ""><?= gettext("Disabled"); ?></option>
628
											<option value="custom" <?php if ($pconfig['pppoe-reset-type'] == "custom") echo "selected=\"selected\""; ?>><?= gettext("Custom"); ?></option>
629
											<option value="preset" <?php if ($pconfig['pppoe-reset-type'] == "preset") echo "selected=\"selected\""; ?>><?= gettext("Pre-Set"); ?></option>
630
										</select> <?= gettext("Select a reset timing type"); ?>
631
										</p>
632
										<?php if ($pconfig['pppoe_pr_custom']): ?>
633
											<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoecustomwrap">
634
										<?php else: ?>
635
											<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoecustomwrap">
636
										<?php endif; ?>
637
										<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="<?= htmlspecialchars($pconfig['pppoe_resethour']); ?>" size="3" /> 
638
										<?= gettext("hour (0-23)"); ?><br />
639
										<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="<?= htmlspecialchars($pconfig['pppoe_resetminute']); ?>" size="3" /> 
640
										<?= gettext("minute (0-59)"); ?><br />
641
										<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']);?>" /> 
642
										<?= gettext("reset at a specific date (mm/dd/yyyy)"); ?>
643
										<br />&nbsp;<br />
644
										<span class="red"><strong><?=gettext("Note:");?></strong></span>
645
										<?= 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."); ?>
646
										</p>
647
										<?php if ($pconfig['pppoe_pr_preset']): ?>
648
											<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoepresetwrap">
649
										<?php else: ?>
650
											<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoepresetwrap">
651
										<?php endif; ?>
652
										<input name="pppoe_pr_preset_val" type="radio" id="pppoe_monthly" value="monthly" <?php if ($pconfig['pppoe_monthly']) echo "checked=\"checked\""; ?> /> 
653
										<?= gettext("reset at each month ('0 0 1 * *')"); ?>
654
										<br />
655
										<input name="pppoe_pr_preset_val" type="radio" id="pppoe_weekly" value="weekly" <?php if ($pconfig['pppoe_weekly']) echo "checked=\"checked\""; ?> /> 
656
										<?= gettext("reset at each week ('0 0 * * 0')"); ?>
657
										<br />
658
										<input name="pppoe_pr_preset_val" type="radio" id="pppoe_daily" value="daily" <?php if ($pconfig['pppoe_daily']) echo "checked=\"checked\""; ?> /> 
659
										<?= gettext("reset at each day ('0 0 * * *')"); ?>
660
										<br />
661
										<input name="pppoe_pr_preset_val" type="radio" id="pppoe_hourly" value="hourly" <?php if ($pconfig['pppoe_hourly']) echo "checked=\"checked\""; ?> /> 
662
										<?= gettext("reset at each hour ('0 * * * *')"); ?>
663
										</p>
664
									</td>
665
								</tr>
666
							</table>
667
						</td>
668
					</tr>
669
				</table>
670
			</td>
671
		</tr>
672

    
673
		<?php for($j=0; $j < $port_count; $j++) : ?>
674
		
675
		<tr style="display:none" id="gw_fields<?=$j;?>">
676
			<td width="22%" id="localiplabel<?=$j;?>" valign="top" class="vncell"><?= gettext("Local IP"); ?></td>
677
			<td width="78%" class="vtable"> 
678
				<input name="localip[]" type="text" class="formfld unknown" id="localip<?=$j;?>" size="20"  value="<?=htmlspecialchars($pconfig['localip'][$j]);?>" />
679
				/
680
				<select name="subnet[]" class="formselect" id="subnet<?=$j;?>" disabled="disabled">
681
				<?php for ($i = 31; $i > 0; $i--): ?>
682
					<option value="<?=$i;?>"<?php if ($i == $pconfig['subnet'][$j]) echo " selected=\"selected\""; ?>><?=$i;?></option>
683
				<?php endfor; ?>
684
				</select> <?= gettext("IP Address"); ?>
685
				
686
			</td>
687
		</tr>
688
		<tr style="display:none" id="ip_fields<?=$j;?>">
689
			<td width="22%" id="gatewaylabel<?=$j;?>" valign="top" class="vncell"></td>
690
			<td width="78%" class="vtable">
691
				<input name="gateway[]" type="text" class="formfld unknown" id="gateway<?=$j;?>" size="20" value="<?=htmlspecialchars($pconfig['gateway'][$j]);?>" /><?= gettext("IP Address OR Hostname"); ?>
692
			</td>
693
		</tr><?php endfor; ?>
694

    
695
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
696
			<td colspan="2" valign="top" height="16"></td>
697
		</tr>
698
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
699
			<td colspan="2" valign="top" class="listtopic"><?= gettext("Advanced Options"); ?></td>
700
		</tr>
701
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
702
		<td valign="top" class="vncell"><?= gettext("Dial On Demand"); ?></td>
703
			<td class="vtable">
704
				<input type="checkbox" value="on" id="ondemand" name="ondemand" <?php if (isset($pconfig['ondemand'])) echo "checked=\"checked\""; ?> /> <?= gettext("Enable Dial-on-Demand mode"); ?> 
705
				<br /> <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. " .  
706
				"The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected."); ?> </span>
707
			</td>
708
		</tr>
709
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
710
			<td valign="top" class="vncell"><?= gettext("Idle Timeout"); ?></td>
711
			<td class="vtable">
712
				<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."); ?>
713
				<br /> <span class="vexpl"><?= gettext("If no incoming or outgoing packets are transmitted for the entered number of seconds the connection is brought down.");?>
714
				<br /><?=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>
715
			</td>
716
		</tr>
717
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
718
			<td width="22%" valign="top" class="vncell"><?= gettext("Compression"); ?></td>
719
			<td width="78%" class="vtable">
720
				<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)."); ?>
721
				<br /> <span class="vexpl"><?=gettext("This option enables Van Jacobson TCP header compression, which saves several bytes per TCP data packet. " .
722
				"You almost always want this option. This compression ineffective for TCP connections with enabled modern extensions like time " .
723
				"stamping or SACK, which modify TCP options between sequential packets.");?></span>
724
			</td>
725
		</tr>
726
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
727
			<td width="22%" valign="top" class="vncell"><?= gettext("TCPmssFix"); ?></td>
728
			<td width="78%" class="vtable">
729
				<input type="checkbox" value="on" id="tcpmssfix" name="tcpmssfix" <?php if (isset($pconfig['tcpmssfix'])) echo "checked=\"checked\""; ?> />&nbsp;<?= gettext("Disable tcpmssfix (enabled by default)."); ?>
730
				<br /> <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 ". 
731
				"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, ".
732
				"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, ".
733
				"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 ".
734
				"gets to discover that it must reduce the fragment size or drop the IP Don't Fragment option from its outgoing data.");?></span>
735
			</td>
736
		</tr>
737
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
738
			<td width="22%" valign="top" class="vncell"><?=gettext("ShortSeq");?></td>
739
			<td width="78%" class="vtable">
740
				<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)."); ?>
741
				<br /> <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. " .
742
				"It is not necessary to disable this for connections that are not multi-link."); ?></span>
743
			</td>
744
		</tr>
745
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
746
			<td width="22%" valign="top" class="vncell"><?=gettext("ACFComp"); ?></td>
747
			<td width="78%" class="vtable">
748
				<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)."); ?>
749
				<br /> <span class="vexpl"><?= gettext("Address and control field compression. This option only applies to asynchronous link types. It saves two bytes per frame."); ?></span>
750
			</td>
751
		</tr>
752
		<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
753
			<td width="22%" valign="top" class="vncell"><?=gettext("ProtoComp"); ?></td>
754
			<td width="78%" class="vtable">
755
				<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)."); ?>
756
				<br /> <span class="vexpl"><?= gettext("Protocol field compression. This option saves one byte per frame for most frames."); ?></span>
757
			</td>
758
		</tr>
759
		<tr id="advanced_" name="advanced_">
760
			<td>&nbsp;</td>
761
			<td>
762
			<p><input type="button" onclick="show_advanced(1)" value="<?=gettext("Show advanced options"); ?>" /></p>
763
			</td>
764
			<td style="display:none" id="adv_rows" name="adv_rows"><?=$k;?></td>
765
			<td style="display:none" id="adv_show" name="adv_show">0</td>
766
		</tr>
767
		<?php for($i=0; $i < $port_count; $i++) : ?>
768
		<tr style="display:none" id="link<?=$i;?>">
769
			<td width="22%" valign="top" id="linklabel<?=$i;?>" class="vncell"> <?=gettext("Link Parameters");?></td>
770
			<td class="vtable">
771
				<table name="link_parameters" border="0" cellpadding="6" cellspacing="0" summary="link parameters">
772
					<tr>
773
						<td width="22%" id="bwlabel<?=$i;?>" valign="top"class="vncell"> <?=gettext("Bandwidth");?></td>
774
						<td width="78%" class="vtable">
775
						<br /><input name="bandwidth[]" id="bandwidth<?=$i;?>" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['bandwidth'][$i]);?>" />
776
						<br /> <span class="vexpl"><?=gettext("Set ONLY for MLPPP connections and ONLY when links have different bandwidths.");?></span>
777
					  </td>
778
					</tr>
779
					<tr>
780
					  <td width="22%" id="mtulabel<?=$i;?>" valign="top" class="vncell"> <?=gettext("MTU"); ?></td>
781
					  <td width="78%" class="vtable">
782
						<input name="mtu[]" id="mtu<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mtu'][$i]);?>" />
783
						<br /> <span class="vexpl"><?=gettext("MTU will default to 1492.");?></span>
784
					  </td>
785
					</tr>
786
					<tr>
787
					  <td width="22%" id="mrulabel<?=$i;?>" valign="top" class="vncell"> <?=gettext("MRU"); ?></td>
788
					  <td width="78%" class="vtable">
789
						<input name="mru[]" id="mru<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mru'][$i]);?>" />
790
						<br /> <span class="vexpl">MRU <?=gettext("will be auto-negotiated by default.");?></span>
791
					  </td>
792
					</tr>
793
					<tr>
794
					  <td width="22%" id="mrrulabel<?=$i;?>" valign="top" class="vncell"> <?=gettext("MRRU"); ?></td>
795
					  <td width="78%" class="vtable">
796
						<input name="mrru[]" id="mrru<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mrru'][$i]);?>" />
797
						<br /> <span class="vexpl"><?=gettext("Set ONLY for MLPPP connections.");?> MRRU <?=gettext("will be auto-negotiated by default.");?></span>
798
					  </td>
799
					</tr>
800
				</table>
801
			</td>
802
		</tr><?php endfor; ?>
803
		<tr>
804
			<td width="22%" valign="top">&nbsp;</td>
805
			<td width="78%">
806
				<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
807
				<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
808
				<input name="referer" type="hidden" value="<?=$referer;?>" />
809
				<input name="ptpid" type="hidden" value="<?=htmlspecialchars($pconfig['ptpid']);?>" />
810
				<?php if (isset($id) && $a_ppps[$id]): ?>
811
					<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
812
				<?php endif; ?>
813
			</td>
814
		</tr>
815
	</table>
816
</form>
817
<?php include("fend.inc"); ?>
818
</body>
819
</html>
(107-107/251)