]> git.mjollnir.org Git - moodle.git/commitdiff
Users were able to see their own user activity reports. This was a hang-over
authormoodler <moodler>
Sat, 24 May 2003 07:33:22 +0000 (07:33 +0000)
committermoodler <moodler>
Sat, 24 May 2003 07:33:22 +0000 (07:33 +0000)
from long time ago.  As there is no GUI for this, I'm removing it for now so
that students are not able to see their own activity reports.

This issue probably needs to be discussed, and a GUI developed for it.

course/user.php

index 214c97e1ab5617e1fe5ad9f5a2e29ee4306754d9..bb2f5b5fe7ba82b4e5d1422c77d2193ad594a67f 100644 (file)
@@ -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");
     }
     print_heading("$user->firstname $user->lastname");
 
-    echo "<TABLE CELLPADDING=10 ALIGN=CENTER><TR>";
-    echo "<TD>Reports: </TD>";
+    echo "<table cellpadding=10 align=center><tr>";
+    echo "<td>reports: </td>";
+
     foreach ($modes as $listmode) {
         $strmode = get_string($listmode);
         if ($mode == $listmode) {
-            echo "<TD><U>$strmode</U></TD>";
+            echo "<td><u>$strmode</u></td>";
         } else {
-            echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=$listmode>$strmode</A></TD>";
+            echo "<td><a href=user.php?id=$course->id&user=$user->id&mode=$listmode>$strmode</a></td>";
         }
     }
-    echo "</TR></TABLE>";
+    echo "</tr></table>";
 
     get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);