From be1af5b770fa1f053e51c9d292edcc450bf0f02c Mon Sep 17 00:00:00 2001
From: mark-nielsen <mark-nielsen>
Date: Sat, 29 Apr 2006 07:37:52 +0000
Subject: [PATCH] Moved the require login and isteacher checks to infront of
 the form data processing

---
 mod/lesson/report.php | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/mod/lesson/report.php b/mod/lesson/report.php
index 43ed1973731..7c8969531fc 100644
--- a/mod/lesson/report.php
+++ b/mod/lesson/report.php
@@ -32,6 +32,13 @@
                                  ORDER BY u.lastname")) {
         $nothingtodisplay = true;
     }
+    
+// make sure people are where they should be
+    require_login($course->id, false);
+
+    if (!isteacher($course->id)) {
+        error("Must be teacher to view Reports");
+    }
 
 /// Process any form data before fetching attempts, grades and times
     if ($form = data_submitted()) {
@@ -90,13 +97,6 @@
         $times = array();
     }
 
-// make sure people are where they should be
-    require_login($course->id, false);
-
-    if (!isteacher($course->id)) {
-        error("Must be teacher to view Reports");
-    }
-
 /// Print the page header
     $strlessons = get_string('modulenameplural', 'lesson');