Revision 68951763
Added by sbeaver over 10 years ago
usr/local/www/halt.php | ||
---|---|---|
33 | 33 |
POSSIBILITY OF SUCH DAMAGE. |
34 | 34 |
*/ |
35 | 35 |
/* |
36 |
pfSense_MODULE: header
|
|
36 |
pfSense_MODULE: header
|
|
37 | 37 |
*/ |
38 | 38 |
|
39 | 39 |
##|+PRIV |
... | ... | |
43 | 43 |
##|*MATCH=halt.php* |
44 | 44 |
##|-PRIV |
45 | 45 |
|
46 |
// Set DEBUG to true to prevent the system_halt() function from being called |
|
47 |
define("DEBUG", true); |
|
48 |
|
|
46 | 49 |
require("guiconfig.inc"); |
47 | 50 |
require("functions.inc"); |
48 | 51 |
require("captiveportal.inc"); |
... | ... | |
54 | 57 |
|
55 | 58 |
$pgtitle = array(gettext("Diagnostics"),gettext("Halt system")); |
56 | 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"); |
|
57 | 89 |
?> |
58 | 90 |
|
59 |
<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> |
|
60 |
<?php include("fbegin.inc"); ?> |
|
61 |
<?php if ($_POST['Submit'] == " " . gettext("Yes") . " "): |
|
62 |
print_info_box(gettext("The system is halting now. This may take one minute.")); ?> |
|
63 |
<pre> |
|
64 |
<?php system_halt(); ?> |
|
65 |
</pre> |
|
66 |
<?php else: ?> |
|
67 |
<form action="halt.php" method="post"> |
|
68 |
<p><strong><?=gettext("Are you sure you want to halt the system?");?></strong></p> |
|
69 |
<p> |
|
70 |
<input name="Submit" type="submit" class="formbtn" value=" <?=gettext("Yes"); ?> " /> |
|
71 |
<input name="Submit" type="submit" class="formbtn" value=" <?=gettext("No"); ?> " /> |
|
72 |
</p> |
|
73 |
</form> |
|
74 |
<?php endif; ?> |
|
75 |
<?php include("fend.inc"); ?> |
|
76 |
</body> |
|
77 |
</html> |
Also available in: Unified diff
Updated