diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 2cee1df4bf..2e231cf992 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -21,32 +21,32 @@ if (! isset($_SESSION['id_usuario'])) { // Global & session management require_once ('../../include/config.php'); -require_once ('../../include/auth/mysql.php'); +require_once ($config['homedir'] . '/include/auth/mysql.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'); - -// Hash login process -if (! isset ($config['id_user']) && get_parameter("loginhash", 0)) { - $loginhash_data = get_parameter("loginhash_data", ""); - $loginhash_user = str_rot13(get_parameter("loginhash_user", "")); - - if ($config["loginhash_pwd"] != "" - && $loginhash_data == md5($loginhash_user.io_output_password($config["loginhash_pwd"]))) { - - db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']); - $_SESSION['id_usuario'] = $loginhash_user; - $config["id_user"] = $loginhash_user; - - $hash_connection_data = true; - } - -} +require_once ($config['homedir'] . '/include/functions_agents.php'); check_login (); +// Metaconsole connection to the node +$server_id = (int) get_parameter("server"); +if ($config["metaconsole"] && !empty($server_id)) { + $server = metaconsole_get_connection_by_id($server_id); + + // Error connecting + if (metaconsole_connect($server) !== NOERR) { + echo ""; + echo ""; + ui_print_error_message(__('There was a problem connecting with the node')); + echo ""; + echo ""; + exit; + } +} + $user_language = get_user_language ($config['id_user']); if (file_exists ('../../include/languages/'.$user_language.'.mo')) { $l10n = new gettext_reader (new CachedFileReader ('../../include/languages/'.$user_language.'.mo')); @@ -100,15 +100,28 @@ $label = base64_decode(get_parameter('label', '')); '; - $params['body_text'] .= html_print_input_hidden ("id", $id, true); - $params['body_text'] .= html_print_input_hidden ("label", $label); - - if (isset($hash_connection_data)) { - $params['body_text'] .= - html_print_input_hidden("loginhash", "auto", true); - $params['body_text'] .= - html_print_input_hidden("loginhash_data", $loginhash_data, true); - $params['body_text'] .= - html_print_input_hidden("loginhash_user", - str_rot13($loginhash_user), true); - } - $params['body_text'] .= html_print_input_hidden ("id", $id, true); $params['body_text'] .= html_print_input_hidden ("label", $label, true); + if (!empty($server_id)) + $params['body_text'] .= html_print_input_hidden ("server", $server_id, true); + if (isset($_GET["type"])) { $type = get_parameter_get ("type"); $params['body_text'] .= html_print_input_hidden ("type", $type, true);