From 810516479a4624d05d3efe70b38d7bf1140c7df0 Mon Sep 17 00:00:00 2001
From: Ramon Novoa <rnovoa@artica.es>
Date: Thu, 17 Feb 2011 15:46:22 +0000
Subject: [PATCH] 2011-02-17  Ramon Novoa  <rnovoa@artica.es>

	* include/functions.php: Hide custom SQL reports from non PM users
	  when creating reports.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3898 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
---
 pandora_console/ChangeLog             |  5 +++++
 pandora_console/include/functions.php | 15 ++++++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog
index 4dc991a700..d10afeb40b 100644
--- a/pandora_console/ChangeLog
+++ b/pandora_console/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-17  Ramon Novoa  <rnovoa@artica.es>
+
+	* include/functions.php: Hide custom SQL reports from non PM users
+	  when creating reports.
+
 2011-02-17 Miguel de Dios  <miguel.dedios@artica.es>
 
 	* images/os_icons/android_small.png,
diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php
index 6d45f1b908..66c0268c1e 100644
--- a/pandora_console/include/functions.php
+++ b/pandora_console/include/functions.php
@@ -647,11 +647,16 @@ function get_report_types () {
 	$types['min_value'] = __('Min. Value');
 	$types['sumatory'] = __('Summatory');
 	//$types['agent_detailed'] = __('Agent detailed view');
-	$types['text'] = __('Text');
-	$types['sql'] = __('SQL query');
-	$types['sql_graph_vbar'] = __('SQL vertical bar graph');
-	$types['sql_graph_pie'] = __('SQL pie graph');
-	$types['sql_graph_hbar'] = __('SQL horizonal bar graph');
+	$types['text'] = __ ('Text');
+	
+	# Only pandora managers have access to the whole database
+	if (give_acl ($config['id_user'], 0, "PM")) {
+		$types['sql'] = __('SQL query');
+		$types['sql_graph_vbar'] = __('SQL vertical bar graph');
+		$types['sql_graph_pie'] = __('SQL pie graph');
+		$types['sql_graph_hbar'] = __('SQL horizonal bar graph');
+	}
+
 	$types['url'] = __('Import text from URL');
 	$types['database_serialized'] = __('Serialize data');
 	$types['TTRT'] = __('TTRT');