From 2948d83efc73762d1fe8e3ea31693c7530244ee4 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Fri, 25 Nov 2011 10:39:28 +0000 Subject: [PATCH] 2011-11-25 Sergio Martin * include/functions_config.php: Fixed API IP list of access entities bug git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5169 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_config.php | 18 +++++------------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index be5a589234..3371a33911 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-11-25 Sergio Martin + + * include/functions_config.php: Fixed API IP list of + access entities bug + 2011-11-24 Sergio Martin * include/functions_api.php diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 49a9600d5c..54e2b68262 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -46,19 +46,9 @@ function config_update_value ($token, $value) { switch ($token) { case 'list_ACL_IPs_for_API': - switch ($config["dbtype"]) { - case "mysql": - $rows = db_get_all_rows_sql('SELECT id_config - FROM tconfig - WHERE token LIKE "%list_ACL_IPs_for_API_%"'); - break; - case "postgresql": - case "oracle": - $rows = db_get_all_rows_sql("SELECT id_config - FROM tconfig - WHERE token LIKE '%list_ACL_IPs_for_API_%'"); - break; - } + $rows = db_get_all_rows_sql("SELECT id_config + FROM tconfig + WHERE token LIKE '%list_ACL_IPs_for_API_%'"); if ($rows !== false) { foreach ($rows as $row) @@ -67,6 +57,8 @@ function config_update_value ($token, $value) { db_process_sql_delete('tconfig', 'id_config IN (' . implode(',', $idListACLofIP) . ')' ); } + $value = io_safe_output($value); + if (strpos($value, "\r\n") !== false) $ips = explode("\r\n", $value); else