]> git.mjollnir.org Git - moodle.git/commitdiff
Tidy up
authormoodler <moodler>
Fri, 31 Oct 2003 06:45:38 +0000 (06:45 +0000)
committermoodler <moodler>
Fri, 31 Oct 2003 06:45:38 +0000 (06:45 +0000)
course/user.php

index 733646e1ee0cd571cf268a306e3f06edaa155f2a..eaae9b3db26f2b88473bf52cd09c6453df977fea 100644 (file)
         error("Course id is incorrect.");
     }
 
-    if (! (isteacher($course->id) or ($course->showreports and $USER->id == $user))) {
-        error("You are not allowed to look at this page");
-    }
-
     if (! $user = get_record("user", "id", $user)) {
         error("User ID is incorrect");
     }
 
+    if (! (isteacher($course->id) or ($course->showreports and $USER->id == $user->id))) {
+        error("You are not allowed to look at this page");
+    }
+
     add_to_log($course->id, "course", "user report", "user.php?id=$course->id&user=$user->id&mode=$mode", "$user->id"); 
 
     $stractivityreport = get_string("activityreport");