MDL-46338 enrol_self: Icon should indicate enrolment availability

This commit is contained in:
Marina Glancy
2014-07-29 09:52:34 +08:00
parent 2d43ffd1a9
commit 198c28cda2
+5 -2
View File
@@ -48,8 +48,11 @@ class enrol_self_plugin extends enrol_plugin {
$key = false;
$nokey = false;
foreach ($instances as $instance) {
if (!$instance->customint6) {
// New enrols not allowed.
if ($this->can_self_enrol($instance, false) !== true) {
// User can not enrol himself.
// Note that we do not check here if user is already enrolled for performance reasons -
// such check would execute extra queries for each course in the list of courses and
// would hide self-enrolment icons from guests.
continue;
}
if ($instance->password or $instance->customint1) {