Project

General

Profile

Download (22.4 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	diag_backup.php
5
	Copyright (C) 2004-2009 Scott Ullrich
6
	All rights reserved.
7

    
8
	originally part of m0n0wall (http://m0n0.ch/wall)
9
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
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
/*
35
	pfSense_BUILDER_BINARIES:	/sbin/shutdown
36
	pfSense_MODULE:	backup
37
*/
38

    
39
##|+PRIV
40
##|*IDENT=page-diagnostics-backup/restore
41
##|*NAME=Diagnostics: Backup/restore page
42
##|*DESCR=Allow access to the 'Diagnostics: Backup/restore' page.
43
##|*MATCH=diag_backup.php*
44
##|-PRIV
45

    
46
/* Allow additional execution time 0 = no limit. */
47
ini_set('max_execution_time', '0');
48
ini_set('max_input_time', '0');
49

    
50
/* omit no-cache headers because it confuses IE with file downloads */
51
$omit_nocacheheaders = true;
52
require("guiconfig.inc");
53

    
54
function add_base_packages_menu_items() {
55
	global $g, $config;
56
	$base_packages = split($g['base_packages'], ",");
57
	$modified_config = false;
58
	foreach($base_packages as $bp) {
59
		$basepkg_path = "/usr/local/pkg/{$bp}";
60
		$tmpinfo = pathinfo($basepkg_path, PATHINFO_EXTENSION); 
61
		if($tmpinfo['extension'] == "xml" && file_exists($basepkg_path)) {
62
			$pkg_config = parse_xml_config_pkg($basepkg_path, "packagegui");
63
			if($pkg_config['menu'] != "") {
64
				if(is_array($pkg_config['menu'])) {
65
					foreach($pkg_config['menu'] as $menu) {
66
						if(is_array($config['installedpackages']['menu']))
67
							foreach($config['installedpackages']['menu'] as $amenu)
68
								if($amenu['name'] == $menu['name'])
69
									continue;
70
						$config['installedpackages']['menu'][] = $menu;
71
						$modified_config = true;
72
					}
73
				}
74
				$static_output .= "done.\n";
75
				update_output_window($static_output);
76
			}
77
		}
78
	}
79
	if($modified_config) {
80
		write_confg("Restored base_package menus after configuration restore.");
81
		$config = parse_config(true);
82
	}
83
}
84

    
85
function remove_bad_chars($string) {
86
	return preg_replace('/[^a-z|_|0-9]/i','',$string);
87
}
88

    
89
function check_and_returnif_section_exists($section) {
90
	global $config;
91
	if(is_array($config[$section]))
92
		return true;
93
	return false;
94
}
95

    
96
function spit_out_select_items($area, $showall) {
97
	global $config;
98
		
99
	$areas = array("aliases" => "Aliases", 
100
				   "captiveportal" => "Captive Portal",
101
				   "dnsmasq" => "DNS Forwarder",				
102
				   "dhcpd" => "DHCP Server",
103
				   "filter" => "Firewall Rules",
104
				   "interfaces" => "Interfaces",
105
				   "ipsec" => "IPSEC",
106
				   "nat" => "NAT",
107
				   "ovpn" => "OpenVPN",
108
				   "installedpackages" => "Package Manager",
109
				   "pptpd" => "PPTP Server",
110
				   "cron" => "Scheduled Tasks",				
111
				   "syslog" => "Syslog",
112
				   "system" => "System",
113
				   "staticroutes" => "Static routes",
114
				   "sysctl" => "System tunables",
115
				   "snmpd" => "SNMP Server",
116
				   "shaper" => "Traffic Shaper",
117
				   "vlans" => "VLANS",
118
				   "wol" => "Wake on LAN"
119
	);
120

    
121
	$select  = "<select name=\"{$area}\">\n";
122
	$select .= "<option VALUE=\"\">ALL</option>";
123

    
124
	if($showall == true) 
125
		foreach($areas as $area => $areaname)
126
			$select .= "<option value='{$area}'>{$areaname}</option>\n";
127
	else 
128
		foreach($areas as $area => $areaname)
129
			if(check_and_returnif_section_exists($area) == true)
130
				$select .= "<option value='{$area}'>{$areaname}</option>\n";
131

    
132
	$select .= "</select>\n";
133
		
134
	echo $select;
135

    
136
}
137

    
138
if ($_POST['apply']) {
139
        ob_flush();
140
        flush();
141
        sleep(5);
142
	conf_mount_rw();
143
	clear_subsystem_dirty("restore");
144
	conf_mount_ro();
145
        mwexec("/sbin/shutdown -r now");
146
        exit;
147
}
148

    
149
if ($_POST) {
150
	unset($input_errors);
151
	if (stristr($_POST['Submit'], "Restore configuration"))
152
		$mode = "restore";
153
	else if (stristr($_POST['Submit'], "Reinstall"))
154
		$mode = "reinstallpackages";
155
	else if (stristr($_POST['Submit'], "Download"))
156
		$mode = "download";
157
	else if (stristr($_POST['Submit'], "Restore version"))
158
		$mode = "restore_ver";
159

    
160
	if ($_POST["nopackages"] <> "")
161
		$options = "nopackages";
162

    
163
	if ($_POST["ver"] <> "")
164
		$ver2restore = $_POST["ver"];
165

    
166
	if ($mode) {
167

    
168
		if ($mode == "download") {
169

    
170
			if ($_POST['encrypt']) {
171
				if(!$_POST['encrypt_password'] || !$_POST['encrypt_passconf'])
172
					$input_errors[] = "You must supply and confirm the password for encryption.";
173
				if($_POST['encrypt_password'] != $_POST['encrypt_passconf'])
174
					$input_errors[] = "The supplied 'Password' and 'Confirm' field values must match.";
175
			}
176

    
177
			if (!$input_errors) {
178

    
179
				$lockbckp = lock('config');
180

    
181
				$host = "{$config['system']['hostname']}.{$config['system']['domain']}";
182
				$name = "config-{$host}-".date("YmdHis").".xml";
183
				$data = "";
184

    
185
				if($options == "nopackages") {
186
					$sfn = "{$g['tmp_path']}/config.xml.nopkg";
187
					exec("sed '/<installedpackages>/,/<\/installedpackages>/d' /conf/config.xml > {$sfn}");
188
					$data = file_get_contents($sfn);
189
				} else {
190
					if(!$_POST['backuparea']) {
191
						/* backup entire configuration */
192
						$data = file_get_contents("{$g['conf_path']}/config.xml");
193
					} else {
194
						/* backup specific area of configuration */
195
						$data = backup_config_section($_POST['backuparea']);
196
						$name = "{$_POST['backuparea']}-{$name}";
197
					}
198
				}
199

    
200
				unlock($lockbckp);
201

    
202
				if ($_POST['encrypt']) {
203
					$data = encrypt_data($data, $_POST['encrypt_password']);
204
					tagfile_reformat($data, $data, "config.xml");
205
				}
206

    
207
				/* 
208
				 *  Backup RRD Data
209
				 */
210
				if(!$_POST['donotbackuprrd']) {
211
					$data = str_replace("</pfsense>", "\t<rrddata>", $data);
212
					$rrd_files_var_db_rrd = split("\n",`cd /var/db/rrd && ls *.rrd`);
213
					foreach($rrd_files_var_db_rrd as $rrd) {
214
						if($rrd) {
215
							$rrd_data = file_get_contents("{$g['vardb_path']}/rrd/{$rrd}");
216
							if($rrd_data) {
217
								$data .= "\t\t<rrddatafile>\n";
218
								$data .= "\t\t\t<filename>{$rrd}</filename>\n";
219
								$data .= "\t\t\t<data>" . base64_encode($rrd_data) . "</data>\n";
220
								$data .= "\t\t</rrddatafile>\n";
221
							}
222
						}
223
					}
224
					$data .= "\t</rrddata>\n";
225
					$data .= "</pfsense>\n";
226
				}
227
				
228
				$size = strlen($data);
229
				header("Content-Type: application/octet-stream");
230
				header("Content-Disposition: attachment; filename={$name}");
231
				header("Content-Length: $size");
232
				echo $data;
233

    
234
				exit;
235
			}
236
		}
237

    
238
		if ($mode == "restore") {
239

    
240
			if ($_POST['decrypt']) {
241
				if(!$_POST['decrypt_password'] || !$_POST['decrypt_passconf'])
242
					$input_errors[] = "You must supply and confirm the password for decryption.";
243
				if($_POST['decrypt_password'] != $_POST['decrypt_passconf'])
244
					$input_errors[] = "The supplied 'Password' and 'Confirm' field values must match.";
245
			}
246

    
247
			if (!$input_errors) {
248

    
249
				if (is_uploaded_file($_FILES['conffile']['tmp_name'])) {
250

    
251
					/* read the file contents */
252
					$data = file_get_contents($_FILES['conffile']['tmp_name']);
253
					if(!$data) {
254
						log_error("Warning, could not read file " . $_FILES['conffile']['tmp_name']);
255
						return 1;
256
					}
257

    
258
					if ($_POST['decrypt']) {
259
						if (!tagfile_deformat($data, $data, "config.xml")) {
260
							$input_errors[] = "The uploaded file does not appear to contain an encrypted pfsense configuration.";
261
							return 1;
262
						}
263
						$data = decrypt_data($data, $_POST['decrypt_password']);
264
					}
265

    
266
					if(stristr($data, "m0n0wall")) {
267
						log_error("Upgrading m0n0wall configuration to pfsense.");
268
						/* m0n0wall was found in config.  convert it. */
269
						$data = str_replace("m0n0wall", "pfsense", $data);
270
						$m0n0wall_upgrade = true;
271
					}
272
					if($_POST['restorearea']) {
273
						/* restore a specific area of the configuration */
274
						if(!stristr($data, $_POST['restorearea'])) {
275
							$input_errors[] = "You have selected to restore a area but we could not locate the correct xml tag.";
276
						} else {
277
							restore_config_section($_POST['restorearea'], $data);
278
							filter_configure();
279
							$savemsg = "The configuration area has been restored.  You may need to reboot the firewall.";
280
						}
281
					} else {
282
						if(!stristr($data, "<" . $g['xml_rootobj'] . ">")) {
283
							$input_errors[] = "You have selected to restore the full configuration but we could not locate a " . $g['xml_rootobj'] . " tag.";
284
						} else {
285
							/* restore the entire configuration */
286
							file_put_contents($_FILES['conffile']['tmp_name'], $data);
287
							if (config_install($_FILES['conffile']['tmp_name']) == 0) {
288
								/* this will be picked up by /index.php */
289
								conf_mount_rw();
290
								mark_subsystem_dirty("restore");
291
								$savemsg = "The configuration has been restored. You need to reboot your firewall.";
292
								touch("/conf/needs_package_sync");
293
								/* remove cache, we will force a config reboot */
294
								if(file_exists("{$g['tmp_path']}/config.cache"))
295
									unlink("{$g['tmp_path']}/config.cache");
296
								$config = parse_config(true);
297
								/* extract out rrd items, unset from $confgi when done */
298
								if($config['rrddata']) {
299
									foreach($config['rrddata']['rrddatafile'] as $rrd) {
300
										$rrd_fd = fopen("{$g['vardb_path']}/rrd/{$rrd['filename']}", "w");
301
										fwrite($rrd_fd, base64_decode($rrd['data']));
302
										fclose($rrd_fd);
303
									}
304
									unset($config['rrddata']);
305
									unlink_if_exists("{$g['tmp_path']}/config.cache");
306
									write_config();
307
									add_base_packages_menu_items();
308
									convert_config();
309
									conf_mount_ro();
310
								}
311
								if($m0n0wall_upgrade == true) {
312
									if($config['system']['gateway'] <> "")
313
										$config['interfaces']['wan']['gateway'] = $config['system']['gateway'];
314
									unset($config['shaper']);
315
									/* optional if list */
316
									$ifdescrs = get_configured_interface_list(true, true);
317
									/* remove special characters from interface descriptions */
318
									if(is_array($ifdescrs))
319
										foreach($ifdescrs as $iface)
320
											$config['interfaces'][$iface]['descr'] = remove_bad_chars($config['interfaces'][$iface]['descr']);
321
									/* check for interface names with an alias */
322
									if(is_array($ifdescrs)) {
323
										foreach($ifdescrs as $iface) {
324
											if(is_alias($config['interfaces'][$iface]['descr'])) {
325
												// Firewall rules
326
												$origname = $config['interfaces'][$iface]['descr'];
327
												$newname  = $config['interfaces'][$iface]['descr'] . "Alias";
328
												update_alias_names_upon_change('filter', 'rule', 'source', 'address', $newname, $origname);
329
												update_alias_names_upon_change('filter', 'rule', 'destination', 'address', $newname, $origname);
330
												// NAT Rules
331
												update_alias_names_upon_change('nat', 'rule', 'target', '', $newname, $origname);
332
												update_alias_names_upon_change('nat', 'rule', 'external-port', '', $newname, $origname);
333
												update_alias_names_upon_change('nat', 'rule', 'local-port', '', $newname, $origname);
334
												// Alias in an alias
335
												update_alias_names_upon_change('aliases', 'alias', 'address', '', $newname, $origname);
336
											}
337
										}
338
									}
339
									unlink_if_exists("{$g['tmp_path']}/config.cache");
340
									// Reset configuration version to something low
341
									// in order to force the config upgrade code to 
342
									// run through with all steps that are required.
343
									$config['system']['version'] = "1.0";
344
									// Deal with descriptions longer than 63 characters
345
									for ($i = 0; isset($config["filter"]["rule"][$i]); $i++) {
346
										if(count($config['filter']['rule'][$i]['descr']) > 63)
347
											$config['filter']['rule'][$i]['descr'] = substr($config['filter']['rule'][$i]['descr'], 0, 63);
348
									}
349
									// Move interface from ipsec to enc0
350
									for ($i = 0; isset($config["filter"]["rule"][$i]); $i++) {
351
										if($config['filter']['rule'][$i]['interface'] == "ipsec")
352
											$config['filter']['rule'][$i]['interface'] = "enc0";
353
									}
354
									// Convert icmp types
355
									// http://www.openbsd.org/cgi-bin/man.cgi?query=icmp&sektion=4&arch=i386&apropos=0&manpath=OpenBSD+Current
356
									for ($i = 0; isset($config["filter"]["rule"][$i]); $i++) {
357
										if($config["filter"]["rule"][$i]['icmptype']) {
358
											switch($config["filter"]["rule"][$i]['icmptype']) {
359
												case "echo":
360
													$config["filter"]["rule"][$i]['icmptype'] = "echoreq";
361
													break;
362
					                            case "unreach":
363
													$config["filter"]["rule"][$i]['icmptype'] = "unreach";
364
													break;
365
					                            case "echorep":
366
													$config["filter"]["rule"][$i]['icmptype'] = "echorep";
367
													break;
368
					                            case "squench":
369
													$config["filter"]["rule"][$i]['icmptype'] = "squench";
370
													break;
371
					                            case "redir":
372
													$config["filter"]["rule"][$i]['icmptype'] = "redir";
373
													break;
374
					                            case "timex":
375
													$config["filter"]["rule"][$i]['icmptype'] = "timex";
376
													break;
377
					                            case "paramprob":
378
													$config["filter"]["rule"][$i]['icmptype'] = "paramprob";
379
													break;
380
					                            case "timest":
381
													$config["filter"]["rule"][$i]['icmptype'] = "timereq";
382
													break;
383
					                            case "timestrep":
384
													$config["filter"]["rule"][$i]['icmptype'] = "timerep";
385
													break;
386
					                            case "inforeq":
387
													$config["filter"]["rule"][$i]['icmptype'] = "inforeq";
388
													break;
389
					                            case "inforep":
390
													$config["filter"]["rule"][$i]['icmptype'] = "inforep";
391
													break;
392
					                            case "maskreq":
393
													$config["filter"]["rule"][$i]['icmptype'] = "maskreq";
394
													break;
395
					                            case "maskrep":
396
													$config["filter"]["rule"][$i]['icmptype'] = "maskrep";
397
													break;
398
											}
399
										}
400
									}
401
									$config['diag']['ipv6nat'] = true;
402
									write_config();
403
									add_base_packages_menu_items();									
404
									convert_config();
405
									conf_mount_ro();
406
									$savemsg = "The m0n0wall configuration has been restored and upgraded to pfSense. You need to reboot your firewall.";
407
									mark_subsystem_dirty("restore");
408
								}
409
								if(isset($config['captiveportal']['enable'])) {
410
									/* for some reason ipfw doesn't init correctly except on bootup sequence */
411
									$savemsg = "The configuration has been restored. You need to reboot your firewall.";
412
									mark_subsystem_dirty("restore");
413
								}
414
								setup_serial_port();
415
								if(is_interface_mismatch() == true) {
416
									touch("/var/run/interface_mismatch_reboot_needed");
417
									clear_subsystem_dirty("restore");
418
									convert_config();
419
									header("Location: interfaces_assign.php");
420
									exit;
421
								}
422
							} else {
423
								$input_errors[] = "The configuration could not be restored.";
424
							}
425
						}
426
					}
427
				} else {
428
					$input_errors[] = "The configuration could not be restored (file upload error).";
429
				}
430
			}
431
		}
432

    
433
		if ($mode == "reinstallpackages") {
434

    
435
			header("Location: pkg_mgr_install.php?mode=reinstallall");
436
			exit;
437
                } else if ($mode == "restore_ver") {
438
			$input_errors[] = "XXX - this feature may hose your config (do NOT backrev configs!) - billm";
439
			if ($ver2restore <> "") {
440
				$conf_file = "{$g['cf_conf_path']}/bak/config-" . strtotime($ver2restore) . ".xml";
441
                                if (config_install($conf_file) == 0) {
442
					mark_subsystem_dirty("restore");
443
					$savemsg = "The configuration has been restored. You need to reboot your firewall.";
444
                                } else {
445
                                	$input_errors[] = "The configuration could not be restored.";
446
                                }
447
                        } else {
448
                                $input_errors[] = "No version selected.";
449
                        }
450
		}
451
	}
452
}
453

    
454
$id = rand() . '.' . time();
455

    
456
$mth = ini_get('upload_progress_meter.store_method');
457
$dir = ini_get('upload_progress_meter.file.filename_template');
458

    
459
$pgtitle = array("Diagnostics","Backup/restore");
460
include("head.inc");
461

    
462
?>
463

    
464
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
465
<?php include("fbegin.inc"); ?>
466
<script language="JavaScript">
467
<!--
468

    
469
function encrypt_change() {
470

    
471
	if (!document.iform.encrypt.checked)
472
		document.getElementById("encrypt_opts").style.display="none";
473
	else
474
		document.getElementById("encrypt_opts").style.display="";
475
}
476

    
477
function decrypt_change() {
478

    
479
	if (!document.iform.decrypt.checked)
480
		document.getElementById("decrypt_opts").style.display="none";
481
	else
482
		document.getElementById("decrypt_opts").style.display="";
483
}
484

    
485
//-->
486
</script>
487
<form action="diag_backup.php" method="post" name="iform" enctype="multipart/form-data">
488
<?php if ($input_errors) print_input_errors($input_errors); ?>
489
<?php if ($savemsg) print_info_box($savemsg); ?>
490
<?php if (is_subsystem_dirty('restore')): ?><p>
491
<?php print_info_box_np("The firewall configuration has been changed.<br>You must apply the new config by restarting the firewall in order for changes to take effect.", "apply", "Reboot firewall");?><br>
492
<?php endif; ?>
493
<table width="100%" border="0" cellspacing="0" cellpadding="0">
494
	<tr>
495
		<td>
496
<?php
497
		$tab_array = array();
498
		$tab_array[0] = array("Config History", false, "diag_confbak.php");
499
		$tab_array[1] = array("Backup/Restore", true, "diag_backup.php");
500
		display_top_tabs($tab_array);
501
?>
502
		</td>
503
	</tr>
504
	<tr>
505
		<td>
506
			<div id="mainarea">
507
			<table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
508
				<tr>
509
					<td colspan="2" class="listtopic">Backup configuration</td>
510
				</tr>
511
				<tr>
512
					<td width="22%" valign="baseline" class="vncell">&nbsp;</td>
513
					<td width="78%" class="vtable">
514
						<p>Click this button to download the system configuration in XML format.<br /><br /> Backup area: <?php spit_out_select_items("backuparea", false); ?></p>
515
						<table>
516
							<tr>
517
								<td>
518
									<input name="nopackages" type="checkbox" class="formcheckbox" id="nopackages">
519
								</td>
520
								<td>
521
									<span class="vexpl">Do not backup package information.</span>
522
								</td>
523
							</tr>
524
						</table>
525
						<table>
526
							<tr>
527
								<td>
528
									<input name="encrypt" type="checkbox" class="formcheckbox" id="nopackages" onClick="encrypt_change()">
529
								</td>
530
								<td>
531
									<span class="vexpl">Encrypt this configuration file.</span>
532
								</td>
533
							</tr>
534
							<tr>
535
								<td>
536
									<input name="donotbackuprrd" type="checkbox" class="formcheckbox" id="dotnotbackuprrd">
537
								</td>
538
								<td>
539
									<span class="vexpl">Do not backup RRD data (NOTE: RRD Data can consume 4+ megabytes of config.xml space!)</span>
540
								</td>
541
							</tr>
542
						</table>
543
						<table id="encrypt_opts">
544
							<tr>
545
								<td>
546
									<span class="vexpl">Password :</span>
547
								</td>
548
								<td>
549
									<input name="encrypt_password" type="password" class="formfld pwd" size="20" value="" />
550
								</td>
551
							</tr>
552
							<tr>
553
								<td>
554
									<span class="vexpl">confirm :</span>
555
								</td>
556
								<td>
557
									<input name="encrypt_passconf" type="password" class="formfld pwd" size="20" value="" />
558
								</td>
559
							</tr>
560
						</table>
561
						<p><input name="Submit" type="submit" class="formbtn" id="download" value="Download configuration"></p>
562
					</td>
563
				</tr>
564
				<tr>
565
					<td colspan="2" class="list" height="12">&nbsp;</td>
566
                </tr>
567
                <tr>
568
					<td colspan="2" class="listtopic">Restore configuration</td>
569
				</tr>
570
				<tr>
571
					<td width="22%" valign="baseline" class="vncell">&nbsp;</td>
572
					<td width="78%" class="vtable">
573
						Open a <?=$g['[product_name']?> configuration XML file and click the button below to restore the configuration. <br /><br /> Restore area: <?php spit_out_select_items("restorearea", true); ?>
574
						<p><input name="conffile" type="file" class="formfld unknown" id="conffile" size="40"></p>
575
						<table>
576
							<tr>
577
								<td>
578
									<input name="decrypt" type="checkbox" class="formcheckbox" id="nopackages" onClick="decrypt_change()">
579
								</td>
580
								<td>
581
									<span class="vexpl">Configuration file is encrypted.</span>
582
								</td>
583
							</tr>
584
						</table>
585
						<table id="decrypt_opts">
586
							<tr>
587
								<td>
588
									<span class="vexpl">Password :</span>
589
								</td>
590
								<td>
591
									<input name="decrypt_password" type="password" class="formfld pwd" size="20" value="" />
592
								</td>
593
							</tr>
594
							<tr>
595
								<td>
596
									<span class="vexpl">confirm :</span>
597
								</td>
598
								<td>
599
									<input name="decrypt_passconf" type="password" class="formfld pwd" size="20" value="" />
600
								</td>
601
							</tr>
602
						</table>
603
						<p><input name="Submit" type="submit" class="formbtn" id="restore" value="Restore configuration"></p>
604
                      	<p><strong><span class="red">Note:</span></strong><br />The firewall may need a reboot after restoring the configuration.<br /></p>
605
					</td>
606
				</tr>
607
				<?php if($config['installedpackages']['package'] != "") { ?>
608
				<tr>
609
					<td colspan="2" class="list" height="12">&nbsp;</td>
610
				</tr>
611
				<tr>
612
					<td colspan="2" class="listtopic">Reinstall packages</td>
613
				</tr>
614
				<tr>
615
					<td width="22%" valign="baseline" class="vncell">&nbsp;</td>
616
					<td width="78%" class="vtable">
617
						<p>Click this button to reinstall all system packages.  This may take a while. <br /><br />
618
		  				<input name="Submit" type="submit" class="formbtn" id="reinstallpackages" value="Reinstall packages">
619
					</td>
620
				</tr>
621
				<?php } ?>
622
			</table>
623
			</div>
624
		</td>
625
	</tr>
626
</table>
627
</form>
628

    
629
<script language="JavaScript">
630
<!--
631
encrypt_change();
632
decrypt_change();
633
//-->
634
</script>
635

    
636
<?php include("fend.inc"); ?>
637
</body>
638
</html>
(5-5/218)