From cd0d2c68e5c15331a2321771bf7d529cdba547c1 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 20 Apr 2015 16:24:08 +0200 Subject: [PATCH 1/3] Fixed the function mysql_db_get_all_rows_in_table for several fields to order as array (cherry picked from commit 36c5349cf46d75739aad15d62b29be7fe7cbdbe7) --- pandora_console/include/db/mysql.php | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index fd904bb0ad..da202fb0c3 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -181,14 +181,26 @@ function mysql_db_get_row ($table, $field_search, $condition, $fields = false) { * @return mixed A matrix with all the values in the table */ function mysql_db_get_all_rows_in_table($table, $order_field = "", $order = 'ASC') { - if ($order_field != "") { - return db_get_all_rows_sql ("SELECT * - FROM `".$table."` - ORDER BY ".$order_field . " " . $order); - } - else { - return db_get_all_rows_sql ("SELECT * FROM `".$table."`"); + $sql = " + SELECT * + FROM `".$table."`"; + + if (!empty($order_field)) { + if (is_array($order_field)) { + foreach ($order_field as $i => $o) { + $order_field[$i] = $o . " " . $order; + } + $sql .= " + ORDER BY " . implode(",", $order_field); + } + else { + $sql .= " + ORDER BY ".$order_field . " " . $order; + } + } + + return db_get_all_rows_sql($sql); } /** From 7812f2a965b2b5b07f8e59a1492b3b2a533eb387 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 22 Apr 2015 00:01:28 +0200 Subject: [PATCH 2/3] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 75b7c21b40..c72730a98b 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150421 +Version: 6.0dev-150422 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 392cf1de3a..8e6acc2300 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150421" +pandora_version="6.0dev-150422" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index f674aa62ae..f43420b46f 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150421'; +use constant AGENT_BUILD => '150422'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 969ee98742..c457e6ba20 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150421 +%define release 150422 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 0b091489e0..c1c69046e0 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150421 +%define release 150422 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 3c7f85e381..470a2e0629 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150421} +{150422} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index babb62bb3b..89ff13577e 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.0dev(Build 150421)") +#define PANDORA_VERSION ("6.0dev(Build 150422)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e551771996..0551809a53 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.0dev(Build 150421))" + VALUE "ProductVersion", "(6.0dev(Build 150422))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 421d6d654a..3d6b108492 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150421 +Version: 6.0dev-150422 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index b759266a2f..ab433c1265 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150421" +pandora_version="6.0dev-150422" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 2b0f0e344e..b6f9dc2801 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150421'; +$build_version = 'PC150422'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 582c5423c7..909c33878e 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Wed, 22 Apr 2015 09:41:42 +0200 Subject: [PATCH 3/3] Fixed error in pagination to extension Agents/Modules --- pandora_console/extensions/agents_modules.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index 410af0f7d2..4ad792fe9f 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -138,7 +138,7 @@ function mainAgentsModules() { } $count++; } - + $total_pagination = count($agents); $all_modules = agents_get_modules($agents, false, $filter_module_group, true, false); $modules_by_name = array(); @@ -242,13 +242,12 @@ function mainAgentsModules() { echo ""; - $filter_agents = array('offset' => (int) $offset, - 'limit' => (int) $config['block_size'], 'disabled' => 0); + $filter_agents = array('offset' => (int) $offset, 'disabled' => 0); if ($group_id > 0) { $filter_agents['id_grupo'] = $group_id; } // Prepare pagination - ui_pagination ((int)count(agents_get_agents ($filter_agents))); + ui_pagination ($total_pagination); foreach ($agents as $agent) { // Get stats for this group