From 8a3b358be974dc47d4d6d841c8c39170f7019d06 Mon Sep 17 00:00:00 2001
From: martin <martin>
Date: Tue, 4 Jun 2002 06:49:52 +0000
Subject: [PATCH] Added a message if the student is not a member of the current
 course

---
 user/view.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/user/view.php b/user/view.php
index e78c2eaf1a..63903d2eda 100644
--- a/user/view.php
+++ b/user/view.php
@@ -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>";
-- 
2.39.5