What I am attempting to accomplish is to have courses which get autocreated to be hidden (not available to users) We've set up a template course that is hidden, however it doesn't seem to propagate those settings over...ideas?
The current code just copies the most basic settings from the template course, which doesn't include the visibility setting. If you want to copy that setting from the template, edit create_course() in .../enrol/ldap/enrol.php and search for the line that reads:
$course->visible = 1;
and comment it out. That should do it.