Projet

Général

Profil

Télécharger (39,3 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / interfaces_ppps_edit.php @ 1b244d38

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

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

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

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

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

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

    
44
require("guiconfig.inc");
45
require("functions.inc");
46

    
47
define("CRON_MONTHLY_PATTERN", "0 0 1 * *");
48
define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
49
define("CRON_DAILY_PATTERN", "0 0 * * *");
50
define("CRON_HOURLY_PATTERN", "0 * * * *");
51

    
52
if (!is_array($config['ppps']['ppp']))
53
	$config['ppps']['ppp'] = array();
54

    
55
$a_ppps = &$config['ppps']['ppp'];
56

    
57
$iflist = get_configured_interface_with_descr();
58
$portlist = get_interface_list();
59
$portlist = array_merge($portlist, $iflist);
60

    
61
if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) {
62
	foreach ($config['vlans']['vlan'] as $vlan) {
63
		$portlist[$vlan['vlanif']] = $vlan;
64
	}
65
}
66

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

    
167
if ($_POST) {
168

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

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

    
256
/*
257
	foreach ($a_ppps as $ppp) {
258
		if (isset($id) && ($a_ppps[$id]) && ($a_ppps[$id] === $ppp))
259
			continue;
260

    
261
		if ($ppp['serialport'] == $_POST['serialport']) {
262
			$input_errors[] = "Serial port is in use";
263
			break;
264
		}
265
	}
266
*/	
267

    
268
	if (!$input_errors) {
269
		$ppp = array();
270
		$ppp['ptpid'] = $_POST['ptpid'];
271
		$ppp['type'] = $_POST['type'];
272
		$ppp['if'] = $ppp['type'].$ppp['ptpid'];
273
		$ppp['ports'] = implode(',',$_POST['interfaces']);
274
		$ppp['username'] = $_POST['username'];
275
		$ppp['password'] = base64_encode($_POST['password']);
276
		$ppp['ondemand'] = $_POST['ondemand'] ? true : false;
277
		if (!empty($_POST['idletimeout']))
278
			$ppp['idletimeout'] = $_POST['idletimeout'];
279
		else
280
			unset($ppp['idletimeout']);
281
		$ppp['uptime'] = $_POST['uptime'] ? true : false;
282
		if (!empty($_POST['descr']))
283
			$ppp['descr'] = $_POST['descr'];
284
		else
285
			unset($ppp['descr']);
286

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

    
367
		if (isset($id) && $a_ppps[$id])
368
			$a_ppps[$id] = $ppp;
369
		else
370
			$a_ppps[] = $ppp;
371

    
372
		write_config();
373
		configure_cron();
374

    
375
		foreach ($iflist as $pppif => $ifdescr) {
376
			if ($config['interfaces'][$pppif]['if'] == $ppp['if'])
377
				interface_ppps_configure($pppif);
378
		}
379
		header("Location: interfaces_ppps.php");
380
		exit;
381
	}
382
} // end if($_POST)
383

    
384
$closehead = false;
385
$pgtitle = array(gettext("Interfaces"),gettext("PPPs"),gettext("Edit"));
386
$shortcut_section = "interfaces";
387
include("head.inc");
388

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

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

    
432
				<br /><span class="vexpl"><?= gettext("Select at least two interfaces for Multilink (MLPPP) connections."); ?></span>
433
			</td>
434
		</tr>
435
		<tr style="display:none" name="portlists" id="portlists">
436
			<td id="serialports"><?php
437
				$selected_ports = explode(',',$pconfig['interfaces']);
438
				if (!is_dir("/var/spool/lock"))
439
					mwexec("/bin/mkdir -p /var/spool/lock");
440
				// $serialports = pfSense_get_modem_devices();
441
				$serialports = glob("/dev/cua?[0-9]{,.[0-9]}", GLOB_BRACE);
442
				$serport_count = 0;
443
				foreach ($serialports as $port) {
444
					$serport_count++;
445
					echo $port.",".trim($port);
446
					if (in_array($port,$selected_ports))
447
						echo ",1|";
448
					else
449
						echo ",|";
450
				}
451
				echo $serport_count;
452
			?></td>
453
			<td id="ports"><?php
454
				$port_count = 0;
455
				foreach ($portlist as $ifn => $ifinfo){
456
				$port_count++;
457
					$string = "";
458
					if (is_array($ifinfo)) {
459
						$string .= $ifn;
460
						if ($ifinfo['mac'])
461
						$string .= " ({$ifinfo['mac']})";	
462
					} else
463
						$string .= $ifinfo;
464
					$string .= ",{$ifn}";
465
					echo htmlspecialchars($string);
466
					if (in_array($ifn,$selected_ports))
467
						echo ",1|";
468
					else
469
						echo ",|";
470
				}
