2014-03-04 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_api.php: fixed the function "get_module_name".
	Thanks Cucumber.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9501 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-03-04 16:51:30 +00:00
parent 9ef8390fea
commit 15b15c091a
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2014-03-04 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php: fixed the function "get_module_name".
Thanks Cucumber.
2014-03-04 Sergio Martin <sergio.martin@artica.es>
* include/help/es/help_ipam.php: Typo fix in ipam text

View File

@ -6157,14 +6157,18 @@ function api_get_agent_name($id_agent, $trash1, $trash2, $returnType) {
// http://localhost/pandora_console/include/api.php?op=get&op2=module_name&id=20&apipass=1234&user=admin&pass=pandora
function api_get_module_name($id_module, $trash1, $trash2, $returnType) {
$sql = sprintf('SELECT name FROM tmodule WHERE id_module = %d', $id_module);
$value = db_get_value_sql($sql);
$sql = sprintf('SELECT nombre
FROM tagente_modulo
WHERE id_agente_modulo = %d', $id_module);
$value = db_get_value_sql($sql);
if ($value === false) {
returnError('id_not_found', $returnType);
}
$data = array('type' => 'string', 'data' => $value);
returnData($returnType, $data);
}