From bc7584f259d6bfc3b6721c87055e27f5cefcfca6 Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 29 Mar 2021 10:51:02 +0200 Subject: [PATCH] Fixed api add user profile with group all --- pandora_console/include/functions_api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 6691ccc605..348324f9ae 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -11009,10 +11009,10 @@ function api_set_add_user_profile($id, $thrash1, $other, $thrash2) return; } - $group = $other['data'][0]; + $group = (int) $other['data'][0]; $profile = $other['data'][1]; - if (db_get_value('id_grupo', 'tgrupo', 'id_grupo', $group) === false) { + if ($group !== 0 && db_get_value('id_grupo', 'tgrupo', 'id_grupo', $group) === false) { returnError('There is not any group with the ID provided.'); return; }