aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
authorbattye <battye@phpbb.com>2018-11-26 13:08:57 +0000
committerbattye <battye@phpbb.com>2018-11-26 13:08:57 +0000
commit101829b4dce2874bbe53264c1769bf9699527c2f (patch)
treed4c27f1ab919d33d01dd57bd8ad83ce0ed5a90d3 /phpBB/includes/acp
parentb8bdccbc4431af37a0a894ad29907699402605de (diff)
downloadforums-101829b4dce2874bbe53264c1769bf9699527c2f.tar
forums-101829b4dce2874bbe53264c1769bf9699527c2f.tar.gz
forums-101829b4dce2874bbe53264c1769bf9699527c2f.tar.bz2
forums-101829b4dce2874bbe53264c1769bf9699527c2f.tar.xz
forums-101829b4dce2874bbe53264c1769bf9699527c2f.zip
[ticket/15883] Add error for invalid usernames being added to a group
Update the ACP and the UCP so that when bulk adding users to a group, if invalid usernames are submitted alongside valid usernames then a message will be displayed to inform the user what the invalid usernames are. PHPBB3-15883
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_groups.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index 0e058213e0..20f913ff29 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -293,7 +293,19 @@ class acp_groups
// Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, $leader, 0, $group_row))
{
- trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);
+ $display_message = $user->lang[$error];
+
+ if ($error == 'GROUP_USERS_INVALID')
+ {
+ // Find which users don't exist
+ $actual_name_ary = $name_ary;
+ $actual_user_id_ary = false;
+ user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true);
+
+ $display_message = sprintf($user->lang['GROUP_USERS_INVALID'], implode($user->lang['COMMA_SEPARATOR'], array_diff($name_ary, $actual_name_ary)));
+ }
+
+ trigger_error($display_message . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);
}
$message = ($leader) ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED';