2011-09-06 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* godmode/setup/setup.php: Avoiding wrong integria inventory
        object data.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4912 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2011-09-06 08:44:45 +00:00
parent ee1ade65ce
commit 4efc90766d
2 changed files with 25 additions and 11 deletions

View File

@ -1,3 +1,7 @@
2011-09-06 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* godmode/setup/setup.php: Avoiding wrong integria inventory object data.
2011-09-05 Miguel de Dios <miguel.dedios@artica.es>
* operation/agentes/alerts_status.php: change the user rights to validate

View File

@ -134,6 +134,16 @@ if($config["integria_enabled"]) {
$invent = incidents_call_api($config['integria_url']."/include/api.php?user=".$config['id_user']."&pass=".$config['integria_api_password']."&op=get_inventories");
$invent = explode("\n",$invent);
$inventories = array();
$bad_input = false;
foreach($invent as $inv){
// This avoid wrong integria inventory object
if (stristr($inv, 'ERROR 404') !== false){
$inventories[""] = __('None');
$bad_input = true;
break;
}
}
if (!$bad_input){
foreach($invent as $inv) {
if($inv == '') {
continue;
@ -145,7 +155,7 @@ if($config["integria_enabled"]) {
$inventories[$invexp[0]] = $invexp[1];
}
}
$table->data[21][0] = __('Integria inventory');
$table->data[21][1] = html_print_select($inventories, 'integria_inventory', $config["integria_inventory"], '', '', '', true);
}