diff --git a/main/work/add_user.php b/main/work/add_user.php index aabda91413..78c403a401 100755 --- a/main/work/add_user.php +++ b/main/work/add_user.php @@ -17,6 +17,7 @@ $current_course_tool = TOOL_STUDENTPUBLICATION; $workId = isset($_GET['id']) ? intval($_GET['id']) : null; $userId = isset($_GET['user_id']) ? intval($_GET['user_id']) : null; $action = isset($_GET['action']) ? $_GET['action'] : null; +$sessionId = api_get_session_id(); if (empty($workId)) { api_not_allowed(true); @@ -79,12 +80,19 @@ if (!empty($items)) { echo ''; } + +if (empty($sessionId)) { + $status = STUDENT; +} else { + $status = 0; +} + $userList = CourseManager::get_user_list_from_course_code( $courseInfo['code'], - api_get_session_id(), + $sessionId, null, null, - STUDENT + $status ); $userToAddList = array();