]> git.mjollnir.org Git - moodle.git/commitdiff
Added a message if the student is not a member of the current course
authormartin <martin>
Tue, 4 Jun 2002 06:49:52 +0000 (06:49 +0000)
committermartin <martin>
Tue, 4 Jun 2002 06:49:52 +0000 (06:49 +0000)
user/view.php

index e78c2eaf1a705102be6b743dca17b13e187b07df..63903d2edaec7a9d507392c9ab02037dfa824b7f 100644 (file)
@@ -23,6 +23,7 @@
 
     $fullname = "$user->firstname $user->lastname";
 
+
     add_to_log($course->id, "user", "view", "view.php?id=$user->id&course=$course->id", "$user->id");
 
     if ($course->category) {
         print_header("Personal profile: $fullname", "Personal profile: $fullname", "$fullname", "");
     }
 
+    if (!isstudent($course->id, $user->id) && !isteacher($course->id, $user->id)) {
+        print_heading("$fullname is not enrolled in this course");
+        print_footer($course);
+        die;
+    }
+
 
     echo "<TABLE WIDTH=80% ALIGN=CENTER BORDER=0 CELLPADDING=1 CELLSPACING=1><TR><TD BGCOLOR=#888888>";
     echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=3 CELLSPACING=0><TR>";