471
				echo $port_count;
472
				if($serport_count > $port_count)
473
					$port_count=$serport_count;
474
			?></td>
475
			<td style="display:none" name="port_count" id="port_count"><?=htmlspecialchars($port_count);?></td>
476
		</tr>
477
		<tr>
478
			<td width="22%" valign="top" class="vncell"><?= gettext("Description"); ?></td>
479
			<td width="78%" class="vtable">
480
				<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
481
				<br /> <span class="vexpl"><?= gettext("You may enter a description here for your reference. Description will appear in the \"Interfaces Assign\" select lists."); ?></span>
482
			</td>
483
		</tr>	
484
		<tr style="display:none" name="select" id="select"><td style="display:none"></td></tr>
485
		<?php $k=0; ?>
486
		<tr style="display:none" name="ppp_provider" id="ppp_provider">
487
			<td width="22%" valign="top" class="vncell"><?= gettext("Service Provider"); ?></td>
488
			<td width="78%" class="vtable">
489
				<table border="0" cellpadding="0" cellspacing="0" summary="service provider">
490
					<tr id="trcountry" style="display:none">
491
						<td><?= gettext("Country:"); ?> &nbsp;&nbsp;</td>
492
						<td>
493
							<select class="formselect" name="country" id="country" onchange="providers_list()">
494
								<option></option>
495
							</select>
496
						</td>
497
					</tr>
498
					<tr id="trprovider" style="display:none">
499
						<td><?= gettext("Provider:"); ?> &nbsp;&nbsp;</td>
500
						<td>
501
							<select class="formselect" name="provider" id="provider" onchange="providerplan_list()">
502
								<option></option>
503
							</select>
504
						</td>
505
					</tr>
506
					<tr id="trproviderplan" style="display:none">
507
						<td><?= gettext("Plan:"); ?> &nbsp;&nbsp;</td>
508
						<td>
509
							<select class="formselect" name="providerplan" id="providerplan" onchange="prefill_provider()">
510
								<option></option>
511
							</select>
512
						</td>
513
					</tr>
514
				</table>
515
				<br /><span class="vexpl"><?= gettext("Select to fill in data for your service provider."); ?></span>
516
			</td>
517
		</tr>
518
		<tr>
519
			<td width="22%" valign="top" class="vncell"><?= gettext("Username"); ?></td>
520
			<td width="78%" class="vtable">
521
			<input name="username" type="text" class="formfld user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>" />
522
			</td>
523
		</tr>
524
		<tr>
525
			<td width="22%" valign="top" class="vncell"><?= gettext("Password"); ?></td>
526
			<td width="78%" class="vtable">
527
			<input name="password" type="password" class="formfld pwd" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>" />
528
			</td>
529
		</tr>
530

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

    
658
		<?php for($j=0; $j < $port_count; $j++) : ?>
659
		
660
		<tr style="display:none" id="gw_fields<?=$j;?>">
661
			<td width="22%" id="localiplabel<?=$j;?>" valign="top" class="vncell"><?= gettext("Local IP"); ?></td>
662
			<td width="78%" class="vtable"> 
663
				<input name="localip[]" type="text" class="formfld unknown" id="localip<?=$j;?>" size="20"  value="<?=htmlspecialchars($pconfig['localip'][$j]);?>" />
664
				/
665
				<select name="subnet[]" class="formselect" id="subnet<?=$j;?>" disabled="disabled">
666
				<?php for ($i = 31; $i > 0; $i--): ?>
667
					<option value="<?=$i;?>"<?php if ($i == $pconfig['subnet'][$j]) echo " selected=\"selected\""; ?>><?=$i;?></option>
668
				<?php endfor; ?>
669
				</select> <?= gettext("IP Address"); ?>
670
				
671
			</td>
672
		</tr>
673
		<tr style="display:none" id="ip_fields<?=$j;?>">
674
			<td width="22%" id="gatewaylabel<?=$j;?>" valign="top" class="vncell"></td>
675
			<td width="78%" class="vtable">
676
				<input name="gateway[]" type="text" class="formfld unknown" id="gateway<?=$j;?>" size="20" value="<?=htmlspecialchars($pconfig['gateway'][$j]);?>" /><?= gettext("IP Address OR Hostname"); ?>
677
			</td>
678
		</tr><?php endfor; ?>
679

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