mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
Some minor improvements
This commit is contained in:
parent
1515a89e2d
commit
f7e648da70
6 changed files with 89 additions and 31 deletions
|
@ -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\">
|
||||
|
|
|
@ -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!!");
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue