From f37604cedf767a53c7768ac27b2ca3feb5dd9377 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Thu, 2 Feb 2012 14:27:23 +0000 Subject: [PATCH] 2012-02-02 Juan Manuel Ramon * general/shortcut_bar.php: Fixed bug when the user doesn't have 'LM' permissions. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5470 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/general/shortcut_bar.php | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index eba5eeabdd..64c200873c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-02-02 Juan Manuel Ramon + + * general/shortcut_bar.php: Fixed bug when the user doesn't have + 'LM' permissions. + 2012-02-02 Juan Manuel Ramon * include/functions_api.php: Added get_alert_template function to diff --git a/pandora_console/general/shortcut_bar.php b/pandora_console/general/shortcut_bar.php index ffdaab990d..b8e294b80e 100644 --- a/pandora_console/general/shortcut_bar.php +++ b/pandora_console/general/shortcut_bar.php @@ -71,8 +71,13 @@ id_grupo IN (".implode (",",array_keys ($own_groups)).") AND estado IN (0) ORDER BY actualizacion"; - $result_incidents_update = db_get_all_rows_sql ($sql); - + + if (!empty($own_groups)){ + $result_incidents_update = db_get_all_rows_sql ($sql); + } + else{ + $result_incidents_update = false; + } if ($result_incidents_update === false) $shortcut_incidents = 0; @@ -145,9 +150,13 @@ $sql = "SELECT count(*) total_incidents FROM tincidencia WHERE id_grupo IN (".implode (",",array_keys ($own_groups)).") AND estado IN (0) ORDER BY actualizacion"; - - $result_incidents = db_get_all_rows_sql ($sql); + if (!empty($own_groups)){ + $result_incidents = db_get_all_rows_sql ($sql); + } + else { + $result_incidents = false; + } if ($result_incidents === false) $shortcut_incidents = 0;