From 3b0344298c2629fa791880b76e8b10f1c090f345 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Fri, 18 Nov 2016 13:01:13 +0100 Subject: [PATCH] Revert "Fixed problems with double pandora in servers. Ticket: #3557" This reverts commit e7021d8a0fc63d0c3451f2e06aba8c874c5cea0d. --- pandora_console/ajax.php | 4 ++-- pandora_console/extensions/resource_exportation.php | 4 ++-- .../godmode/agentes/planned_downtime.export_csv.php | 2 +- pandora_console/godmode/audit_log_csv.php | 6 +++--- pandora_console/include/functions.php | 6 +++--- pandora_console/include/functions_config.php | 4 ++-- pandora_console/include/get_file.php | 8 ++++---- pandora_console/index.php | 12 +++++------- pandora_console/operation/agentes/ehorus_client.php | 7 +++---- pandora_console/operation/agentes/export_csv.php | 2 +- .../agentes/interface_traffic_graph_win.php | 6 +++--- pandora_console/operation/agentes/snapshot_view.php | 4 ++-- pandora_console/operation/agentes/stat_win.php | 6 +++--- pandora_console/operation/events/events_marquee.php | 2 +- pandora_console/operation/events/export_csv.php | 2 +- pandora_console/operation/events/sound_events.php | 2 +- .../operation/reporting/reporting_xml.php | 2 +- pandora_console/operation/search_helps.getdata.php | 2 +- 18 files changed, 39 insertions(+), 42 deletions(-) diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index 4c6f40c458..261babb5aa 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -35,7 +35,7 @@ if (isset ($_GET["loginhash"])) { if ($config["loginhash_pwd"] != "" && $loginhash_data == md5($loginhash_user.io_output_password($config["loginhash_pwd"]))) { db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']); - $_SESSION[$config['homeurl_static']]['id_usuario'] = $loginhash_user; + $_SESSION['id_usuario'] = $loginhash_user; $config["id_user"] = $loginhash_user; } else { @@ -61,7 +61,7 @@ $config["remote_addr"] = $_SERVER['REMOTE_ADDR']; $page = (string) get_parameter ('page'); $page = safe_url_extraclean ($page); $page .= '.php'; -$config["id_user"] = $_SESSION[$config['homeurl_static']]["id_usuario"]; +$config["id_user"] = $_SESSION["id_usuario"]; $isFunctionSkins = enterprise_include_once ('include/functions_skins.php'); if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) $config["relative_path"] = enterprise_hook('skins_set_image_skin_path',array($config['id_user'])); diff --git a/pandora_console/extensions/resource_exportation.php b/pandora_console/extensions/resource_exportation.php index 237dab9229..65ecf79940 100755 --- a/pandora_console/extensions/resource_exportation.php +++ b/pandora_console/extensions/resource_exportation.php @@ -25,11 +25,11 @@ if (isset($_GET['get_ptr'])) { require_once ($ownDir.'../include/config.php'); // Login check - if (!isset($_SESSION[$config['homeurl_static']]["id_usuario"])) { + if (!isset($_SESSION["id_usuario"])) { $config['id_user'] = null; } else { - $config['id_user'] = $_SESSION[$config['homeurl_static']]["id_usuario"]; + $config['id_user'] = $_SESSION["id_usuario"]; } diff --git a/pandora_console/godmode/agentes/planned_downtime.export_csv.php b/pandora_console/godmode/agentes/planned_downtime.export_csv.php index 76f3d23622..ea320fddc6 100644 --- a/pandora_console/godmode/agentes/planned_downtime.export_csv.php +++ b/pandora_console/godmode/agentes/planned_downtime.export_csv.php @@ -22,7 +22,7 @@ require_once ("../../include/functions_users.php"); require_once ("../../include/functions_groups.php"); require_once ("../../include/functions_reporting.php"); -$config["id_user"] = $_SESSION[$config['homeurl_static']]["id_usuario"]; +$config["id_user"] = $_SESSION["id_usuario"]; if (! check_acl ($config['id_user'], 0, "AR")) { db_pandora_audit("ACL Violation", "Trying to access downtime scheduler"); require ("general/noaccess.php"); diff --git a/pandora_console/godmode/audit_log_csv.php b/pandora_console/godmode/audit_log_csv.php index d1afe9835f..b5020bc9a4 100644 --- a/pandora_console/godmode/audit_log_csv.php +++ b/pandora_console/godmode/audit_log_csv.php @@ -22,18 +22,18 @@ require_once ($config["homedir"]."/include/auth/mysql.php"); error_reporting(E_ALL); ini_set("display_errors", 1); -if (! isset ($_SESSION[$config['homeurl_static']]["id_usuario"])) { +if (! isset ($_SESSION["id_usuario"])) { session_start (); session_write_close (); } // Login check -if (!isset($_SESSION[$config['homeurl_static']]["id_usuario"])) { +if (!isset($_SESSION["id_usuario"])) { $config['id_user'] = null; } else { - $config['id_user'] = $_SESSION[$config['homeurl_static']]["id_usuario"]; + $config['id_user'] = $_SESSION["id_usuario"]; } if (!check_login()) { diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index c7bebcaea2..f9f8e3d8df 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1730,9 +1730,9 @@ function check_login ($output = true) { exit; } - if ((isset($_SESSION[$config['homeurl_static']]["id_usuario"])) AND ($_SESSION[$config['homeurl_static']]["id_usuario"] != "")) { - if (is_user ($_SESSION[$config['homeurl_static']]["id_usuario"])) { - $config['id_user'] = $_SESSION[$config['homeurl_static']]["id_usuario"]; + if ((isset($_SESSION["id_usuario"])) AND ($_SESSION["id_usuario"] != "")) { + if (is_user ($_SESSION["id_usuario"])) { + $config['id_user'] = $_SESSION["id_usuario"]; return true; } diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 9e4511da83..6e8e622e90 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -810,8 +810,8 @@ function config_process_config () { config_update_value ('autorefresh_white_list', ''); } // Load user session - if (isset ($_SESSION[$config['homeurl_static']]['id_usuario'])) - $config["id_user"] = $_SESSION[$config['homeurl_static']]["id_usuario"]; + if (isset ($_SESSION['id_usuario'])) + $config["id_user"] = $_SESSION["id_usuario"]; if (!isset ($config["round_corner"])) { config_update_value ('round_corner', false); diff --git a/pandora_console/include/get_file.php b/pandora_console/include/get_file.php index bc18c26a2c..76629296b8 100644 --- a/pandora_console/include/get_file.php +++ b/pandora_console/include/get_file.php @@ -13,15 +13,15 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. +if (! isset($_SESSION['id_usuario'])) { + session_start(); +} + require_once('functions.php'); require_once('functions_filemanager.php'); require_once ("config.php"); global $config; -if (! isset($_SESSION[$config['homeurl_static']]['id_usuario'])) { - session_start(); -} - check_login (); $auth_method = db_get_value('value', 'tconfig', 'token', 'auth'); diff --git a/pandora_console/index.php b/pandora_console/index.php index 11a9db378e..c546c4ac3a 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -440,11 +440,9 @@ if (! isset ($config['id_user'])) { } db_logon ($nick_in_db, $_SERVER['REMOTE_ADDR']); - $path = $config['homeurl_static']; - $_SESSION[$path]['id_usuario'] = $nick_in_db; - $_SESSION[$path]['status'] = 'logged'; + $_SESSION['id_usuario'] = $nick_in_db; $config['id_user'] = $nick_in_db; - + //========================================================== //-------- SET THE CUSTOM CONFIGS OF USER ------------------ @@ -494,7 +492,7 @@ if (! isset ($config['id_user'])) { if ($config["loginhash_pwd"] != "" && $loginhash_data == md5($loginhash_user.io_output_password($config["loginhash_pwd"]))) { db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']); - $_SESSION[$config['homeurl_static']]['id_usuario'] = $loginhash_user; + $_SESSION['id_usuario'] = $loginhash_user; $config["id_user"] = $loginhash_user; } else { @@ -515,10 +513,10 @@ if (! isset ($config['id_user'])) { // Log off if (isset ($_GET["bye"])) { include ("general/logoff.php"); - $iduser = $_SESSION[$config['homeurl_static']]["id_usuario"]; + $iduser = $_SESSION["id_usuario"]; db_logoff ($iduser, $_SERVER['REMOTE_ADDR']); // Unregister Session (compatible with 5.2 and 6.x, old code was deprecated - unset($_SESSION[$config['homeurl_static']]['id_usuario']); + unset($_SESSION['id_usuario']); unset($iduser); if ($config['auth'] == 'saml') { require_once($config['saml_path'] . 'simplesamlphp/lib/_autoload.php'); diff --git a/pandora_console/operation/agentes/ehorus_client.php b/pandora_console/operation/agentes/ehorus_client.php index 0024a6d1c1..0629ea4704 100644 --- a/pandora_console/operation/agentes/ehorus_client.php +++ b/pandora_console/operation/agentes/ehorus_client.php @@ -14,13 +14,12 @@ // GNU General Public License for more details. -// Global & session management -require_once ('../../include/config.php'); - -if (! isset($_SESSION[$config['homeurl_static']]['id_usuario'])) { +if (! isset($_SESSION['id_usuario'])) { session_start(); } +// Global & session management +require_once ('../../include/config.php'); require_once ($config['homedir'] . '/include/functions.php'); check_login(); diff --git a/pandora_console/operation/agentes/export_csv.php b/pandora_console/operation/agentes/export_csv.php index f2310467d3..473f40aef7 100644 --- a/pandora_console/operation/agentes/export_csv.php +++ b/pandora_console/operation/agentes/export_csv.php @@ -21,7 +21,7 @@ require_once ("../../include/functions_db.php"); require_once ("../../include/functions_modules.php"); require_once ("../../include/functions_agents.php"); -$config["id_user"] = $_SESSION[$config['homeurl_static']]["id_usuario"]; +$config["id_user"] = $_SESSION["id_usuario"]; if (! check_acl ($config['id_user'], 0, "AR") && ! check_acl ($config['id_user'], 0, "AW")) { require ("../../general/noaccess.php"); return; diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index aed9daa6da..2e84a0b9c0 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -13,14 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// Global & session management -require_once ('../../include/config.php'); -if (! isset($_SESSION[$config['homeurl_static']]['id_usuario'])) { +if (! isset($_SESSION['id_usuario'])) { session_start(); session_write_close(); } +// Global & session management +require_once ('../../include/config.php'); require_once ($config['homedir'] . '/include/auth/mysql.php'); require_once ($config['homedir'] . '/include/functions.php'); require_once ($config['homedir'] . '/include/functions_db.php'); diff --git a/pandora_console/operation/agentes/snapshot_view.php b/pandora_console/operation/agentes/snapshot_view.php index b5a241d2d4..3425464c21 100644 --- a/pandora_console/operation/agentes/snapshot_view.php +++ b/pandora_console/operation/agentes/snapshot_view.php @@ -13,13 +13,13 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -require_once ('../../include/config.php'); -if (! isset($_SESSION[$config['homeurl_static']]['id_usuario'])) { +if (! isset($_SESSION['id_usuario'])) { session_start(); //session_write_close(); } +require_once ('../../include/config.php'); require_once ($config['homedir'] . '/include/auth/mysql.php'); require_once ($config['homedir'] . '/include/functions.php'); require_once ($config['homedir'] . '/include/functions_db.php'); diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index f9a4f672ad..39e7c21ec7 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -13,14 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// Global & session management -require_once ('../../include/config.php'); -if (! isset($_SESSION[$config['homeurl_static']]['id_usuario'])) { +if (! isset($_SESSION['id_usuario'])) { session_start(); //session_write_close(); } +// Global & session management +require_once ('../../include/config.php'); require_once ($config['homedir'] . '/include/auth/mysql.php'); require_once ($config['homedir'] . '/include/functions.php'); require_once ($config['homedir'] . '/include/functions_db.php'); diff --git a/pandora_console/operation/events/events_marquee.php b/pandora_console/operation/events/events_marquee.php index 1a66cf32d0..d75850174b 100644 --- a/pandora_console/operation/events/events_marquee.php +++ b/pandora_console/operation/events/events_marquee.php @@ -34,7 +34,7 @@ require_once ('../../include/functions_users.php'); global $config; -$config["id_user"] = $_SESSION[$config['homeurl_static']]["id_usuario"]; +$config["id_user"] = $_SESSION["id_usuario"]; // http://es2.php.net/manual/en/ref.session.php#64525 // Session locking concurrency speedup! diff --git a/pandora_console/operation/events/export_csv.php b/pandora_console/operation/events/export_csv.php index 7734d25a47..932317266d 100644 --- a/pandora_console/operation/events/export_csv.php +++ b/pandora_console/operation/events/export_csv.php @@ -25,7 +25,7 @@ require_once ('../../include/functions_groups.php'); session_write_close (); -$config["id_user"] = $_SESSION[$config['homeurl_static']]["id_usuario"]; +$config["id_user"] = $_SESSION["id_usuario"]; if (! check_acl ($config["id_user"], 0, "ER") && ! check_acl ($config["id_user"], 0, "EW") && ! check_acl ($config["id_user"], 0, "EM")) { exit; diff --git a/pandora_console/operation/events/sound_events.php b/pandora_console/operation/events/sound_events.php index 06f985c80c..5e0928c79c 100644 --- a/pandora_console/operation/events/sound_events.php +++ b/pandora_console/operation/events/sound_events.php @@ -30,7 +30,7 @@ global $config; // Check user check_login (); -$config["id_user"] = $_SESSION[$config['homeurl_static']]["id_usuario"]; +$config["id_user"] = $_SESSION["id_usuario"]; $event_a = check_acl ($config['id_user'], 0, "ER"); $event_w = check_acl ($config['id_user'], 0, "EW"); diff --git a/pandora_console/operation/reporting/reporting_xml.php b/pandora_console/operation/reporting/reporting_xml.php index 6888e9c5e9..970b309b5d 100755 --- a/pandora_console/operation/reporting/reporting_xml.php +++ b/pandora_console/operation/reporting/reporting_xml.php @@ -68,7 +68,7 @@ if (isset ($_GET["direct"]) && $_GET["direct"]) { unset ($_GET["sec2"]); $_GET["sec"] = "general/logon_ok"; db_logon ($nick, $_SERVER['REMOTE_ADDR']); - $_SESSION[$config['homeurl_static']]['id_usuario'] = $nick; + $_SESSION['id_usuario'] = $nick; $config['id_user'] = $nick; //Remove everything that might have to do with people's passwords or logins unset ($_GET['pass'], $pass, $_POST['pass'], $_REQUEST['pass'], $login_good); diff --git a/pandora_console/operation/search_helps.getdata.php b/pandora_console/operation/search_helps.getdata.php index 040520adc6..b2194a6ce2 100644 --- a/pandora_console/operation/search_helps.getdata.php +++ b/pandora_console/operation/search_helps.getdata.php @@ -24,7 +24,7 @@ if ($searchHelps) { $help_directory = $config['homedir'] . "/include/help"; - $user_language = get_user_language ($_SESSION[$config['homeurl_static']]['id_usuario']); + $user_language = get_user_language ($_SESSION['id_usuario']); if ($user_language === 'en_GB') { $user_language = 'en'; }