From cf157c70c1373a2f828f1ae19b0b80ca8366078d Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 9 Jun 2016 16:06:34 +0200 Subject: [PATCH] New update manager specification changes --- .../include/functions_update_manager.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_update_manager.php b/pandora_console/include/functions_update_manager.php index d18837a2cc..7e53a11433 100755 --- a/pandora_console/include/functions_update_manager.php +++ b/pandora_console/include/functions_update_manager.php @@ -525,17 +525,20 @@ function update_manager_register_instance () { function update_manager_download_messages () { global $config; - // TODO: Delete old messages + //Do not ask in next 2 hours + config_update_value ('last_um_check', time() + 2 * SECONDS_1HOUR); + if (!isset ($config['pandora_uid'])) return; + + // Delete old messages + db_get_sql('DELETE FROM tupdate WHERE UNIX_TIMESTAMP(filename) < UNIX_TIMESTAMP(NOW())'); // Build the curl request $params = array( - 'pandora_uid' => $config['pandora_uid'] + 'pandora_uid' => $config['pandora_uid'], + 'timezone' => $config['timezone'] ); $result = update_manager_curl_request ('get_messages', $params); - - //Do not ask in next 2 hours - config_update_value ('last_um_check', time() + 2 * SECONDS_1HOUR); if (!$result['success']) { return ($result['update_message']);