Permalink
Browse files

Get course before require_login();

  • Loading branch information...
1 parent 362c2fd commit 84f7bcc8ee8deb2b95906c80aca6d5ebaf8b04a5 ethem committed Nov 12, 2006
Showing with 6 additions and 5 deletions.
  1. +6 −5 enrol/authorize/index.php
View
11 enrol/authorize/index.php
@@ -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.
@@ -25,11 +30,7 @@
/// Print header
$strpaymentmanagement = get_string('paymentmanagement', 'enrol_authorize');
- if (!$course = get_record('course', 'id', $courseid)) {
- error('Could not find that course');
- }
- print_header_simple("$strpaymentmanagement", "", "<a href=\"index.php\">$strpaymentmanagement</a>");
-
+ print_header_simple($strpaymentmanagement, "", "<a href=\"index.php\">$strpaymentmanagement</a>");
/// If orderid is empty, user wants to see all orders
if (empty($orderid)) {

0 comments on commit 84f7bcc

Please sign in to comment.