print_header('', '', '', 'inputForm.chat_message', $meta, false);
?>
- <form action="../empty.php" method="GET" target="empty" name="inputForm"
+ <form action="../empty.php" method="POST" target="empty" name="inputForm"
OnSubmit="return empty_field_and_submit()">
>><input type="text" name="chat_message" size="60" value="" />
<?php helpbutton('chatting', get_string('helpchatting', 'chat'), 'chat', true, false); ?>
</form>
- <form action="insert.php" method="GET" target="empty" name="sendForm">
+ <form action="insert.php" method="POST" target="empty" name="sendForm">
<input type="hidden" name="chat_sid" value="<?php echo $chat_sid ?>" />
<input type="hidden" name="chat_message" />
</form>
error('No chat found');
}
- if (!$course = get_record('course', 'id', $chat->course)) {
+ if (!$course = get_record('course', 'id', $chat->course, '', '', '','', 'id, shortname')) {
error('Could not find the course this belongs to!');
}
$us = array ();
if (($chat_lasttime != $chat_newlasttime) and $messages) {
- if (!$currentuser = get_record('user', 'id', $chatuser->userid)) {
+ // $currentuser is only used in chat_format_message() which passes it along to
+ // chat_format_message_manually() -- and only id and timezone are used.
+ if (!$currentuser = get_record('user', 'id', $chatuser->userid, '','', '','', 'id, username, timezone')) {
error('User does not exist!');
}
$currentuser->description = '';
}
$chatuser->lastping = time();
- update_record('chat_users', $chatuser);
+ set_field('chat_users', 'lastping', $chatuser->lastping, 'sid', $chatuser->sid );
if ($refreshusers) {
echo "if (parent.users.document.anchors[0] != null) {" .