]> git.mjollnir.org Git - moodle.git/commitdiff
Now, in SEPARATE groups courses, a user cannot access to the info about users
authorstronk7 <stronk7>
Tue, 9 Mar 2004 23:07:35 +0000 (23:07 +0000)
committerstronk7 <stronk7>
Tue, 9 Mar 2004 23:07:35 +0000 (23:07 +0000)
in other groups.

Please check !!

user/view.php

index 5f1aad0cc4549a00cfb8069a826b3989ed778da1..64bd305db6d897d308e4534b8b3de8dae063b376 100644 (file)
     $personalprofile = get_string("personalprofile");
     $participants = get_string("participants");
 
+    $groupmode = groupmode($course);
+
+    if ($groupmode and !isteacheredit($course->id)) {   // Groups must be kept separate
+        if ($groupmode == SEPARATEGROUPS) {
+            require_login();
+
+            if (!ismember($USER->groupmember[$course->id], $user->id)) {
+                print_header("$personalprofile: ", "$personalprofile: ",
+                             "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> ->
+                              <a href=\"index.php?id=$course->id\">$participants</a>",
+                              "", "", true, "&nbsp;", navmenu($course));
+                print_heading("Sorry, you can't see this user because you are not in his group");
+                print_footer();
+                die;
+            }
+
+        }
+    }
+
     if ($course->category) {
         print_header("$personalprofile: $fullname", "$personalprofile: $fullname", 
                      "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> ->