MDL-25174 adding a workaround for old passwords that were hashed with magic quotes
authorPetr Skoda <skodak@moodle.org>
Fri, 12 Nov 2010 10:13:40 +0000 (10:13 +0000)
committerPetr Skoda <skodak@moodle.org>
Fri, 12 Nov 2010 10:13:40 +0000 (10:13 +0000)
lib/grouplib.php

index e9895d1..5eaf108 100644 (file)
@@ -409,7 +409,7 @@ function groups_print_course_menu($course, $urlroot, $return=false) {
 
     $context = get_context_instance(CONTEXT_COURSE, $course->id);
     if ($groupmode == VISIBLEGROUPS or has_capability('moodle/site:accessallgroups', $context)) {
-        $allowedgroups = groups_get_all_groups($course->id, 0);
+        $allowedgroups = groups_get_all_groups($course->id, 0, $course->defaultgroupingid);
         // detect changes related to groups and fix active group
         if (!empty($SESSION->activegroup[$course->id][VISIBLEGROUPS][0])) {
             if (!array_key_exists($SESSION->activegroup[$course->id][VISIBLEGROUPS][0], $allowedgroups)) {
@@ -425,7 +425,7 @@ function groups_print_course_menu($course, $urlroot, $return=false) {
         }
 
     } else {
-        $allowedgroups = groups_get_all_groups($course->id, $USER->id);
+        $allowedgroups = groups_get_all_groups($course->id, $USER->id, $course->defaultgroupingid);
         // detect changes related to groups and fix active group
         if (isset($SESSION->activegroup[$course->id][SEPARATEGROUPS][0])) {
             if ($SESSION->activegroup[$course->id][SEPARATEGROUPS][0] == 0) {