Commit 25a6aa6b authored by Franco Fichtner's avatar Franco Fichtner

system: change halt to power off; closes #907

parent dc44d88d
...@@ -40,7 +40,7 @@ echo " 1) Assign Interfaces 8) Shell" ...@@ -40,7 +40,7 @@ echo " 1) Assign Interfaces 8) Shell"
echo " 2) Set interface(s) IP address 9) pfTop" echo " 2) Set interface(s) IP address 9) pfTop"
echo " 3) Reset the root password 10) Filter Logs" echo " 3) Reset the root password 10) Filter Logs"
echo " 4) Reset to factory defaults 11) Restart web interface" echo " 4) Reset to factory defaults 11) Restart web interface"
echo " 5) Halt system 12) Upgrade from console" echo " 5) Power off system 12) Upgrade from console"
echo " 6) Reboot system 13) Restore a configuration" echo " 6) Reboot system 13) Restore a configuration"
if [ -n "${option99}" ]; then if [ -n "${option99}" ]; then
# flat for alignment... # flat for alignment...
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<Updates order="10" url="/ui/core/firmware/"/> <Updates order="10" url="/ui/core/firmware/"/>
<Reporter order="20" url="/crash_reporter.php"/> <Reporter order="20" url="/crash_reporter.php"/>
<Reboot order="30" url="/reboot.php"/> <Reboot order="30" url="/reboot.php"/>
<Halt order="40" url="/diag_halt.php"/> <PowerOff VisibleName="Power Off" order="40" url="/diag_halt.php"/>
<Defaults order="50" url="/diag_defaults.php"/> <Defaults order="50" url="/diag_defaults.php"/>
</Firmware> </Firmware>
<HighAvailability order="50" VisibleName="High Availability" cssClass="fa fa-refresh fa-fw"> <HighAvailability order="50" VisibleName="High Availability" cssClass="fa fa-refresh fa-fw">
......
...@@ -43,11 +43,11 @@ include('head.inc'); ...@@ -43,11 +43,11 @@ include('head.inc');
<section class="col-xs-12"> <section class="col-xs-12">
<?php <?php
if (!empty($_POST['Submit'])): if (!empty($_POST['Submit'])):
print_info_box(gettext("The system is halting now. This may take one minute.")); ?> print_info_box(gettext("The system is powering off now.")); ?>
<?php <?php
else: ?> else: ?>
<form method="post"> <form method="post">
<p><strong><?=gettext("Are you sure you want to halt the system?");?></strong></p> <p><strong><?=gettext("Are you sure you want to power off the system?");?></strong></p>
<div class="btn-group"> <div class="btn-group">
<input type="submit" name="Submit" class="btn btn-primary" value="<?=gettext("Yes");?>" /> <input type="submit" name="Submit" class="btn btn-primary" value="<?=gettext("Yes");?>" />
<a href="/" class="btn btn-default"><?=gettext("No");?></a> <a href="/" class="btn btn-default"><?=gettext("No");?></a>
...@@ -61,10 +61,9 @@ include('head.inc'); ...@@ -61,10 +61,9 @@ include('head.inc');
</section> </section>
<?php include("foot.inc"); <?php include("foot.inc");
// system halt, when submit pressed
if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!empty($_POST['Submit'])) { if (!empty($_POST['Submit'])) {
system_halt(); system_halt();
} }
} }
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment