I realize this discussion is a bit dated, but I was looking to do something similar. I am using the autoenrol cohort plugin which, as advertised, automatically enrolls users in a cohort after login. This requires users to logout after being confirmed, then log back in using their credentials in order for the automatic enrollment to take effect. This is a bit un-intuitive, and I was hoping to instead direct users automatically back to the login page after they are confirmed. This would force them to login using their new credentials and be enrolled. I have tried modifying
echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses')); to direct back to login. There may be additional modifications to confirm.php I am missing. Any guidance would be helpful.
by Michael Schultz.