Project

General

Profile

Download (3.21 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-2018 Rubicon Communications, LLC (Netgate)
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
 * Licensed under the Apache License, Version 2.0 (the "License");
14
 * you may not use this file except in compliance with the License.
15
 * You may obtain a copy of the License at
16
 *
17
 * http://www.apache.org/licenses/LICENSE-2.0
18
 *
19
 * Unless required by applicable law or agreed to in writing, software
20
 * distributed under the License is distributed on an "AS IS" BASIS,
21
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
 * See the License for the specific language governing permissions and
23
 * limitations under the License.
24
 */
25

    
26
##|+PRIV
27
##|*IDENT=page-diagnostics-factorydefaults
28
##|*NAME=Diagnostics: Factory defaults
29
##|*DESCR=Allow access to the 'Diagnostics: Factory defaults' page.
30
##|*WARN=standard-warning-root
31
##|*MATCH=diag_defaults.php*
32
##|-PRIV
33

    
34
require_once("guiconfig.inc");
35

    
36
if ($_POST['Submit'] == " " . gettext("No") . " ") {
37
	header("Location: index.php");
38
	exit;
39
}
40

    
41
$pgtitle = array(gettext("Diagnostics"), gettext("Factory Defaults"));
42
include("head.inc");
43
?>
44

    
45
<?php if ($_POST['Submit'] == " " . gettext("Yes") . " "):
46
	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."))?>
47
<pre>
48
<?php
49
	reset_factory_defaults();
50
	system_reboot();
51
?>
52
</pre>
53
<?php else:?>
54
<div class="panel panel-default">
55
	<div class="panel-heading">
56
		<h2 class="panel-title"><?=gettext("Factory Defaults Reset")?></h2>
57
	</div>
58
	<div class="panel-body">
59
		<div class="content">
60
			<form action="diag_defaults.php" method="post">
61
				<p><strong><?=gettext('Resetting the system to factory defaults will remove all user configuration and apply the following settings:')?></strong></p>
62
				<ul>
63
					<li><?=gettext("Reset to factory defaults")?></li>
64
					<li><?=gettext("LAN IP address will be reset to 192.168.1.1")?></li>
65
					<li><?=gettext("System will be configured as a DHCP server on the default LAN interface")?></li>
66
					<li><?=gettext("Reboot after changes are installed")?></li>
67
					<li><?=gettext("WAN interface will be set to obtain an address automatically from a DHCP server")?></li>
68
					<li><?=gettext("webConfigurator admin username will be reset to 'admin'")?></li>
69
					<li><?=sprintf(gettext("webConfigurator admin password will be reset to '%s'"), $g['factory_shipped_password'])?></li>
70
				</ul>
71
				<p><strong><?=gettext("Are you sure you want to proceed?")?></strong></p>
72
				<p>
73
					<button name="Submit" type="submit" class="btn btn-sm btn-danger" value=" <?=gettext("Yes")?> " title="<?=gettext("Perform a factory reset")?>">
74
						<i class="fa fa-undo"></i>
75
						<?=gettext("Factory Reset")?>
76
					</button>
77
					<button name="Submit" type="submit" class="btn btn-sm btn-success" value=" <?=gettext("No")?> " title="<?=gettext("Return to the dashboard")?>">
78
						<i class="fa fa-save"></i>
79
						<?=gettext("Keep Configuration")?>
80
					</button>
81
				</p>
82
			</form>
83
		</div>
84
	</div>
85
</div>
86
<?php endif?>
87
<?php include("foot.inc")?>
(12-12/234)