Project

General

Profile

Download (2.54 KB) Statistics
| Branch: | Tag: | Revision:
1 8a3be31a Scott Ullrich
<?php
2 56977a25 Scott Ullrich
/*
3 c5d81585 Renato Botelho
 * diag_halt.php
4 9da2cf1c Stephen Beaver
 *
5 c5d81585 Renato Botelho
 * part of pfSense (https://www.pfsense.org)
6 81299b5c Renato Botelho
 * Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
7 c5d81585 Renato Botelho
 * All rights reserved.
8 fd9ebcd5 Stephen Beaver
 *
9 c5d81585 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 b12ea3fb Renato Botelho
 * 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 fd9ebcd5 Stephen Beaver
 *
17 b12ea3fb Renato Botelho
 * http://www.apache.org/licenses/LICENSE-2.0
18 fd9ebcd5 Stephen Beaver
 *
19 b12ea3fb Renato Botelho
 * 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 fd9ebcd5 Stephen Beaver
 */
25 56977a25 Scott Ullrich
26 6b07c15a Matthew Grooms
##|+PRIV
27
##|*IDENT=page-diagnostics-haltsystem
28 5230f468 jim-p
##|*NAME=Diagnostics: Halt system
29 6b07c15a Matthew Grooms
##|*DESCR=Allow access to the 'Diagnostics: Halt system' page.
30 1af5edbf Stephen Beaver
##|*MATCH=diag_halt.php*
31 6b07c15a Matthew Grooms
##|-PRIV
32
33 68951763 sbeaver
// Set DEBUG to true to prevent the system_halt() function from being called
34 b191b7b1 Stephen Beaver
define("DEBUG", false);
35 68951763 sbeaver
36 c81ef6e2 Phil Davis
require_once("guiconfig.inc");
37
require_once("functions.inc");
38
require_once("captiveportal.inc");
39 56977a25 Scott Ullrich
40 45d6ada5 Sjon Hortensius
if ($_POST['save'] == 'No') {
41 9cf11774 jim-p
	header("Location: index.php");
42
	exit;
43 56977a25 Scott Ullrich
}
44 f726d710 Bill Marquette
45 a6a6ee00 k-paulius
$pgtitle = array(gettext("Diagnostics"), gettext("Halt System"));
46 f726d710 Bill Marquette
include('head.inc');
47 68951763 sbeaver
48 bef0adce sbeaver
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
49
?>
50
	<meta http-equiv="refresh" content="70;url=/">
51
<?php
52 7c945f74 k-paulius
	print_info_box(gettext("The system is halting now. This may take one minute or so."), 'success', false);
53
54 ea1bbc43 Stephen Beaver
	if (DEBUG) {
55 607e7686 NewEraCracker
	   printf(gettext("Not actually halting (DEBUG is set true)%s"), "<br />");
56 947141fd Phil Davis
	} else {
57 ea1bbc43 Stephen Beaver
		print('<pre>');
58 68951763 sbeaver
		system_halt();
59 ea1bbc43 Stephen Beaver
		print('</pre>');
60
	}
61 68951763 sbeaver
} else {
62 45d6ada5 Sjon Hortensius
?>
63 6e69ebef sbeaver
64 68951763 sbeaver
<div class="panel panel-default">
65 45d6ada5 Sjon Hortensius
	<div class="panel-heading">
66 34ee6639 NOYB
		<h2 class="panel-title"><?=gettext('System Halt Confirmation')?></h2>
67 45d6ada5 Sjon Hortensius
	</div>
68
	<div class="panel-body">
69 9239f765 Jared Dillard
		<div class="content">
70 a11064ea Jared Dillard
			<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 1af5edbf Stephen Beaver
			<form action="diag_halt.php" method="post">
72 37676f4e jim-p
				<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 6400975d jim-p
				<a href="/" class="btn btn-info">
77
					<i class="fa fa-undo"></i>
78
					<?=gettext("Cancel")?>
79 37676f4e jim-p
				</a>
80 9239f765 Jared Dillard
			</form>
81
		</div>
82 68951763 sbeaver
	</div>
83
</div>
84
85 9239f765 Jared Dillard
86
87 68951763 sbeaver
<?php
88
}
89 56977a25 Scott Ullrich
90 bef0adce sbeaver
include("foot.inc");