diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 933d48e317..35392a110b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2013-11-05 Sergio Martin + + * include/api.php: Create a special call on Pandora FMS + API to verify if it is a correct installation of Pandora + and get the Version. + This call only retrieve "Pandora FMS [version] - [build]" + without any security check. + 2013-11-05 Sergio Martin * include/javascript/jquery.pandora.js: Fixed "press diff --git a/pandora_console/include/api.php b/pandora_console/include/api.php index 7d132d3bb8..333ba22c3c 100644 --- a/pandora_console/include/api.php +++ b/pandora_console/include/api.php @@ -41,6 +41,7 @@ $returnType = get_parameter('return_type', 'string'); $api_password = get_parameter('apipass', ''); $password = get_parameter('pass', ''); $user = get_parameter('user', ''); +$info = get_parameter('info', ''); $other = parseOtherParameter($otherSerialize, $otherMode); @@ -50,6 +51,15 @@ $correctLogin = false; $user_in_db = null; $no_login_msg = ""; +// Special call without checks to retrieve version and build of the Pandora FMS +// This info is avalable from the web console without login +// Don't change the format, it is parsed by applications +switch($info) { + case 'version': + echo 'Pandora FMS ' . $pandora_version . ' - ' . $build_version; + exit; +} + if (isInACL($ipOrigin)) { if (empty($apiPassword) || (!empty($apiPassword) && $api_password === $apiPassword)) { $user_in_db = process_user_login($user, $password, true);