From: moodler Date: Mon, 3 Nov 2003 10:22:24 +0000 (+0000) Subject: Keep guests out of chat X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=315915628d70e91b87c50fd119f5452c8e307358;p=moodle.git Keep guests out of chat --- diff --git a/mod/chat/gui_header_js/index.php b/mod/chat/gui_header_js/index.php index f19e37b4be..c74eac2de0 100644 --- a/mod/chat/gui_header_js/index.php +++ b/mod/chat/gui_header_js/index.php @@ -15,6 +15,10 @@ if (!$course = get_record("course", "id", $chat->course)) { require_login($course->id); +if (isguest()) { + error("Guest does not have access to chat rooms"); +} + if (!$chat_sid = chat_login_user($chat->id, "header_js")) { error("Could not log in to chat room!!"); } diff --git a/mod/chat/report.php b/mod/chat/report.php index 3a64c0629b..1581dc2db4 100644 --- a/mod/chat/report.php +++ b/mod/chat/report.php @@ -21,8 +21,8 @@ require_login($course->id); - if (!isteacher($course->id) and !$chat->studentlogs) { - error("Only teachers are allowed to view these chat reports"); + if (isguest() or (!isteacher($course->id) and !$chat->studentlogs)) { + error("You can not view these chat reports"); } add_to_log($course->id, "chat", "view", "view.php?id=$cm->id", "$chat->id"); diff --git a/mod/chat/view.php b/mod/chat/view.php index b55c125783..4cea37c128 100644 --- a/mod/chat/view.php +++ b/mod/chat/view.php @@ -59,7 +59,7 @@ "", "", true, update_module_button($cm->id, $course->id, $strchat), navmenu($course, $cm)); - if ($chat->studentlogs or isteacher($course->id)) { + if (($chat->studentlogs or isteacher($course->id)) and !isguest()) { echo "

id\">". get_string("viewreport", "chat")."

"; } @@ -86,10 +86,12 @@ print_heading($chat->name); - print_simple_box_start("center"); - link_to_popup_window ("/mod/chat/gui_$chatversion/index.php?id=$chat->id", - "chat$course->id$chat->id", "$strenterchat", 500, 700, $strchat); - print_simple_box_end(); + if (!isguest()) { + print_simple_box_start("center"); + link_to_popup_window ("/mod/chat/gui_$chatversion/index.php?id=$chat->id", + "chat$course->id$chat->id", "$strenterchat", 500, 700, $strchat); + print_simple_box_end(); + } if ($chat->chattime and $chat->schedule) { // A chat is scheduled