Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-34591 - paypal does not allow unenrol

  • Loading branch information...
commit 7c3f70812e1b67d6c6a6629a7cc1050e50f9243c 1 parent 0b7c52d
@grabs grabs authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 enrol/paypal/lib.php
View
19 enrol/paypal/lib.php
@@ -207,4 +207,23 @@ function enrol_page_hook(stdClass $instance) {
return $OUTPUT->box(ob_get_clean());
}
+ /**
+ * Gets an array of the user enrolment actions
+ *
+ * @param course_enrolment_manager $manager
+ * @param stdClass $ue A user enrolment object
+ * @return array An array of user_enrolment_actions
+ */
+ public function get_user_enrolment_actions(course_enrolment_manager $manager, $ue) {
+ $actions = array();
+ $context = $manager->get_context();
+ $instance = $ue->enrolmentinstance;
+ $params = $manager->get_moodlepage()->url->params();
+ $params['ue'] = $ue->id;
+ if ($this->allow_unenrol($instance) && has_capability("enrol/paypal:unenrol", $context)) {
+ $url = new moodle_url('/enrol/unenroluser.php', $params);
+ $actions[] = new user_enrolment_action(new pix_icon('t/delete', ''), get_string('unenrol', 'enrol'), $url, array('class'=>'unenrollink', 'rel'=>$ue->id));
+ }
+ return $actions;
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.