From 54959257c0e672472cfba63fb1f475d9f014b228 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 16 Mar 2017 16:00:57 +0100 Subject: [PATCH] Added more code to um and rr --- pandora_console/include/ajax/rolling_release.ajax.php | 7 +++++-- pandora_console/include/ajax/update_manager.ajax.php | 2 +- pandora_console/include/functions.php | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/ajax/rolling_release.ajax.php b/pandora_console/include/ajax/rolling_release.ajax.php index 10da5714d5..a859c18d71 100644 --- a/pandora_console/include/ajax/rolling_release.ajax.php +++ b/pandora_console/include/ajax/rolling_release.ajax.php @@ -21,10 +21,11 @@ if (is_ajax ()) { if ($updare_rr) { $number = get_parameter('number'); - $package = ger_parameter('package'); + $package = get_parameter('package'); $dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr"; $file = "$dir/$number.sql"; + html_debug($file, true); $dangerous_query = false; $mr_file = fopen($file, "r"); while (!feof($mr_file)) { @@ -49,6 +50,8 @@ if (is_ajax ()) { else { if (file_exists($dir) && is_dir($dir)) { if (is_readable($dir)) { + html_debug($number, true); + html_debug($config['MR'], true); if (($number > $config['MR'] + 1) || ($number == $config['MR'])) { $message = "bad_mr_filename"; } @@ -77,7 +80,7 @@ if (is_ajax ()) { $file_dest = $config["homedir"] . "/extras/mr/updated/$number.sql"; html_debug("FILE EXISTS: " . (int)file_exists($file_dest), true); - if (file_exists($file_dest)) { + if (file_exists($file_dest) !== 0) { unlink($file); } else if (copy($file, $file_dest)) { diff --git a/pandora_console/include/ajax/update_manager.ajax.php b/pandora_console/include/ajax/update_manager.ajax.php index 0dafe4c5d2..fba4ca45fa 100644 --- a/pandora_console/include/ajax/update_manager.ajax.php +++ b/pandora_console/include/ajax/update_manager.ajax.php @@ -362,7 +362,7 @@ if ($search_minor) { $return['have_minor'] = false; if ($have_minor_releases) { $return['have_minor'] = true; - $size_mr = get_number_of_mr(); + $size_mr = get_number_of_mr($package); $return['mr'] = $size_mr; } diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 80033cfde0..ae6cce3efc 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -2683,10 +2683,10 @@ function update_config_token ($cfgtoken, $cfgvalue) { } } -function get_number_of_mr() { +function get_number_of_mr($package) { global $config; - $dir = $config["homedir"]."/extras/mr"; + $dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr"; $mr_size = array(); if (file_exists($dir) && is_dir($dir)) {