Commit 4e9aaa51 authored by anne munoz's avatar anne munoz Committed by Adam Wujek

www: fixed reset

added reboot button
fixed redirect to reboot page
parent 6471fdab
...@@ -1435,8 +1435,7 @@ function get_encrypt_salt($enc_password){ ...@@ -1435,8 +1435,7 @@ function get_encrypt_salt($enc_password){
**/ **/
function resetswitch(){ function resetswitch(){
shell_exec("make -C /wr/etc/ defconfig"); shell_exec("make -C /wr/etc/ defconfig");
shell_exec("reboot"); wrs_reboot();
wrs_reboot();
} }
/** /**
......
...@@ -42,7 +42,7 @@ echo '<div class="login"> ...@@ -42,7 +42,7 @@ echo '<div class="login">
echo '<li><a href="logs.php">System Logs</a></li>'; echo '<li><a href="logs.php">System Logs</a></li>';
echo '<li><a href="terminal.php">Virtual Console</a></li>'; echo '<li><a href="terminal.php">Virtual Console</a></li>';
echo '<li><a href="firmware.php">Firmware</a></li>'; echo '<li><a href="firmware.php">Firmware</a></li>';
echo '<li><a href="reset.php">Reset to default</a></li>'; echo '<li><a href="reset.php">Reboot & Reset</a></li>';
echo '</ul>'; echo '</ul>';
} }
echo '</ul><br><hr>'; echo '</ul><br><hr>';
......
...@@ -16,13 +16,26 @@ ...@@ -16,13 +16,26 @@
</div> </div>
<div class="rightpanel"> <div class="rightpanel">
<div class="rightbody"> <div class="rightbody">
<h1 class="title">Reset <a href='help.php?help_id=firmware' onClick='showPopup(this.href);return(false);'><img align=right src="./img/question.png"></a></h1> <h1 class="title">Reboot & Reset<a href='help.php?help_id=firmware' onClick='showPopup(this.href);return(false);'><img align=right src="./img/question.png"></a></h1>
<?php <?php
session_is_started(); session_is_started();
?> ?>
<h2>Reboot</h2>
<br>
<p>This will reboot your switch</p>
<br>
<FORM method="POST" ENCTYPE="multipart/form-data" onsubmit="return confirm('Are you sure you want to reboot the switch?');">
<th><INPUT type=submit value="Reboot" class="btn" name="reboot" ></th>
</FORM>
<br>
<hr>
<br>
<h2>Reset</h2>
<br>
<p>This will reset your switch to the default state</p> <p>This will reset your switch to the default state</p>
<br> <br>
<FORM method="POST" ENCTYPE="multipart/form-data" onsubmit="return confirm('Are you sure you want to reset the switch?');"> <FORM method="POST" ENCTYPE="multipart/form-data" onsubmit="return confirm('Are you sure you want to reset the switch?');">
...@@ -38,6 +51,11 @@ ...@@ -38,6 +51,11 @@
resetswitch(); resetswitch();
} }
if(isset($_POST['reboot'])){
wrs_reboot();
}
?> ?>
</div> </div>
</div> </div>
......
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