]> git.mjollnir.org Git - moodle.git/commitdiff
Get course before require_login(); Merged from 17stable.
authorethem <ethem>
Sun, 12 Nov 2006 13:26:14 +0000 (13:26 +0000)
committerethem <ethem>
Sun, 12 Nov 2006 13:26:14 +0000 (13:26 +0000)
enrol/authorize/index.php

index 1336641908ae1aa76a7effbff94aa7f7149c888c..552cfba5ec0c10f4ca5a789df302f1ace5888263 100644 (file)
@@ -9,6 +9,11 @@
     $courseid = optional_param('course', SITEID, PARAM_INT);
     $userid   = optional_param('user', 0, PARAM_INT);
 
+/// Get course
+    if (! $course = get_record('course', 'id', $courseid)) {
+        error('Could not find that course');
+    }
+
 /// Only site users can access to this page
     require_login(); // Don't use $courseid! User may want to see old orders.
 
         error("Guests cannot use this page.");
     }
 
-    if (! $course = get_record('course', 'id', $courseid)) {
-        error('Could not find that course');
-    }
-
 /// Load strings. All strings should be defined here. locallib.php uses these strings.
     $strs = get_strings(array('search','status','action','time','course','confirm','no','all','none','error'));
     $authstrs = get_strings(array('orderid','nameoncard','echeckfirslasttname','void','capture','refund','delete',
@@ -30,9 +31,9 @@
 
 /// Print header
     $strpaymentmanagement = get_string('paymentmanagement', 'enrol_authorize');
-    print_header_simple("$strpaymentmanagement", "", "<a href=\"index.php\">$strpaymentmanagement</a>");
+    print_header_simple($strpaymentmanagement, "", "<a href=\"index.php\">$strpaymentmanagement</a>");
 
-/// If orderid is empty, print orders
+/// If orderid is empty, user wants to see all orders
     if (empty($orderid)) {
         authorize_print_orders($courseid, $userid);
     } else {