1
|
#!/usr/local/bin/php
|
2
|
<?php
|
3
|
/* $Id$ */
|
4
|
/*
|
5
|
diag_defaults.php
|
6
|
Copyright (C) 2004 Scott Ullrich
|
7
|
All rights reserved.
|
8
|
|
9
|
originially part of m0n0wall (http://m0n0.ch/wall)
|
10
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
11
|
All rights reserved.
|
12
|
|
13
|
Redistribution and use in source and binary forms, with or without
|
14
|
modification, are permitted provided that the following conditions are met:
|
15
|
|
16
|
1. Redistributions of source code must retain the above copyright notice,
|
17
|
this list of conditions and the following disclaimer.
|
18
|
|
19
|
2. Redistributions in binary form must reproduce the above copyright
|
20
|
notice, this list of conditions and the following disclaimer in the
|
21
|
documentation and/or other materials provided with the distribution.
|
22
|
|
23
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
24
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
25
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
26
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
27
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
28
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
29
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
30
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
31
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
32
|
POSSIBILITY OF SUCH DAMAGE.
|
33
|
*/
|
34
|
|
35
|
require("guiconfig.inc");
|
36
|
|
37
|
if ($_POST) {
|
38
|
if ($_POST['Submit'] != " No ") {
|
39
|
reset_factory_defaults();
|
40
|
system_reboot();
|
41
|
$rebootmsg = "The system has been reset to factory defaults and is now rebooting. This may take one minute.";
|
42
|
} else {
|
43
|
header("Location: index.php");
|
44
|
exit;
|
45
|
}
|
46
|
}
|
47
|
?>
|
48
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
49
|
<html>
|
50
|
<head>
|
51
|
<title><?=gentitle("Diagnostics: Factory defaults");?></title>
|
52
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
53
|
<link href="gui.css" rel="stylesheet" type="text/css">
|
54
|
</head>
|
55
|
|
56
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
57
|
<?php include("fbegin.inc"); ?>
|
58
|
<p class="pgtitle">Diagnostics: Factory defaults</p>
|
59
|
<?php if ($rebootmsg): echo print_info_box($rebootmsg); else: ?>
|
60
|
<form action="diag_defaults.php" method="post">
|
61
|
<p><strong>If you click "Yes", the firewall will be reset
|
62
|
to factory defaults and will reboot immediately. The entire system
|
63
|
configuration will be overwritten. The LAN IP address will be
|
64
|
reset to 192.168.1.1, the system will be configured as a DHCP
|
65
|
server, the WAN interface will be set to obtain an address from a DHCP server
|
66
|
and the password will be set to 'pfsense'.<br>
|
67
|
<br>
|
68
|
Are you sure you want to proceed?</strong></p>
|
69
|
<p>
|
70
|
<input name="Submit" type="submit" class="formbtn" value=" Yes ">
|
71
|
<input name="Submit" type="submit" class="formbtn" value=" No ">
|
72
|
</p>
|
73
|
</form>
|
74
|
<?php endif; ?>
|
75
|
<?php include("fend.inc"); ?>
|
76
|
</body>
|
77
|
</html>
|