From 5b9098b7b07b0d2288c945e59d204769fb69aa9b Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 9 Jun 2021 19:23:17 +0200 Subject: [PATCH] Allow API access to nodes registered into the MC --- pandora_console/include/api.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandora_console/include/api.php b/pandora_console/include/api.php index c4bfac28cc..85bc78c6e8 100644 --- a/pandora_console/include/api.php +++ b/pandora_console/include/api.php @@ -43,6 +43,7 @@ if (file_exists($config['homedir'].'/'.ENTERPRISE_DIR.'/load_enterprise.php') == // TESTING THE UPDATE MANAGER. enterprise_include_once('load_enterprise.php'); enterprise_include_once('include/functions_enterprise_api.php'); +enterprise_include_once('include/functions_metaconsole.php'); $ipOrigin = $_SERVER['REMOTE_ADDR']; @@ -108,6 +109,13 @@ if (isInACL($ipOrigin)) { config_prepare_session(); session_write_close(); + } else if (enterprise_hook( + 'metaconsole_validate_origin', + [get_parameter('server_auth')] + ) === true + ) { + // Allow direct node -> metaconsole connection. + $correctLogin = true; } else { $no_login_msg = 'Incorrect user credentials'; }