Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a message if the student is not a member of the current course

  • Loading branch information...
commit 8a3b358be974dc47d4d6d841c8c39170f7019d06 1 parent 18798c6
martin authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 user/view.php
7 user/view.php
View
@@ -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) {
@@ -33,6 +34,12 @@
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>";
Please sign in to comment.
Something went wrong with that request. Please try again.