Some minor improvements

This commit is contained in:
moodler 2003-07-07 09:45:08 +00:00
parent 1515a89e2d
commit f7e648da70
6 changed files with 89 additions and 31 deletions

View file

@ -3,10 +3,19 @@
require("../../../config.php");
require("../lib.php");
require_variable($chat_sid);
if (!$chatuser = get_record("chat_users", "sid", $chat_sid)) {
echo "Not logged in!";
die;
}
if (!$chat = get_record("chat", "id", $chatuser->chatid)) {
error("No chat found");
}
require_login($chat->course);
?>
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">

View file

@ -13,6 +13,8 @@ if (!$course = get_record("course", "id", $chat->course)) {
error("Could not find the course this belongs to!");
}
require_login($course->id);
if (!$chat_sid = chat_login_user($chat->id, "header_js")) {
error("Could not log in to chat room!!");
}

View file

@ -5,8 +5,16 @@ require("../lib.php");
if (!$chatuser = get_record("chat_users", "sid", $chat_sid)) {
echo "Not logged in!";
die;
}
if (!$chat = get_record("chat", "id", $chatuser->chatid)) {
error("No chat found");
}
require_login($chat->course);
if ($message = chat_get_latest_message($chatuser->chatid)) {
$chat_newlasttime = $message->timestamp;
} else {