--- original/user/index.php	2008-12-28 00:45:00.000000000 +0200
+++ patched/user/index.php	2009-05-01 23:04:15.000000000 +0300

@@ -19,6 +19,7 @@
 
     $contextid    = optional_param('contextid', 0, PARAM_INT);                // one of this or
     $courseid     = optional_param('id', 0, PARAM_INT);                       // this are required
+    $group        = optional_param('group', 0, PARAM_INT);
 
     if ($contextid) {
         if (! $context = get_context_instance_by_id($contextid)) {
@@ -134,7 +135,11 @@
 /// and if so, set $currentgroup to reflect the current group
 
     $groupmode    = groups_get_course_groupmode($course);   // Groups are being used
-    $currentgroup = groups_get_course_group($course, true);
+    if ($group>0) {
+      $currentgroup = $group;
+    } else {
+      $currentgroup = groups_get_course_group($course, true);
+    }
 
     if (!$currentgroup) {      // To make some other functions work better later
         $currentgroup  = NULL;
