diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c487d5b85b..aae295b5d4 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2014-07-10 Miguel de Dios + + * include/functions_api.php: restored the parameter name server in + the api call "set_new_agent", thanks KOSAKA. + 2014-07-10 Junichi Satoh * include/help/ja/help_snmp_alert_field1.php: Updated help. diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 371a2ae4de..f3b5eb207b 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -806,7 +806,8 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3) { $cascadeProtection = $other['data'][4]; $intervalSeconds = $other['data'][5]; $idOS = $other['data'][6]; - $idServer = $other['data'][7]; + //$idServer = $other['data'][7]; + $nameServer = $other['data'][7]; $customId = $other['data'][8]; $learningMode = $other['data'][9]; $disabled = $other['data'][10]; @@ -815,12 +816,12 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3) { switch ($config["dbtype"]) { case "mysql": $sql1 = 'SELECT name - FROM tserver WHERE id_server =' . $idServer; + FROM tserver WHERE name LIKE "' . $nameServer . '"'; break; case "postgresql": case "oracle": $sql1 = 'SELECT name - FROM tserver WHERE id_server =' . $idServer; + FROM tserver WHERE name LIKE \'' . $nameServer . '\''; break; }