MDL-51431 enrol_flatfile: Fix for startdate when updating users

This commit is contained in:
Andrew Hancox 2015-09-16 10:49:18 +01:00
parent f495510548
commit 7fca67ee29

View File

@ -446,7 +446,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
$notify = false;
if ($ue = $DB->get_record('user_enrolments', array('enrolid'=>$instance->id, 'userid'=>$user->id))) {
// Update only.
$this->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, $roleid, $timestart, $timeend);
$this->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, $timestart, $timeend);
if (!$DB->record_exists('role_assignments', array('contextid'=>$context->id, 'roleid'=>$roleid, 'userid'=>$user->id, 'component'=>'enrol_flatfile', 'itemid'=>$instance->id))) {
role_assign($roleid, $user->id, $context->id, 'enrol_flatfile', $instance->id);
}