Browse Source

Remove event triggering, it is already done by the enrol_user method

SABERES_37_STABLE
Johannes Burk 9 years ago
committed by test
parent
commit
d44a738a17
  1. 12
      lib.php

12
lib.php

@ -79,18 +79,6 @@ class enrol_apply_plugin extends enrol_plugin {
$DB->insert_record('enrol_apply_applicationinfo', $applicationinfo, false); $DB->insert_record('enrol_apply_applicationinfo', $applicationinfo, false);
$this->sendConfirmMailToTeachers($instance, $data, $applydescription); $this->sendConfirmMailToTeachers($instance, $data, $applydescription);
$this->sendConfirmMailToManagers($instance, $data, $applydescription); $this->sendConfirmMailToManagers($instance, $data, $applydescription);
// Deprecated fixed by Shiro <gigashiro@gmail.com>
//add_to_log($instance->courseid, 'course', 'enrol', '../enrol/users.php?id='.$instance->courseid, $instance->courseid); //there should be userid somewhere!
$context = context_course::instance($instance->courseid);
\core\event\user_enrolment_created::create(
array(
'objectid' => $instance->id,
'courseid' => $instance->courseid,
'context' => $context,
'relateduserid' => $USER->id,
'other' => array('enrol' => 'apply')
))->trigger();
redirect("$CFG->wwwroot/course/view.php?id=$instance->courseid"); redirect("$CFG->wwwroot/course/view.php?id=$instance->courseid");
} }

Loading…
Cancel
Save