From: moodler Date: Tue, 22 Jul 2003 01:58:44 +0000 (+0000) Subject: Slightly more robust in case it can't find users. See bug 562. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c05f2f763bae8d66a4a460ecf702fcf22e3d605b;p=moodle.git Slightly more robust in case it can't find users. See bug 562. --- diff --git a/lang/en/chat.php b/lang/en/chat.php index 42d98ba571..47ce645a5a 100644 --- a/lang/en/chat.php +++ b/lang/en/chat.php @@ -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!"; diff --git a/mod/chat/users.php b/mod/chat/users.php index 83a3c1e058..9e2dd5269e 100644 --- a/mod/chat/users.php +++ b/mod/chat/users.php @@ -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 ""; foreach ($chatusers as $chatuser) { $lastping = $timenow - $chatuser->lastmessageping;