]> git.mjollnir.org Git - moodle.git/commitdiff
Slightly more robust in case it can't find users. See bug 562.
authormoodler <moodler>
Tue, 22 Jul 2003 01:58:44 +0000 (01:58 +0000)
committermoodler <moodler>
Tue, 22 Jul 2003 01:58:44 +0000 (01:58 +0000)
lang/en/chat.php
mod/chat/users.php

index 42d98ba571bd90b24d8fd87b7d68ae1e1141207c..47ce645a5acb482e55cfd88fbaf21ad8d17c5504 100644 (file)
@@ -12,6 +12,7 @@ $string['chatreport'] = "Chat sessions";
 $string['currentchats'] = "Active chat sessions";
 $string['currentusers'] = "Current users";
 $string['enterchat'] = "Click here to enter the chat";
+$string['errornousers'] = "Could not find any users!";
 $string['idle'] = "Idle";
 $string['messagebeepseveryone'] = "\$a beeps everyone!";
 $string['messagebeepsyou'] = "\$a has just beeped you!";
index 83a3c1e058ef632b597cd40a1cef28d2e707e11a..9e2dd5269ed0a03203d09d37a6cc8f85492b28c1 100644 (file)
@@ -53,13 +53,6 @@ if (isset($_GET['beep'])) {
 
 chat_delete_old_users();
 
-/// Get list of users
-
-if (!$chatusers = chat_get_users($chatuser->chatid)) {
-    error("Could not find any users!");
-}
-
 
 /// Print headers
 
@@ -85,6 +78,14 @@ $str->mins  = get_string("mins");
 $str->sec   = get_string("sec");
 $str->secs  = get_string("secs");
 
+/// Get list of users
+
+if (!$chatusers = chat_get_users($chatuser->chatid)) {
+    print_string("errornousers");
+    exit;
+}
+
+
 echo "<table width=\"100%\">";
 foreach ($chatusers as $chatuser) {
     $lastping = $timenow - $chatuser->lastmessageping;