Allow API access to nodes registered into the MC

This commit is contained in:
fbsanchez 2021-06-09 19:23:17 +02:00
parent e54fde338d
commit 5b9098b7b0
1 changed files with 8 additions and 0 deletions

View File

@ -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';
}