diff --git a/course/user.php b/course/user.php
index 214c97e1ab5..bb2f5b5fe7b 100644
--- a/course/user.php
+++ b/course/user.php
@@ -5,27 +5,26 @@
require_once("../config.php");
require_once("lib.php");
+ $modes = array("outline", "complete", "todaylogs", "alllogs");
+
require_variable($id); // course id
require_variable($user); // user id
optional_variable($mode, "outline");
- $modes = array("outline", "complete", "todaylogs", "alllogs");
+ require_login();
if (! $course = get_record("course", "id", $id)) {
error("Course id is incorrect.");
}
- require_login($course->id);
+ if (!isteacher($course->id)) {
+ 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) 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");
@@ -49,17 +48,18 @@
}
print_heading("$user->firstname $user->lastname");
- echo "
";
- echo "| Reports: | ";
+ echo "";
+ echo "
";
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);