As noticed while testing
MDL-62493, see comments there: https://tracker.moodle.org/browse/MDL-62493?focusedCommentId=622750&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-622750
- Create a course that does not have guest access and a user who is not enrolled in this course
- Log out
- Click on the course name, you will be redirected to the login page
- Login as a user who is not enrolled
- You will be redirected to enrol/index.php that says that you can not enrol yourself
- Click "Continue" - you will get an error that you are already logged in.