When you create a course on Moodle, the course enrolable is always set to yes by default. Sometime this is problematic for you.
This is how you set course enrolable to no by default!
Open moodle/course/edit_form.php and find the line:
And change it to: