MDL-47761 enrol: Show more detail for self-enrolment errors

Thanks to Mirko Otto for the solution
This commit is contained in:
John Okely 2015-01-05 14:52:54 +08:00
parent e653b9a469
commit cf6d62fc3f
2 changed files with 4 additions and 2 deletions

View file

@ -248,6 +248,8 @@ class enrol_self_plugin extends enrol_plugin {
$form->display();
$output = ob_get_clean();
return $OUTPUT->box($output);
} else {
return $OUTPUT->box($enrolstatus);
}
}
@ -265,7 +267,7 @@ class enrol_self_plugin extends enrol_plugin {
if ($checkuserenrolment) {
if (isguestuser()) {
// Can not enrol guest.
return get_string('canntenrol', 'enrol_self');
return get_string('noguestaccess', 'enrol');
}
// Check if user is already enroled.
if ($DB->get_record('user_enrolments', array('userid' => $USER->id, 'enrolid' => $instance->id))) {