From 18295ff2f907f638afa9f7c665cc16e4262e6899 Mon Sep 17 00:00:00 2001 From: Stephen Beaver Date: Thu, 23 Jun 2016 13:29:44 -0400 Subject: Restored countdown functionality and menu refresh on successful update/remove/install Added comments to clarify operation of the page --- src/usr/local/www/pkg_mgr_install.php | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'src/usr/local/www/pkg_mgr_install.php') diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php index fe683b5..0c97e3d 100644 --- a/src/usr/local/www/pkg_mgr_install.php +++ b/src/usr/local/www/pkg_mgr_install.php @@ -221,6 +221,7 @@ function waitfor_string_in_file($filename, $string, $timeout) { } $pkgmode = ''; + if (!empty($_REQUEST['mode'])) { $valid_modes = array( 'reinstallall', @@ -237,14 +238,18 @@ if (!empty($_REQUEST['mode'])) { $pkgmode = $_REQUEST['mode']; } +// After a successful installation/removal/update the page is reloaded so that any menu changes show up +// immediately. These values passed as POST arguments tell the page the state it was in before the reload. $confirmed = isset($_POST['confirmed']) && $_POST['confirmed'] == 'true'; $completed = isset($_POST['completed']) && $_POST['completed'] == 'true'; +$reboot_needed = isset($_POST['reboot_needed']) && $_POST['reboot_needed'] == "yes"; if (!empty($_REQUEST['id'])) { if ($_REQUEST['id'] != "firmware") { header("Location: pkg_mgr_installed.php"); return; } + $firmwareupdate = true; } elseif (!$completed && empty($_REQUEST['pkg']) && $pkgmode != 'reinstallall') { header("Location: pkg_mgr_installed.php"); @@ -512,7 +517,10 @@ $sysmessage = gettext("Status"); // that were installed if ($completed): unlink_if_exists($logfilename . ".json"); - if (($firmwareupdate) && ($_POST['reboot_needed'] == "yes")): + + // If this was a firmware update and a reboot was initiated, display the "Rebooting" message + // and start hte countdown timer + if ($firmwareupdate && $reboot_needed): ?>