Get payment managers at COURSE level. Merged from 17stable.
This commit is contained in:
@@ -231,10 +231,10 @@ class enrolment_plugin_authorize
|
||||
$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');
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user