Project

General

Profile

Download (4.2 KB) Statistics
| Branch: | Tag: | Revision:
1 8a3be31a Scott Ullrich
<?php
2 56977a25 Scott Ullrich
/*
3 aaec5634 Renato Botelho
 * diag_halt.php
4 9da2cf1c Stephen Beaver
 *
5 aaec5634 Renato Botelho
 * part of pfSense (https://www.pfsense.org)
6
 * Copyright (c) 2004-2016 Electric Sheep Fencing, LLC
7
 * All rights reserved.
8 fd9ebcd5 Stephen Beaver
 *
9 aaec5634 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 aaec5634 Renato Botelho
 * Redistribution and use in source and binary forms, with or without
14
 * modification, are permitted provided that the following conditions are met:
15 fd9ebcd5 Stephen Beaver
 *
16 aaec5634 Renato Botelho
 * 1. Redistributions of source code must retain the above copyright notice,
17
 *    this list of conditions and the following disclaimer.
18 fd9ebcd5 Stephen Beaver
 *
19 aaec5634 Renato Botelho
 * 2. Redistributions in binary form must reproduce the above copyright
20
 *    notice, this list of conditions and the following disclaimer in
21
 *    the documentation and/or other materials provided with the
22
 *    distribution.
23 fd9ebcd5 Stephen Beaver
 *
24 aaec5634 Renato Botelho
 * 3. All advertising materials mentioning features or use of this software
25
 *    must display the following acknowledgment:
26
 *    "This product includes software developed by the pfSense Project
27
 *    for use in the pfSense® software distribution. (http://www.pfsense.org/).
28 fd9ebcd5 Stephen Beaver
 *
29 aaec5634 Renato Botelho
 * 4. The names "pfSense" and "pfSense Project" must not be used to
30
 *    endorse or promote products derived from this software without
31
 *    prior written permission. For written permission, please contact
32
 *    coreteam@pfsense.org.
33 fd9ebcd5 Stephen Beaver
 *
34 aaec5634 Renato Botelho
 * 5. Products derived from this software may not be called "pfSense"
35
 *    nor may "pfSense" appear in their names without prior written
36
 *    permission of the Electric Sheep Fencing, LLC.
37 fd9ebcd5 Stephen Beaver
 *
38 aaec5634 Renato Botelho
 * 6. Redistributions of any form whatsoever must retain the following
39
 *    acknowledgment:
40 fd9ebcd5 Stephen Beaver
 *
41 aaec5634 Renato Botelho
 * "This product includes software developed by the pfSense Project
42
 * for use in the pfSense software distribution (http://www.pfsense.org/).
43 fd9ebcd5 Stephen Beaver
 *
44 aaec5634 Renato Botelho
 * THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
45
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
47
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
48
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
49
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
50
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
51
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
53
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
54
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
55
 * OF THE POSSIBILITY OF SUCH DAMAGE.
56 fd9ebcd5 Stephen Beaver
 */
57 56977a25 Scott Ullrich
58 6b07c15a Matthew Grooms
##|+PRIV
59
##|*IDENT=page-diagnostics-haltsystem
60 5230f468 jim-p
##|*NAME=Diagnostics: Halt system
61 6b07c15a Matthew Grooms
##|*DESCR=Allow access to the 'Diagnostics: Halt system' page.
62 1af5edbf Stephen Beaver
##|*MATCH=diag_halt.php*
63 6b07c15a Matthew Grooms
##|-PRIV
64
65 68951763 sbeaver
// Set DEBUG to true to prevent the system_halt() function from being called
66 b191b7b1 Stephen Beaver
define("DEBUG", false);
67 68951763 sbeaver
68 aceaf18c Phil Davis
require_once("guiconfig.inc");
69
require_once("functions.inc");
70
require_once("captiveportal.inc");
71 56977a25 Scott Ullrich
72 45d6ada5 Sjon Hortensius
if ($_POST['save'] == 'No') {
73 9cf11774 jim-p
	header("Location: index.php");
74
	exit;
75 56977a25 Scott Ullrich
}
76 f726d710 Bill Marquette
77 a6a6ee00 k-paulius
$pgtitle = array(gettext("Diagnostics"), gettext("Halt System"));
78 f726d710 Bill Marquette
include('head.inc');
79 68951763 sbeaver
80 bef0adce sbeaver
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
81
?>
82
	<meta http-equiv="refresh" content="70;url=/">
83
<?php
84 7c945f74 k-paulius
	print_info_box(gettext("The system is halting now. This may take one minute or so."), 'success', false);
85
86 ea1bbc43 Stephen Beaver
	if (DEBUG) {
87 607e7686 NewEraCracker
	   printf(gettext("Not actually halting (DEBUG is set true)%s"), "<br />");
88 947141fd Phil Davis
	} else {
89 ea1bbc43 Stephen Beaver
		print('<pre>');
90 68951763 sbeaver
		system_halt();
91 ea1bbc43 Stephen Beaver
		print('</pre>');
92
	}
93 68951763 sbeaver
} else {
94 45d6ada5 Sjon Hortensius
?>
95 6e69ebef sbeaver
96 68951763 sbeaver
<div class="panel panel-default">
97 45d6ada5 Sjon Hortensius
	<div class="panel-heading">
98 a16d923f NOYB
		<h2 class="panel-title"><?=gettext('System Halt Confirmation')?></h2>
99 45d6ada5 Sjon Hortensius
	</div>
100
	<div class="panel-body">
101 9239f765 Jared Dillard
		<div class="content">
102 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>
103 1af5edbf Stephen Beaver
			<form action="diag_halt.php" method="post">
104 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")?>">
105
					<i class="fa fa-stop-circle"></i>
106
					<?=gettext("Halt")?>
107
				</button>
108 6400975d jim-p
				<a href="/" class="btn btn-info">
109
					<i class="fa fa-undo"></i>
110
					<?=gettext("Cancel")?>
111 37676f4e jim-p
				</a>
112 9239f765 Jared Dillard
			</form>
113
		</div>
114 68951763 sbeaver
	</div>
115
</div>
116
117 9239f765 Jared Dillard
118
119 68951763 sbeaver
<?php
120
}
121 56977a25 Scott Ullrich
122 bef0adce sbeaver
include("foot.inc");