From 84c9b92b809f352bb81a1bf9a71e6d9b7660e1d5 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 28 Jul 2011 09:25:42 +0000 Subject: [PATCH] 2011-07-28 Sergio Martin * include/config_process.php include/functions.php operation/agentes/stat_win.php general/pandora_help.php: Create new functions to manage pandora languages. Fix pandora_help languages to use the user language, no always the global language. Fix som SESSION index little bugs git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4641 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 11 +++++++++++ pandora_console/general/pandora_help.php | 8 +++++++- pandora_console/include/config_process.php | 9 +-------- pandora_console/include/functions.php | 16 ++++++++++++++++ pandora_console/operation/agentes/stat_win.php | 12 ++++++------ 5 files changed, 41 insertions(+), 15 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f59209d873..0561938365 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2011-07-28 Sergio Martin + + * include/config_process.php + include/functions.php + operation/agentes/stat_win.php + general/pandora_help.php: Create new functions to manage pandora + languages. + Fix pandora_help languages to use the user language, no always the + global language. + Fix som SESSION index little bugs + 2011-07-27 Ramon Novoa * operation/events/events_list.php: Hide agent details unless we have diff --git a/pandora_console/general/pandora_help.php b/pandora_console/general/pandora_help.php index 3cff12249d..d822c03473 100644 --- a/pandora_console/general/pandora_help.php +++ b/pandora_console/general/pandora_help.php @@ -27,9 +27,15 @@ require_once ("../include/functions_html.php"); '; ?> load_tables(); -} +set_user_language(); require_once ($ownDir . 'functions_extensions.php'); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index a094f2edd3..7a31a1e899 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -350,6 +350,22 @@ function get_user_language ($id_user = false) { return $config['language']; } +/** + * This function get the user language and set it on the system + */ +function set_user_language() { + global $config; + global $l10n; + + $l10n = NULL; + $user_language = get_user_language (); + + if (file_exists ('./include/languages/'.$user_language.'.mo')) { + $l10n = new gettext_reader (new CachedFileReader ('./include/languages/'.$user_language.'.mo')); + $l10n->load_tables(); + } +} + /** * INTERNAL (use ui_print_timestamp for output): Transform an amount of time in seconds into a human readable * strings of minutes, hours or days. diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 4d2250140e..46fb500e83 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -19,16 +19,16 @@ require_once ('../../include/config.php'); require_once ('../../include/auth/mysql.php'); -if (! isset($_SESSION["id_user"])) { +if (! isset($_SESSION['id_usuario'])) { session_start(); session_write_close(); } -require_once ($config["homedir"] . '/include/functions.php'); -require_once ($config["homedir"] . '/include/functions_db.php'); -require_once ($config["homedir"] . '/include/functions_reporting.php'); -require_once ($config["homedir"] . '/include/functions_graph.php'); -require_once ($config['homedir'] . "/include/functions_modules.php"); +require_once ($config['homedir'] . '/include/functions.php'); +require_once ($config['homedir'] . '/include/functions_db.php'); +require_once ($config['homedir'] . '/include/functions_reporting.php'); +require_once ($config['homedir'] . '/include/functions_graph.php'); +require_once ($config['homedir'] . '/include/functions_modules.php'); check_login ();