Skip to content

Commit

Permalink
Prevent add invitees to course group - Refs #8091
Browse files Browse the repository at this point in the history
  • Loading branch information
jloguercio committed Feb 16, 2016
1 parent e92eb1b commit f879028
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions main/group/member_settings.php
Expand Up @@ -136,23 +136,26 @@ function check_group_members($value)
if (!empty($complete_user_list)) {
usort($complete_user_list, 'sort_users');
foreach ($complete_user_list as $index => $user) {
$officialCode = !empty($user['official_code']) ? ' - '.$user['official_code'] : null;

$groups = $userGroup->getUserGroupListByUser($user['user_id']);
$groupNameListToString = '';
if (!empty($groups)) {
$groupNameList = array_column($groups, 'name');
$groupNameListToString = ' - ['.implode(', ', $groupNameList).']';
}
//prevent invitee users add to groups - see #8091
if ($user['status'] != 20) {
$officialCode = !empty($user['official_code']) ? ' - '.$user['official_code'] : null;

$groups = $userGroup->getUserGroupListByUser($user['user_id']);
$groupNameListToString = '';
if (!empty($groups)) {
$groupNameList = array_column($groups, 'name');
$groupNameListToString = ' - ['.implode(', ', $groupNameList).']';
}

$name = api_get_person_name($user['firstname'], $user['lastname']).
' ('.$user['username'].')'.$officialCode;
$name = api_get_person_name($user['firstname'], $user['lastname']).
' ('.$user['username'].')'.$officialCode;

if ($orderUserListByOfficialCode === 'true') {
$officialCode = !empty($user['official_code']) ? $user['official_code']." - " : '? - ';
$name = $officialCode." ".api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')';
if ($orderUserListByOfficialCode === 'true') {
$officialCode = !empty($user['official_code']) ? $user['official_code']." - " : '? - ';
$name = $officialCode." ".api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')';
}
$possible_users[$user['user_id']] = $name.$groupNameListToString;
}
$possible_users[$user['user_id']] = $name.$groupNameListToString;
}
}

Expand Down

0 comments on commit f879028

Please sign in to comment.