From d2c3982a5db42ece9b93c8e2c87bbfd8b881e450 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 21 Jun 2023 13:05:37 +0200 Subject: [PATCH] #11375 bulk add profile error already exists --- pandora_console/godmode/massive/massive_add_profiles.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/massive/massive_add_profiles.php b/pandora_console/godmode/massive/massive_add_profiles.php index 6fa11d357f..5e23637453 100644 --- a/pandora_console/godmode/massive/massive_add_profiles.php +++ b/pandora_console/godmode/massive/massive_add_profiles.php @@ -103,6 +103,7 @@ if ($create_profiles) { $groups_id = get_parameter('groups_id', -1); $users_id = get_parameter('users_id', -1); $n_added = 0; + $msg_error = __('Profiles cannot be added'); if ($profiles_id == -1 || $groups_id == -1 || $users_id == -1) { $result = false; @@ -155,6 +156,8 @@ if ($create_profiles) { if ($return !== false) { $n_added++; } + } else { + $msg_error = __('The profile already exist on the user'); } } } @@ -182,7 +185,7 @@ if ($create_profiles) { ui_print_result_message( $n_added > 0, __('Profiles added successfully').'('.$n_added.')', - __('Profiles cannot be added') + $msg_error ); }