Project

General

Profile

Download (4.84 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
 * diag_defaults.php
4
 *
5
 * part of pfSense (https://www.pfsense.org)
6
 * Copyright (c) 2004-2016 Electric Sheep Fencing, LLC
7
 * All rights reserved.
8
 *
9
 * originally based on 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
21
 *    the documentation and/or other materials provided with the
22
 *    distribution.
23
 *
24
 * 3. All advertising materials mentioning features or use of this software
25
 *    must display the following acknowledgment:
26
 *    "This product includes software developed by the pfSense Project
27
 *    for use in the pfSense® software distribution. (http://www.pfsense.org/).
28
 *
29
 * 4. The names "pfSense" and "pfSense Project" must not be used to
30
 *    endorse or promote products derived from this software without
31
 *    prior written permission. For written permission, please contact
32
 *    coreteam@pfsense.org.
33
 *
34
 * 5. Products derived from this software may not be called "pfSense"
35
 *    nor may "pfSense" appear in their names without prior written
36
 *    permission of the Electric Sheep Fencing, LLC.
37
 *
38
 * 6. Redistributions of any form whatsoever must retain the following
39
 *    acknowledgment:
40
 *
41
 * "This product includes software developed by the pfSense Project
42
 * for use in the pfSense software distribution (http://www.pfsense.org/).
43
 *
44
 * THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
45
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
47
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
48
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
49
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
50
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
51
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
53
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
54
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
55
 * OF THE POSSIBILITY OF SUCH DAMAGE.
56
 */
57

    
58
##|+PRIV
59
##|*IDENT=page-diagnostics-factorydefaults
60
##|*NAME=Diagnostics: Factory defaults
61
##|*DESCR=Allow access to the 'Diagnostics: Factory defaults' page.
62
##|*MATCH=diag_defaults.php*
63
##|-PRIV
64

    
65
require_once("guiconfig.inc");
66

    
67
if ($_POST['Submit'] == " " . gettext("No") . " ") {
68
	header("Location: index.php");
69
	exit;
70
}
71

    
72
$pgtitle = array(gettext("Diagnostics"), gettext("Factory Defaults"));
73
include("head.inc");
74
?>
75

    
76
<?php if ($_POST['Submit'] == " " . gettext("Yes") . " "):
77
	print_info_box(gettext("The system has been reset to factory defaults and is now rebooting. This may take a few minutes, depending on the hardware."))?>
78
<pre>
79
<?php
80
	reset_factory_defaults();
81
	system_reboot();
82
?>
83
</pre>
84
<?php else:?>
85
<div class="panel panel-default">
86
	<div class="panel-heading">
87
		<h2 class="panel-title"><?=gettext("Factory Defaults Reset")?></h2>
88
	</div>
89
	<div class="panel-body">
90
		<div class="content">
91
			<form action="diag_defaults.php" method="post">
92
				<p><strong><?=gettext('Resetting the system to factory defaults will remove all user configuration and apply the following settings:')?></strong></p>
93
				<ul>
94
					<li><?=gettext("Reset to factory defaults")?></li>
95
					<li><?=gettext("LAN IP address will be reset to 192.168.1.1")?></li>
96
					<li><?=gettext("System will be configured as a DHCP server on the default LAN interface")?></li>
97
					<li><?=gettext("Reboot after changes are installed")?></li>
98
					<li><?=gettext("WAN interface will be set to obtain an address automatically from a DHCP server")?></li>
99
					<li><?=gettext("webConfigurator admin username will be reset to 'admin'")?></li>
100
					<li><?=sprintf(gettext("webConfigurator admin password will be reset to '%s'"), $g['factory_shipped_password'])?></li>
101
				</ul>
102
				<p><strong><?=gettext("Are you sure you want to proceed?")?></strong></p>
103
				<p>
104
					<button name="Submit" type="submit" class="btn btn-sm btn-danger" value=" <?=gettext("Yes")?> " title="<?=gettext("Perform a factory reset")?>">
105
						<i class="fa fa-undo"></i>
106
						<?=gettext("Factory Reset")?>
107
					</button>
108
					<button name="Submit" type="submit" class="btn btn-sm btn-success" value=" <?=gettext("No")?> " title="<?=gettext("Return to the dashboard")?>">
109
						<i class="fa fa-save"></i>
110
						<?=gettext("Keep Configuration")?>
111
					</button>
112
				</p>
113
			</form>
114
		</div>
115
	</div>
116
</div>
117
<?php endif?>
118
<?php include("foot.inc")?>
(9-9/227)