From 1c61156311d42b42dbc7b866b1df5d7cc8573353 Mon Sep 17 00:00:00 2001 From: vgilc Date: Mon, 12 Mar 2012 11:15:23 +0000 Subject: [PATCH] 2012-03-12 Vanessa Gil * index.php operation/users/user_edit.php: Customize home screen. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5734 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 4 ++ pandora_console/index.php | 47 ++++++++++++++----- pandora_console/operation/users/user_edit.php | 9 +++- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 28089f3150..38a2f3aece 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2012-03-12 Vanessa Gil + * index.php + operation/users/user_edit.php: Customize home screen. + 2012-03-09 Miguel de Dios * include/javascript/pandora.js, extensions/snmp_explorer.php, diff --git a/pandora_console/index.php b/pandora_console/index.php index aa31b65dad..caaa15d563 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -276,28 +276,55 @@ else { if ($home_page != '') { switch($home_page) { - case __('Event list'): - header ('location:' . $config['homeurl'] . '/index.php?sec=eventos&sec2=operation/events/events'); + case __('Event list'): + require ('operation/events/events.php'); break; case __('Group view'): - header ('location:' . $config['homeurl'] . '/index.php?sec=estado&sec2=operation/agentes/group_view'); + require ('operation/agentes/group_view.php'); break; case __('Alert detail'): - header ('location:' . $config['homeurl'] . '/index.php?sec=estado&sec2=operation/agentes/alerts_status'); + require ('operation/agentes/alerts_status.php'); break; case __('Tactical view'): - require ("general/logon_ok.php"); + require ('operation/agentes/tactical.php'); + break; + case __('Default'): + require ('general/logon_ok.php'); break; case __('Dashboard'): $id_dashboard = db_get_value('id', 'tdashboard', 'name', $home_url); - header ('location:' . $config['homeurl'] . '/index.php?sec=dashboard&sec2='.ENTERPRISE_DIR.'/dashboard/main_dashboard&id='.$id_dashboard); + $str = 'sec=visualc&sec2='.ENTERPRISE_DIR.'/dashboard/main_dashboard&id='.$id_dashboard; + parse_str($str, $res); + foreach ($res as $key => $param) { + $_GET[$key] = $param; + } + require(ENTERPRISE_DIR.'/dashboard/main_dashboard.php'); break; case __('Visual console'): $id_visualc = db_get_value('id', 'tlayout', 'name', $home_url); - header ('location:' . $config['homeurl'] . '/index.php?sec=visualc&sec2=operation/visual_console/render_view&id='. $id_visualc .'&refr=60'); + $str = 'sec=visualc&sec2=operation/visual_console/render_view&id='.$id_visualc .'&refr=60'; + parse_str($str, $res); + foreach ($res as $key => $param) { + $_GET[$key] = $param; + } + require('operation/visual_console/render_view.php'); break; case __('Other'): - header ('location:' . $config['homeurl'] . '/index.php?'. io_safe_output($home_url)); + $home_url = io_safe_output($home_url); + parse_str ($home_url, $res); + foreach ($res as $key => $param) { + $_GET[$key] = $param; + } + if (isset($_GET['sec2'])) { + $file = $_GET['sec2'].'.php'; + + if (!file_exists ($file)) { + unset($_GET['sec2']); + require('general/logon_ok.php'); + } else { + require($file); + } + } break; } @@ -331,7 +358,3 @@ echo ''; $run_time = format_numeric (microtime (true) - $config['start_time'], 3); echo "\n\n"; ?> - - diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php index 05d95adec4..56172e101a 100644 --- a/pandora_console/operation/users/user_edit.php +++ b/pandora_console/operation/users/user_edit.php @@ -97,7 +97,7 @@ if (isset ($_GET["modified"]) && !$view_mode) { $visual_console = get_parameter('visual_console', ''); $section = io_safe_output($upd_info["section"]); - if (($section == 'Event list') || ($section == 'Group view') || ($section == 'Alert detail') || ($section == 'Tactical view')) { + if (($section == 'Event list') || ($section == 'Group view') || ($section == 'Alert detail') || ($section == 'Tactical view') || ($section == 'Default')) { $upd_info["data_section"] = ''; } else if ($section == 'Dashboard') { $upd_info["data_section"] = $dashboard; @@ -242,7 +242,7 @@ echo html_print_checkbox('shortcut_bar', 1, $user_info["shortcut"], true); echo ''.__('Home screen'). ui_print_help_tip(__(' User can customize the home page. By default, will display \'Tactical view\'. Example: Select \'Other\' and type sec=estado&sec2=operation/agentes/estado_agente to show agent detail view'), true) .''; -$values = array ('Dashboard'=>__('Dashboard'), 'Visual console'=>__('Visual console'), 'Event list'=>__('Event list'), +$values = array ('Default' => 'Default', 'Dashboard'=>__('Dashboard'), 'Visual console'=>__('Visual console'), 'Event list'=>__('Event list'), 'Group view'=>__('Group view'), 'Tactical view'=>__('Tactical view'), 'Alert detail' => __('Alert detail'), 'Other'=>__('Other')); echo html_print_select($values, 'section', io_safe_output($user_info["section"]), 'show_data_section();', '', -1, true, false, false); echo "  "; @@ -369,6 +369,11 @@ function show_data_section () { $("#dashboard").css("display", "none"); $("#visual_console").css("display", "none"); break; + case : + $("#text-data_section").css("display", "none"); + $("#dashboard").css("display", "none"); + $("#visual_console").css("display", "none"); + break; } }