From f8e184c54e85dc55a803b76a6ccefb769ef38e17 Mon Sep 17 00:00:00 2001 From: erangamapa Date: Mon, 18 Feb 2013 11:04:14 +0530 Subject: [PATCH 1/2] [ticket/11355] Wrong error message when no user is selected. In ACP group membership management, if you select 'remove member from group' without selecting any users and submit,it will display a wrong error after confirmbox. Since no users are selected, this should not go even until confirmbox. Added a new condition to check weather any users are selected when the action is 'deleteusers' in acp_groups.php and disply a correct error. PHPBB3-11355 --- phpBB/includes/acp/acp_groups.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 486616c33d..ec44f4fc0c 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -179,6 +179,10 @@ class acp_groups break; case 'deleteusers': + if (!$name_ary) + { + trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); + } case 'delete': if (!$group_id) { @@ -795,4 +799,4 @@ class acp_groups } } -?> \ No newline at end of file +?> From ab530a999ed64a2e1fcc10252bdae6d9139d7538 Mon Sep 17 00:00:00 2001 From: erangamapa Date: Thu, 21 Feb 2013 22:47:42 +0530 Subject: [PATCH 2/2] [ticket/11355] Referred proper variable when validating selection. Earlier PR was referring wrong variable $name_ary. Changed it to $mark_ary which actually contains selected user ids. PHPBB3-11355 --- phpBB/includes/acp/acp_groups.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index ec44f4fc0c..bbe85f8038 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -179,7 +179,7 @@ class acp_groups break; case 'deleteusers': - if (!$name_ary) + if (empty($mark_ary)) { trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); }