From ebea296ac1073df0161440849640a92b5ebb2505 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 10 Jul 2014 09:10:30 +0000 Subject: [PATCH] 2014-07-10 Miguel de Dios * include/functions_api.php: restored the parameter name server in the api call "set_new_agent", thanks KOSAKA. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10332 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_api.php | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) 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; }