Commit 5188d67c authored by Nigel McNie's avatar Nigel McNie
Browse files

Split the 'access denied' message from the 'user already invited'

message when inviting users to groups.
parent 19cd7f72
......@@ -41,12 +41,15 @@ if (!$user) {
}
if ($group->jointype != 'invite'
|| record_exists('group_member', 'group', $groupid, 'member', $userid)
|| record_exists('group_member_invite', 'group', $groupid, 'member', $userid)
|| group_user_access($groupid) != 'admin') {
throw new AccessDeniedException(get_string('cannotinvitetogroup', 'group'));
}
if (record_exists('group_member', 'group', $groupid, 'member', $userid)
|| record_exists('group_member_invite', 'group', $groupid, 'member', $userid)) {
throw new UserException(get_string('useralreadyinvitedtogroup', 'group'));
}
define('TITLE', get_string('invitemembertogroup', 'group', display_name($userid), $group->name));
$roles = group_get_role_info($groupid);
......
......@@ -244,6 +244,7 @@ $string['addusertogroup'] = 'Add to ';
$string['inviteusertojoingroup'] = 'Invite to ';
$string['invitemembertogroup'] = 'Invite %s to join \'%s\'';
$string['cannotinvitetogroup'] = 'You can\'t invite this user to this group';
$string['useralreadyinvitedtogroup'] = 'This user has already been invited to, or is already a member of, this group.';
$string['removefriend'] = 'Remove friend';
$string['denyfriendrequestlower'] = 'Deny friend request';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment