Project

General

Profile

Download (3.18 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 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
##|*MATCH=diag_defaults.php*
31
##|-PRIV
32

    
33
require_once("guiconfig.inc");
34

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

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

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