Project

General

Profile

Download (2.54 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
 * diag_halt.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-haltsystem
28
##|*NAME=Diagnostics: Halt system
29
##|*DESCR=Allow access to the 'Diagnostics: Halt system' page.
30
##|*MATCH=diag_halt.php*
31
##|-PRIV
32

    
33
// Set DEBUG to true to prevent the system_halt() function from being called
34
define("DEBUG", false);
35

    
36
require_once("guiconfig.inc");
37
require_once("functions.inc");
38
require_once("captiveportal.inc");
39

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

    
45
$pgtitle = array(gettext("Diagnostics"), gettext("Halt System"));
46
include('head.inc');
47

    
48
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
49
?>
50
	<meta http-equiv="refresh" content="70;url=/">
51
<?php
52
	print_info_box(gettext("The system is halting now. This may take one minute or so."), 'success', false);
53

    
54
	if (DEBUG) {
55
	   printf(gettext("Not actually halting (DEBUG is set true)%s"), "<br />");
56
	} else {
57
		print('<pre>');
58
		system_halt();
59
		print('</pre>');
60
	}
61
} else {
62
?>
63

    
64
<div class="panel panel-default">
65
	<div class="panel-heading">
66
		<h2 class="panel-title"><?=gettext('System Halt Confirmation')?></h2>
67
	</div>
68
	<div class="panel-body">
69
		<div class="content">
70
			<p><?=gettext('Click "Halt" to halt the system immediately, or "Cancel" to go to the system dashboard. (There will be a brief delay before the dashboard appears.)')?></p>
71
			<form action="diag_halt.php" method="post">
72
				<button type="submit" class="btn btn-danger pull-center" name="save" value="<?=gettext("Halt")?>" title="<?=gettext("Halt the system and power off")?>">
73
					<i class="fa fa-stop-circle"></i>
74
					<?=gettext("Halt")?>
75
				</button>
76
				<a href="/" class="btn btn-info">
77
					<i class="fa fa-undo"></i>
78
					<?=gettext("Cancel")?>
79
				</a>
80
			</form>
81
		</div>
82
	</div>
83
</div>
84

    
85

    
86

    
87
<?php
88
}
89

    
90
include("foot.inc");
(18-18/235)