Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Get course before require_login();

  • Loading branch information...
commit 84f7bcc8ee8deb2b95906c80aca6d5ebaf8b04a5 1 parent 362c2fd
authored November 12, 2006

Showing 1 changed file with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. 11  enrol/authorize/index.php
11  enrol/authorize/index.php
@@ -9,6 +9,11 @@
9 9
     $courseid = optional_param('course', SITEID, PARAM_INT);
10 10
     $userid   = optional_param('user', 0, PARAM_INT);
11 11
 
  12
+/// Get course
  13
+    if (!$course = get_record('course', 'id', $courseid)) {
  14
+        error('Could not find that course');
  15
+    }
  16
+
12 17
 /// Only site users can access to this page
13 18
     require_login(); // Don't use $courseid! User may want to see old orders.
14 19
 
@@ -25,11 +30,7 @@
25 30
 
26 31
 /// Print header
27 32
     $strpaymentmanagement = get_string('paymentmanagement', 'enrol_authorize');
28  
-    if (!$course = get_record('course', 'id', $courseid)) {
29  
-        error('Could not find that course');
30  
-    }
31  
-    print_header_simple("$strpaymentmanagement", "", "<a href=\"index.php\">$strpaymentmanagement</a>");
32  
-
  33
+    print_header_simple($strpaymentmanagement, "", "<a href=\"index.php\">$strpaymentmanagement</a>");
33 34
 
34 35
 /// If orderid is empty, user wants to see all orders
35 36
     if (empty($orderid)) {

0 notes on commit 84f7bcc

Please sign in to comment.
Something went wrong with that request. Please try again.