From 546bfdcf9ed91e6c8561f7e2e87cb1e44a084409 Mon Sep 17 00:00:00 2001 From: javilanz Date: Thu, 17 Feb 2011 18:24:06 +0000 Subject: [PATCH] 2011-02-07 Javier Lanz * godmode/gis_maps/index.php: Only display Default column to an admin user git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3909 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 4 ++++ pandora_console/godmode/gis_maps/index.php | 21 ++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b817cd6d2d..197c3243ad 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2011-02-07 Javier Lanz + * godmode/gis_maps/index.php: Only display Default column to an admin + user + 2011-02-17 Juan Manuel Ramon * include/functions_custom_graphs.php diff --git a/pandora_console/godmode/gis_maps/index.php b/pandora_console/godmode/gis_maps/index.php index cf2deced80..d1e1257102 100644 --- a/pandora_console/godmode/gis_maps/index.php +++ b/pandora_console/godmode/gis_maps/index.php @@ -49,6 +49,11 @@ if (is_ajax ()) { $action = get_parameter('action'); +$own_info = get_user_info($config['id_user']); +if ($own_info['is_admin'] || give_acl ($config['id_user'], 0, "PM")) + $display_default_column = true; +else + $display_default_column = false; switch ($action) { case 'delete_map': @@ -63,7 +68,8 @@ $table->width = '500px'; $table->head[0] = __('Map name'); $table->head[1] = __('Group'); $table->head[2] = __('View'); -$table->head[3] = __('Default'); +if ($display_default_column) + $table->head[3] = __('Default'); $table->head[4] = __('Delete'); $table->align[1] = 'center'; @@ -93,11 +99,16 @@ if (!$maps) { $defaultMapId = $map['id_tgis_map']; } - $table->data[] = array('' . $map['map_name'] . '', + $table_info = array('' . $map['map_name'] . '', print_group_icon ($map['group_id'], true), - '' . print_image ("images/eye.png", true).'', - print_radio_button_extended('default_map', $map['id_tgis_map'], '', $checked, false, "setDefault(" . $map['id_tgis_map'] . ");", '', true), - '' . print_image ("images/cross.png", true).''); + '' . print_image ("images/eye.png", true).''); + if ($display_default_column) { + $default_button = print_radio_button_extended('default_map', $map['id_tgis_map'], '', $checked, false, "setDefault(" . $map['id_tgis_map'] . ");", '', true); + array_push($table_info, $default_button); + } + $delete_button = '' . print_image ("images/cross.png", true).''; + array_push ($table_info, $delete_button); + $table->data[] = $table_info; } print_table($table); }