1
|
<?php
|
2
|
/* $Id$ */
|
3
|
/*
|
4
|
halt.php
|
5
|
part of pfSense
|
6
|
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
|
7
|
Copyright (C) 2004 Scott Ullrich
|
8
|
All rights reserved.
|
9
|
|
10
|
part of m0n0wall as reboot.php (http://m0n0.ch/wall)
|
11
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
12
|
All rights reserved.
|
13
|
|
14
|
Redistribution and use in source and binary forms, with or without
|
15
|
modification, are permitted provided that the following conditions are met:
|
16
|
|
17
|
1. Redistributions of source code must retain the above copyright notice,
|
18
|
this list of conditions and the following disclaimer.
|
19
|
|
20
|
2. Redistributions in binary form must reproduce the above copyright
|
21
|
notice, this list of conditions and the following disclaimer in the
|
22
|
documentation and/or other materials provided with the distribution.
|
23
|
|
24
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
25
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
26
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
27
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
28
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
29
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
30
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
31
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
32
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
33
|
POSSIBILITY OF SUCH DAMAGE.
|
34
|
*/
|
35
|
/*
|
36
|
pfSense_MODULE: header
|
37
|
*/
|
38
|
|
39
|
##|+PRIV
|
40
|
##|*IDENT=page-diagnostics-haltsystem
|
41
|
##|*NAME=Diagnostics: Halt system page
|
42
|
##|*DESCR=Allow access to the 'Diagnostics: Halt system' page.
|
43
|
##|*MATCH=halt.php*
|
44
|
##|-PRIV
|
45
|
|
46
|
// Set DEBUG to true to prevent the system_halt() function from being called
|
47
|
define("DEBUG", true);
|
48
|
|
49
|
require("guiconfig.inc");
|
50
|
require("functions.inc");
|
51
|
require("captiveportal.inc");
|
52
|
|
53
|
if (stristr($_POST['Submit'], gettext("No"))) {
|
54
|
header("Location: index.php");
|
55
|
exit;
|
56
|
}
|
57
|
|
58
|
$pgtitle = array(gettext("Diagnostics"),gettext("Halt system"));
|
59
|
include('head.inc');
|
60
|
|
61
|
if (stristr($_POST['Submit'], gettext("Yes"))) {
|
62
|
?><meta http-equiv=\"refresh\" content=\"70;url=/\"> <?php
|
63
|
print('<div class="alert alert-success" role="alert">'.gettext("The system is halting now. This may take one minute or so.").'</div>');
|
64
|
|
65
|
if(DEBUG)
|
66
|
print("Not actually halting (DEBUG is set true)<br>");
|
67
|
else
|
68
|
system_halt();
|
69
|
} else {
|
70
|
|
71
|
|
72
|
?>
|
73
|
|
74
|
<!-- Simple HTML version -->
|
75
|
<div class="panel panel-default">
|
76
|
<div class="panel-heading">Are you sure you want to halt the system?</div>
|
77
|
<div class="panel-body">Click "Yes" to halt the system immediately, or "No" to go to the system dashboard. (There will be a brief delay before the dashboard appears.)<br /><br />
|
78
|
<form action="halt.php" method="post">
|
79
|
<input type="submit" class="btn btn-danger pull-center" name="Submit" value="Yes">
|
80
|
<input type="submit" class="btn btn-default" name="Submit" value="No">
|
81
|
</form>
|
82
|
</div>
|
83
|
</div>
|
84
|
</div>
|
85
|
|
86
|
<?php
|
87
|
}
|
88
|
include("foot.inc");
|
89
|
?>
|
90
|
|