]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes when displaying lists of users in group mode
authormoodler <moodler>
Thu, 8 Apr 2004 15:12:35 +0000 (15:12 +0000)
committermoodler <moodler>
Thu, 8 Apr 2004 15:12:35 +0000 (15:12 +0000)
mod/chat/gui_header_js/index.php
mod/chat/lib.php
mod/chat/users.php
mod/chat/view.php

index 32b55b6c5ed494a792943f6a153c3f60c8138b7a..82e69f2bfe44613747b3372813f01852c6dd3b11 100644 (file)
@@ -4,7 +4,7 @@
     require_once('../lib.php');
 
     require_variable($id);
-    optional_variable($groupid);
+    optional_variable($groupid, -1);
 
     if (!$chat = get_record("chat", "id", $id)) {
         error("Could not find that chat room!");
@@ -39,7 +39,7 @@
         $groupname = '';
     }
 
-    if (!$chat_sid = chat_login_user($chat->id, "header_js")) {
+    if (!$chat_sid = chat_login_user($chat->id, "header_js", $currentgroup)) {
         error("Could not log in to chat room!!");
     }
 
index c6a77bb5d8793a712495cddcbeed4298a106b04c..ed2ec9cfc1976c79f44b89b4582c8dddc52a4499 100644 (file)
@@ -239,11 +239,12 @@ function chat_get_latest_message($chatid, $groupid=0) {
 
 //////////////////////////////////////////////////////////////////////
 
-function chat_login_user($chatid, $version="header_js") {
+function chat_login_user($chatid, $version="header_js", $groupid=0) {
     global $USER;
 
     $chatuser->chatid   = $chatid;
     $chatuser->userid   = $USER->id;
+    $chatuser->groupid  = $groupid;
     $chatuser->version  = $version;
     $chatuser->ip       = $USER->lastIP;
     $chatuser->lastping = $chatuser->firstping = $chatuser->lastmessageping = time();
index 5f9088c1e68797798078a927e211922d4eb5b8f7..bf65c944c00950159ba6d5147e6ba0fc76bf030a 100644 (file)
@@ -64,7 +64,7 @@ header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
 header("Cache-Control: no-cache, must-revalidate");
 header("Pragma: no-cache");
 header("Content-Type: text/html");
-header("Refresh: $CFG->chat_refresh_userlist; URL=users.php?chat_sid=$chat_sid");
+header("Refresh: $CFG->chat_refresh_userlist; URL=users.php?chat_sid=$chat_sid&groupid=$groupid");
 
 print_header();
 
index f457c0dc12d02c5905f0df0a71ed25197e787709..e137d915b888ad0ebf4b7823bee7d1a1a3cdd366 100644 (file)
@@ -75,7 +75,7 @@
 
     if ($currentgroup) {
         $groupselect = " AND groupid = '$currentgroup'";
-        $groupparam = "&group=$currentgroup";
+        $groupparam = "&groupid=$currentgroup";
     } else {
         $groupselect = "";
         $groupparam = "";