Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Get payment managers at COURSE level.

  • Loading branch information...
commit 87753e76d1940bee753a8d4d77c057f084383b5d 1 parent 0b06840
ethem authored
Showing with 5 additions and 5 deletions.
  1. +4 −4 enrol/authorize/enrol.php
  2. +1 −1  enrol/authorize/index.php
View
8 enrol/authorize/enrol.php
@@ -221,10 +221,10 @@ function cc_submit($form, $course)
$a->course = $course->shortname;
$a->orderid = $order->id;
$emailsubject = get_string('adminnewordersubject', 'enrol_authorize', $a);
- $context = get_context_instance(CONTEXT_SYSTEM);
- if ($sitepaymentmanagers = get_users_by_capability($context, 'enrol/authorize:managepayments')) {
- foreach ($sitepaymentmanagers as $sitepaymentmanager) {
- email_to_user($sitepaymentmanager, $USER, $emailsubject, $emailmessage);
+ $context = get_context_instance(CONTEXT_COURSE, $course->id);
+ if ($paymentmanagers = get_users_by_capability($context, 'enrol/authorize:managepayments')) {
+ foreach ($paymentmanagers as $paymentmanager) {
+ email_to_user($paymentmanager, $USER, $emailsubject, $emailmessage);
}
}
redirect($CFG->wwwroot, get_string("reviewnotify", "enrol_authorize"), '30');
View
2  enrol/authorize/index.php
@@ -12,7 +12,7 @@
/// Only site users can access to this page
require_login(); // Don't use $courseid! User may want to see old orders.
- if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM, SITEID), $USER->id, false)) {
+ if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), $USER->id, false)) {
error("Guests cannot use this page.");
}
Please sign in to comment.
Something went wrong with that request. Please try again.