/** * removes user from a group * * @api * * @param int $group_id group id * @param int $user_id user_id * * @return bool on success TRUE/FALSE */ function ace_group_remove_user($group_id, $user_id) { $success = ace_db_group_remove_user($group_id, $user_id); $user_groups = ace_user_get_groups($user_id); if (count($user_groups) == 1) { $user_security_level = ace_user_get_security_level($user_id); if ($user_security_level == 3) { ace_user_delete($user_id); } } return $success ? TRUE : FALSE; }
} $html_select_lab_buttons = ''; foreach ($user_lab_table as $lab) { $active = $lab['state'] == 1 ? ' active' : ' inactive'; $selected = $lab['id'] == $lab_id ? 'selected' : ''; $html_select_lab_buttons .= ' <div class="row_element"> <form name="select_lab_form" action="' . _LAB_URL_ . '" method="post"> <input name="action" value="lab_load" type="hidden" /> <button name="lab_id" value="' . $lab['id'] . '" class="' . $selected . '" type="submit">' . $lab['display_name'] . '</button> <input name="nonce" value=' . $nonce . ' type="hidden" /> </form> <div class="lab_active_button_indicator' . $active . '"></div> </div>'; } $user_group_table = ace_user_get_groups($_SESSION['user_id']); $html_select_users_group_labs = '<option value="none">select lab...</option>'; foreach ($user_group_table as $group) { $group_active = $group['state'] == 1 ? TRUE : FALSE; if ($group_active) { $group_lab_table = ace_group_get_lab_table($group['group_id']); foreach ($group_lab_table as $lab) { $html_select_users_group_labs .= '<option value="' . $lab['id'] . '">' . $group['name'] . ':' . $lab['display_name'] . '</option>'; } } } $create_lab_button_disabled = $num_user_labs >= $user_quota_array['labs'] ? 'disabled' : ''; $select_student_lab_count = 0; $select_class_table = ace_user_get_owned_academic_groups($user_id); $html_select_class_labs_none = ' <option value="none">select lab...</option>';