MDL-29688 properly reactivate ext db enrolment
authorPetr Skoda <commits@skodak.org>
Sun, 23 Oct 2011 18:51:39 +0000 (20:51 +0200)
committerPetr Skoda <commits@skodak.org>
Sun, 23 Oct 2011 18:51:39 +0000 (20:51 +0200)
enrol/database/lib.php

index 34b95a8..306f8b3 100644 (file)
@@ -174,7 +174,7 @@ class enrol_database_plugin extends enrol_plugin {
                 }
             } else {
                 $roleid = reset($roles);
-                $this->enrol_user($instance, $user->id, $roleid);
+                $this->enrol_user($instance, $user->id, $roleid, 0, 0, ENROL_USER_ACTIVE);
             }
 
             if (!$context = get_context_instance(CONTEXT_COURSE, $instance->courseid)) {
@@ -455,7 +455,7 @@ class enrol_database_plugin extends enrol_plugin {
             foreach ($requested_roles as $userid=>$userroles) {
                 foreach ($userroles as $roleid) {
                     if (empty($current_roles[$userid])) {
-                        $this->enrol_user($instance, $userid, $roleid);
+                        $this->enrol_user($instance, $userid, $roleid, 0, 0, ENROL_USER_ACTIVE);
                         $current_roles[$userid][$roleid] = $roleid;
                         $current_status[$userid] = ENROL_USER_ACTIVE;
                         if ($verbose) {