Merge branch 'MDL-47761-master' of git://github.com/xow/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2015-01-15 08:35:02 +00:00
committed by Dan Poltawski
2 changed files with 4 additions and 2 deletions
+3 -1
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))) {
+1 -1
View File
@@ -602,7 +602,7 @@ class enrol_self_testcase extends advanced_testcase {
$selfplugin->enrol_user($instance1, $user2->id, $editingteacherrole->id);
$this->setUser($guest);
$this->assertSame($expectederrorstring, $selfplugin->can_self_enrol($instance1, true));
$this->assertSame(get_string('noguestaccess', 'enrol'), $selfplugin->can_self_enrol($instance1, true));
$this->setUser($user1);
$this->assertTrue($selfplugin->can_self_enrol($instance1, true));