2013-11-05 Sergio Martin <sergio.martin@artica.es>

* 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.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9008 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-11-05 17:23:13 +00:00
parent cfdf56b544
commit a7d3ad065d
2 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2013-11-05 Sergio Martin <sergio.martin@artica.es>
* 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 <sergio.martin@artica.es>
* include/javascript/jquery.pandora.js: Fixed "press

View File

@ -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);