summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-05-16 13:15:37 -0400
committerjim-p <jimp@pfsense.org>2012-05-16 13:15:37 -0400
commitb40e9b1cfb87d0d25ea0ba15650b8ec73ef82eb7 (patch)
tree234531732812312549cd48d752c01614b6494599 /usr/local
parentb3f2cc0f24f4969b82134e168520ea2dd85c235c (diff)
downloadpfsense-b40e9b1cfb87d0d25ea0ba15650b8ec73ef82eb7.zip
pfsense-b40e9b1cfb87d0d25ea0ba15650b8ec73ef82eb7.tar.gz
Fixup halt and reboot to catch the output from the shutdown process properly.
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/halt.php32
-rwxr-xr-xusr/local/www/reboot.php47
2 files changed, 34 insertions, 45 deletions
diff --git a/usr/local/www/halt.php b/usr/local/www/halt.php
index 1bfda93..442a2da 100755
--- a/usr/local/www/halt.php
+++ b/usr/local/www/halt.php
@@ -46,14 +46,9 @@ require("guiconfig.inc");
require("functions.inc");
require("captiveportal.inc");
-if ($_POST) {
- if ($_POST['Submit'] != " No ") {
- system_halt();
- $rebootmsg = gettext("The system is halting now. This may take one minute.");
- } else {
- header("Location: index.php");
- exit;
- }
+if ($_POST['Submit'] == " " . gettext("No") . " ") {
+ header("Location: index.php");
+ exit;
}
$pgtitle = array(gettext("Diagnostics"),gettext("Halt system"));
@@ -62,14 +57,19 @@ include('head.inc');
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<?php if ($rebootmsg): echo print_info_box($rebootmsg); else: ?>
- <form action="halt.php" method="post">
- <p><strong><?=gettext("Are you sure you want to halt the system?");?></strong></p>
- <p>
- <input name="Submit" type="submit" class="formbtn" value=" <?=gettext("Yes"); ?> ">
- <input name="Submit" type="submit" class="formbtn" value=" <?=gettext("No"); ?> ">
- </p>
- </form>
+<?php if ($_POST['Submit'] == " " . gettext("Yes") . " "):
+ print_info_box(gettext("The system is halting now. This may take one minute.")); ?>
+<pre>
+<?php system_halt(); ?>
+</pre>
+<?php else: ?>
+<form action="halt.php" method="post">
+ <p><strong><?=gettext("Are you sure you want to halt the system?");?></strong></p>
+ <p>
+ <input name="Submit" type="submit" class="formbtn" value=" <?=gettext("Yes"); ?> ">
+ <input name="Submit" type="submit" class="formbtn" value=" <?=gettext("No"); ?> ">
+ </p>
+</form>
<?php endif; ?>
<?php include("fend.inc"); ?>
</body>
diff --git a/usr/local/www/reboot.php b/usr/local/www/reboot.php
index 07faa19..f809b94 100755
--- a/usr/local/www/reboot.php
+++ b/usr/local/www/reboot.php
@@ -40,43 +40,32 @@ require("guiconfig.inc");
require("functions.inc");
require("captiveportal.inc");
-if ($_POST) {
- if ($_POST['Submit'] == gettext(" Yes ")) {
- $rebootmsg = gettext("The system is rebooting now. This may take one minute.");
- } else {
- Header("Location: /");
- }
+if ($_POST['Submit'] == " " . gettext("No") . " ") {
+ header("Location: index.php");
+ exit;
}
$pgtitle = array(gettext("Diagnostics"),gettext("Reboot System"));
include("head.inc");
?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<?php if ($rebootmsg): echo print_info_box($rebootmsg); else: ?>
- <form action="reboot.php" method="post">
- <p><strong><?=gettext("Are you sure you want to reboot the system?");?></strong></p>
- <p>
- <input name="Submit" type="submit" class="formbtn" value=" <?=gettext("Yes");?> ">
- <input name="Submit" type="submit" class="formbtn" value=" <?=gettext("No");?> ">
- </p>
- </form>
+<?php if ($_POST['Submit'] == " " . gettext("Yes") . " "): ?>
+<meta http-equiv=\"refresh\" content=\"70;url=/\">
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php print_info_box(gettext("The system is rebooting now. This may take one minute.")); ?>
+<pre>
+<?php system_reboot(); ?>
+</pre>
+<?php else: ?>
+<form action="reboot.php" method="post">
+ <p><strong><?=gettext("Are you sure you want to reboot the system?");?></strong></p>
+ <p>
+ <input name="Submit" type="submit" class="formbtn" value=" <?=gettext("Yes");?> ">
+ <input name="Submit" type="submit" class="formbtn" value=" <?=gettext("No");?> ">
+ </p>
+</form>
<?php endif; ?>
<?php include("fend.inc"); ?>
</body>
</html>
-
-<?php
-if ($_POST) {
- $reply = " " . gettext("Yes") . " ";
- if ($_POST['Submit'] == $reply) {
- echo "<meta http-equiv=\"refresh\" content=\"70;url=/\">";
- system_reboot();
- $rebootmsg = gettext("The system is rebooting now. This may take one minute.");
- } else {
- exit;
- }
-}
-
-?>
OpenPOWER on IntegriCloud