Merge branch 'ent-4903-list_ACL_IPs_for_API' into 'develop'

Fix bug when updating ACL IP list

See merge request artica/pandorafms!2961
This commit is contained in:
Alejandro Fraguas 2019-12-16 11:19:10 +01:00
commit 37020bd572
1 changed files with 9 additions and 8 deletions

View File

@ -1911,14 +1911,6 @@ function config_process_config()
* Parse the ACL IP list for access API
*/
$temp_list_ACL_IPs_for_API = [];
if (isset($config['list_ACL_IPs_for_API'])) {
if (!empty($config['list_ACL_IPs_for_API'])) {
$temp_list_ACL_IPs_for_API = explode(';', $config['list_ACL_IPs_for_API']);
}
}
$config['list_ACL_IPs_for_API'] = $temp_list_ACL_IPs_for_API;
$keysConfig = array_keys($config);
/*
@ -2976,6 +2968,15 @@ function config_process_config()
// Finally, check if any value was overwritten in a form.
config_update_config();
$temp_list_ACL_IPs_for_API = [];
if (isset($config['list_ACL_IPs_for_API'])) {
if (!empty($config['list_ACL_IPs_for_API'])) {
$temp_list_ACL_IPs_for_API = explode(';', $config['list_ACL_IPs_for_API']);
}
}
$config['list_ACL_IPs_for_API'] = $temp_list_ACL_IPs_for_API;
}