aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp
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/ucp
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/ucp')
-rw-r--r--phpBB/includes/ucp/ucp_groups.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index 1fb026167a..e32c855179 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -1057,7 +1057,19 @@ class ucp_groups
// Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, 0, 0, $group_row))
{
- trigger_error($user->lang[$error] . $return_page);
+ $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 . $return_page);
}
trigger_error($user->lang['GROUP_USERS_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&amp;action=list&amp;g=' . $group_id . '">', '</a>'));