Project

General

Profile

Download (22.9 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
require_once("functions.inc");
54
require_once("filter.inc");
55
require_once("shaper.inc");
56

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

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

    
92
function check_and_returnif_section_exists($section) {
93
	global $config;
94
	if(is_array($config[$section]))
95
		return true;
96
	return false;
97
}
98

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

    
124
	$select  = "<select name=\"{$area}\">\n";
125
	$select .= "<option VALUE=\"\">ALL</option>";
126

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

    
135
	$select .= "</select>\n";
136
		
137
	echo $select;
138

    
139
}
140

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

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

    
163
	if ($_POST["nopackages"] <> "")
164
		$options = "nopackages";
165

    
166
	if ($_POST["ver"] <> "")
167
		$ver2restore = $_POST["ver"];
168

    
169
	if ($mode) {
170

    
171
		if ($mode == "download") {
172

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

    
180
			if (!$input_errors) {
181

    
182
				$lockbckp = lock('config');
183

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

    
188
				if($options == "nopackages") {
189
					if(!$_POST['backuparea']) {
190
						/* backup entire configuration */
191
						$data = file_get_contents("{$g['conf_path']}/config.xml");
192
					} else {
193
						/* backup specific area of configuration */
194
						$data = backup_config_section($_POST['backuparea']);
195
						$name = "{$_POST['backuparea']}-{$name}";
196
					}
197
					$sfn = "{$g['tmp_path']}/config.xml.nopkg";
198
					file_put_contents($sfn, $data);
199
					exec("sed '/<installedpackages>/,/<\/installedpackages>/d' {$sfn} > {$sfn}-new");
200
					$data = file_get_contents($sfn . "-new");					
201
				} else {
202
					if(!$_POST['backuparea']) {
203
						/* backup entire configuration */
204
						$data = file_get_contents("{$g['conf_path']}/config.xml");
205
					} else {
206
						/* backup specific area of configuration */
207
						$data = backup_config_section($_POST['backuparea']);
208
						$name = "{$_POST['backuparea']}-{$name}";
209
					}
210
				}
211

    
212
				unlock($lockbckp);
213

    
214
				if ($_POST['encrypt']) {
215
					$data = encrypt_data($data, $_POST['encrypt_password']);
216
					tagfile_reformat($data, $data, "config.xml");
217
				}
218

    
219
				/* 
220
				 *  Backup RRD Data
221
				 */
222
				if(!$_POST['donotbackuprrd']) {
223
					$data = str_replace("</pfsense>", "\t<rrddata>", $data);
224
					$rrd_files_var_db_rrd = split("\n",`cd /var/db/rrd && ls *.rrd`);
225
					foreach($rrd_files_var_db_rrd as $rrd) {
226
						if($rrd) {
227
							$rrd_data = file_get_contents("{$g['vardb_path']}/rrd/{$rrd}");
228
							if($rrd_data) {
229
								$data .= "\t\t<rrddatafile>\n";
230
								$data .= "\t\t\t<filename>{$rrd}</filename>\n";
231
								$data .= "\t\t\t<data>" . base64_encode($rrd_data) . "</data>\n";
232
								$data .= "\t\t</rrddatafile>\n";
233
							}
234
						}
235
					}
236
					$data .= "\t</rrddata>\n";
237
					$data .= "</pfsense>\n";
238
				}
239
				
240
				$size = strlen($data);
241
				header("Content-Type: application/octet-stream");
242
				header("Content-Disposition: attachment; filename={$name}");
243
				header("Content-Length: $size");
244
				echo $data;
245

    
246
				exit;
247
			}
248
		}
249

    
250
		if ($mode == "restore") {
251

    
252
			if ($_POST['decrypt']) {
253
				if(!$_POST['decrypt_password'] || !$_POST['decrypt_passconf'])
254
					$input_errors[] = "You must supply and confirm the password for decryption.";
255
				if($_POST['decrypt_password'] != $_POST['decrypt_passconf'])
256
					$input_errors[] = "The supplied 'Password' and 'Confirm' field values must match.";
257
			}
258

    
259
			if (!$input_errors) {
260

    
261
				if (is_uploaded_file($_FILES['conffile']['tmp_name'])) {
262

    
263
					/* read the file contents */
264
					$data = file_get_contents($_FILES['conffile']['tmp_name']);
265
					if(!$data) {
266
						log_error("Warning, could not read file " . $_FILES['conffile']['tmp_name']);
267
						return 1;
268
					}
269

    
270
					if ($_POST['decrypt']) {
271
						if (!tagfile_deformat($data, $data, "config.xml")) {
272
							$input_errors[] = "The uploaded file does not appear to contain an encrypted pfsense configuration.";
273
							return 1;
274
						}
275
						$data = decrypt_data($data, $_POST['decrypt_password']);
276
					}
277

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

    
445
		if ($mode == "reinstallpackages") {
446

    
447
			header("Location: pkg_mgr_install.php?mode=reinstallall");
448
			exit;
449
                } else if ($mode == "restore_ver") {
450
			$input_errors[] = "XXX - this feature may hose your config (do NOT backrev configs!) - billm";
451
			if ($ver2restore <> "") {
452
				$conf_file = "{$g['cf_conf_path']}/bak/config-" . strtotime($ver2restore) . ".xml";
453
                                if (config_install($conf_file) == 0) {
454
					mark_subsystem_dirty("restore");
455
					$savemsg = "The configuration has been restored. You need to reboot your firewall.";
456
                                } else {
457
                                	$input_errors[] = "The configuration could not be restored.";
458
                                }
459
                        } else {
460
                                $input_errors[] = "No version selected.";
461
                        }
462
		}
463
	}
464
}
465

    
466
$id = rand() . '.' . time();
467

    
468
$mth = ini_get('upload_progress_meter.store_method');
469
$dir = ini_get('upload_progress_meter.file.filename_template');
470

    
471
$pgtitle = array("Diagnostics","Backup/restore");
472
include("head.inc");
473

    
474
?>
475

    
476
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
477
<?php include("fbegin.inc"); ?>
478
<script language="JavaScript">
479
<!--
480

    
481
function encrypt_change() {
482

    
483
	if (!document.iform.encrypt.checked)
484
		document.getElementById("encrypt_opts").style.display="none";
485
	else
486
		document.getElementById("encrypt_opts").style.display="";
487
}
488

    
489
function decrypt_change() {
490

    
491
	if (!document.iform.decrypt.checked)
492
		document.getElementById("decrypt_opts").style.display="none";
493
	else
494
		document.getElementById("decrypt_opts").style.display="";
495
}
496

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

    
641
<script language="JavaScript">
642
<!--
643
encrypt_change();
644
decrypt_change();
645
//-->
646
</script>
647

    
648
<?php include("fend.inc"); ?>
649
</body>
650
</html>
(5-5/214)