diff options
-rwxr-xr-x | usr/local/www/halt.php | 32 | ||||
-rwxr-xr-x | usr/local/www/reboot.php | 47 |
2 files changed, 34 insertions, 45 deletions
diff --git a/usr/local/www/halt.php b/usr/local/www/halt.php index ae69291..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 a few minutes, depending on your hardware."); - } 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 3f7eeda..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 a few minutes, depending on your hardware."); - } 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 a few minutes, depending on your hardware."); - } else { - exit; - } -} - -?> |