Project

General

Profile

Download (4.84 KB) Statistics
| Branch: | Tag: | Revision:
1 4d875b4f Scott Ullrich
<?php
2 5b237745 Scott Ullrich
/*
3 aaec5634 Renato Botelho
 * diag_defaults.php
4 9da2cf1c Stephen Beaver
 *
5 aaec5634 Renato Botelho
 * part of pfSense (https://www.pfsense.org)
6
 * Copyright (c) 2004-2016 Electric Sheep Fencing, LLC
7
 * All rights reserved.
8 fd9ebcd5 Stephen Beaver
 *
9 aaec5634 Renato Botelho
 * originally based on m0n0wall (http://m0n0.ch/wall)
10
 * Copyright (c) 2003-2004 Manuel Kasper <mk@neon1.net>.
11
 * All rights reserved.
12 fd9ebcd5 Stephen Beaver
 *
13 aaec5634 Renato Botelho
 * Redistribution and use in source and binary forms, with or without
14
 * modification, are permitted provided that the following conditions are met:
15 fd9ebcd5 Stephen Beaver
 *
16 aaec5634 Renato Botelho
 * 1. Redistributions of source code must retain the above copyright notice,
17
 *    this list of conditions and the following disclaimer.
18 fd9ebcd5 Stephen Beaver
 *
19 aaec5634 Renato Botelho
 * 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 fd9ebcd5 Stephen Beaver
 *
24 aaec5634 Renato Botelho
 * 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 fd9ebcd5 Stephen Beaver
 *
29 aaec5634 Renato Botelho
 * 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 fd9ebcd5 Stephen Beaver
 *
34 aaec5634 Renato Botelho
 * 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 fd9ebcd5 Stephen Beaver
 *
38 aaec5634 Renato Botelho
 * 6. Redistributions of any form whatsoever must retain the following
39
 *    acknowledgment:
40 0da0d43e Phil Davis
 *
41 aaec5634 Renato Botelho
 * "This product includes software developed by the pfSense Project
42
 * for use in the pfSense software distribution (http://www.pfsense.org/).
43 fd9ebcd5 Stephen Beaver
 *
44 aaec5634 Renato Botelho
 * 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 fd9ebcd5 Stephen Beaver
 */
57 5b237745 Scott Ullrich
58 6b07c15a Matthew Grooms
##|+PRIV
59
##|*IDENT=page-diagnostics-factorydefaults
60 5230f468 jim-p
##|*NAME=Diagnostics: Factory defaults
61 6b07c15a Matthew Grooms
##|*DESCR=Allow access to the 'Diagnostics: Factory defaults' page.
62
##|*MATCH=diag_defaults.php*
63
##|-PRIV
64
65 aceaf18c Phil Davis
require_once("guiconfig.inc");
66 5b237745 Scott Ullrich
67 0acd271b jim-p
if ($_POST['Submit'] == " " . gettext("No") . " ") {
68
	header("Location: index.php");
69
	exit;
70 5b237745 Scott Ullrich
}
71 b63695db Scott Ullrich
72 a6a6ee00 k-paulius
$pgtitle = array(gettext("Diagnostics"), gettext("Factory Defaults"));
73 b63695db Scott Ullrich
include("head.inc");
74 5b237745 Scott Ullrich
?>
75
76 0acd271b jim-p
<?php if ($_POST['Submit'] == " " . gettext("Yes") . " "):
77 ce871619 Stephen Beaver
	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 0acd271b jim-p
<pre>
79
<?php
80
	reset_factory_defaults();
81
	system_reboot();
82
?>
83
</pre>
84 31f03b6c Sjon Hortensius
<?php else:?>
85 7e3c57cd Colin Fleming
<div class="panel panel-default">
86
	<div class="panel-heading">
87 ce871619 Stephen Beaver
		<h2 class="panel-title"><?=gettext("Factory Defaults Reset")?></h2>
88 7e3c57cd Colin Fleming
	</div>
89
	<div class="panel-body">
90
		<div class="content">
91
			<form action="diag_defaults.php" method="post">
92 9b6ea44e Stephen Beaver
				<p><strong><?=gettext('Resetting the system to factory defaults will remove all user configuration and apply the following settings:')?></strong></p>
93 7e3c57cd Colin Fleming
				<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 3eaa57a2 Phil Davis
					<li><?=sprintf(gettext("webConfigurator admin password will be reset to '%s'"), $g['factory_shipped_password'])?></li>
101 7e3c57cd Colin Fleming
				</ul>
102
				<p><strong><?=gettext("Are you sure you want to proceed?")?></strong></p>
103
				<p>
104 37676f4e jim-p
					<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 6400975d jim-p
						<?=gettext("Factory Reset")?>
107 37676f4e jim-p
					</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 6400975d jim-p
						<?=gettext("Keep Configuration")?>
111 37676f4e jim-p
					</button>
112 7e3c57cd Colin Fleming
				</p>
113
			</form>
114
		</div>
115
	</div>
116
</div>
117 31f03b6c Sjon Hortensius
<?php endif?>
118 c10cb196 Stephen Beaver
<?php include("foot.inc")?>