Skip to content

Commit f7e0b76

Browse files
committed
Removed unecessary touch() call and improved comment info
The touch call was added for debugging. Now removed.
1 parent 570477c commit f7e0b76

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

web/restart/system/index.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
exit();
1212
}
1313

14-
// If the session has the same reset token as the current request prevent restarting again.
15-
// This happens when the server is restarted, the admin panel goes down and the browser reloads
16-
// the /restart/index.php page once the server goes online causing restart loop.
14+
// If the stored reset token matches the current request one it means that we need
15+
// to prevent the action because the browser automatically reloaded the page when
16+
// the server turned on. This will prevent duplicate restarts.
1717
$reset_token_dir = '/var/tmp/';
1818
if (isset($_GET['system_reset_token']) && is_numeric($_GET['system_reset_token'])) {
1919
clearstatcache();
@@ -28,7 +28,6 @@
2828
if (!empty($_GET['hostname'])) {
2929
touch($reset_token_file);
3030
$_SESSION['error_msg'] = 'The system is going down for reboot NOW!';
31-
touch($reset_token_file . '_persistent');
3231
exec(HESTIA_CMD . "v-restart-system yes", $output, $return_var);
3332
}
3433
unset($output);

0 commit comments

Comments
 (0)