Project

General

Profile

Download (3.34 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-2013 BSD Perimeter
7
 * Copyright (c) 2013-2016 Electric Sheep Fencing
8
 * Copyright (c) 2014-2024 Rubicon Communications, LLC (Netgate)
9
 * All rights reserved.
10
 *
11
 * originally based on m0n0wall (http://m0n0.ch/wall)
12
 * Copyright (c) 2003-2004 Manuel Kasper <mk@neon1.net>.
13
 * All rights reserved.
14
 *
15
 * Licensed under the Apache License, Version 2.0 (the "License");
16
 * you may not use this file except in compliance with the License.
17
 * You may obtain a copy of the License at
18
 *
19
 * http://www.apache.org/licenses/LICENSE-2.0
20
 *
21
 * Unless required by applicable law or agreed to in writing, software
22
 * distributed under the License is distributed on an "AS IS" BASIS,
23
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
 * See the License for the specific language governing permissions and
25
 * limitations under the License.
26
 */
27

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

    
36
require_once("guiconfig.inc");
37
require_once("pkg-utils.inc");
38

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

    
44
$pgtitle = array(gettext("Diagnostics"), gettext("Factory Defaults"));
45
include("head.inc");
46
?>
47

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