Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

We are expecting multiple records!

  • Loading branch information...
commit 8d137d3be6272988e7b248ac540339f5262564d4 1 parent 766b192
ethem authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 enrol/authorize/localfuncs.php
View
8 enrol/authorize/localfuncs.php
@@ -31,9 +31,7 @@ function prevent_double_paid($course)
{
global $CFG, $SESSION, $USER;
- $sql = "SELECT id FROM {$CFG->prefix}enrol_authorize
- WHERE userid = $USER->id
- AND courseid = $course->id ";
+ $sql = "SELECT id FROM {$CFG->prefix}enrol_authorize WHERE userid = '$USER->id' AND courseid = '$course->id' ";
if (empty($CFG->an_test)) { // Real mode
$sql .= 'AND status IN('.AN_STATUS_AUTH.','.AN_STATUS_UNDERREVIEW.','.AN_STATUS_APPROVEDREVIEW.')';
@@ -42,9 +40,9 @@ function prevent_double_paid($course)
$sql .= 'AND status='.AN_STATUS_NONE;
}
- if ($rec = get_record_sql($sql)) {
+ if ($recid = get_field_sql($sql)) {
$a = new stdClass;
- $a->orderid = $rec->id;
+ $a->orderid = $recid;
$a->url = "$CFG->wwwroot/enrol/authorize/index.php?order=$a->orderid";
redirect($a->url, get_string("paymentpending", "enrol_authorize", $a), '10');
return;
Please sign in to comment.
Something went wrong with that request. Please try again.