Skip to content

Commit

Permalink
enrol MDL-19795 Upgraded deprecate function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
samhemelryk committed Oct 16, 2009
1 parent 928d473 commit 6e08d1f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion enrol/paypal/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ function print_entry($course) {
$strloginto = get_string("loginto", "", $course->shortname);
$strcourses = get_string("courses");

$teacher = get_teacher($course->id);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
// Pass $view=true to filter hidden caps if the user cannot see them
if ($users = get_users_by_capability($context, 'moodle/course:update', 'u.*', 'u.id ASC',
'', '', '', '', false, true)) {
$users = sort_by_roleassignment_authority($users, $context);
$teacher = array_shift($users);
} else {
$teacher = false;
}

if ( (float) $course->cost < 0 ) {
$cost = (float) $CFG->enrol_cost;
Expand Down
10 changes: 9 additions & 1 deletion enrol/paypal/ipn.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,15 @@
message_paypal_error_to_admin("Error while trying to enrol ".fullname($user)." in '$course->fullname'", $data);
die;
} else {
$teacher = get_teacher($course->id);
// Pass $view=true to filter hidden caps if the user cannot see them
if ($users = get_users_by_capability($context, 'moodle/course:update', 'u.*', 'u.id ASC',
'', '', '', '', false, true)) {
$users = sort_by_roleassignment_authority($users, $context);
$teacher = array_shift($users);
} else {
$teacher = false;
}


if (!empty($CFG->enrol_mailstudents)) {
$a->coursename = $course->fullname;
Expand Down

0 comments on commit 6e08d1f

Please sign in to comment.