Project

General

Profile

Download (4.21 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-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
 * Redistribution and use in source and binary forms, with or without
14
 * modification, are permitted provided that the following conditions are met:
15
 *
16
 * 1. Redistributions of source code must retain the above copyright notice,
17
 *    this list of conditions and the following disclaimer.
18
 *
19
 * 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
 *
24
 * 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
 *
29
 * 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
 *
34
 * 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
 *
38
 * 6. Redistributions of any form whatsoever must retain the following
39
 *    acknowledgment:
40
 *
41
 * "This product includes software developed by the pfSense Project
42
 * for use in the pfSense software distribution (http://www.pfsense.org/).
43
 *
44
 * 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
 */
57

    
58
##|+PRIV
59
##|*IDENT=page-diagnostics-haltsystem
60
##|*NAME=Diagnostics: Halt system
61
##|*DESCR=Allow access to the 'Diagnostics: Halt system' page.
62
##|*MATCH=diag_halt.php*
63
##|-PRIV
64

    
65
// Set DEBUG to true to prevent the system_halt() function from being called
66
define("DEBUG", false);
67

    
68
require_once("guiconfig.inc");
69
require_once("functions.inc");
70
require_once("captiveportal.inc");
71

    
72
if ($_POST['save'] == 'No') {
73
	header("Location: index.php");
74
	exit;
75
}
76

    
77
$pgtitle = array(gettext("Diagnostics"), gettext("Halt System"));
78
include('head.inc');
79

    
80
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
81
?>
82
	<meta http-equiv="refresh" content="70;url=/">
83
<?php
84
	print_info_box(gettext("The system is halting now. This may take one minute or so."), 'success', false);
85

    
86
	if (DEBUG) {
87
	   printf(gettext("Not actually halting (DEBUG is set true)%s"), "<br />");
88
	} else {
89
		print('<pre>');
90
		system_halt();
91
		print('</pre>');
92
	}
93
} else {
94
?>
95

    
96
<div class="panel panel-default">
97
	<div class="panel-heading">
98
		<h2 class="panel-title"><?=gettext('System Halt Confirmation')?></h2>
99
	</div>
100
	<div class="panel-body">
101
		<div class="content">
102
			<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
			<form action="diag_halt.php" method="post">
104
				<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
				<a href="/" class="btn btn-info">
109
					<i class="fa fa-undo"></i>
110
					<?=gettext("Cancel")?>
111
				</a>
112
			</form>
113
		</div>
114
	</div>
115
</div>
116

    
117

    
118

    
119
<?php
120
}
121

    
122
include("foot.inc");
(15-15/227)