Open
Description
In public/main/admin/user_edit.php (line 484) we check the number of courses of a user so as to have an idea whether this user is a teacher in those courses by using $userObj->getCourses()->count()
.
This is wrong, as it will return any course associated with the user through the course_rel_user table. That table has a "status" field that gives an idea wether the user is a teacher in there or not (status == 1).
Add a new method "getTaughtCourses()" in the User entity (or any other place where it would make sense) to get only the courses where the user is a teacher.