MDL-39628 Chat: check mod/chat:chat capability when using daemon.
authorDan Marsden <dan@danmarsden.com>
Sun, 12 May 2013 22:41:27 +0000 (10:41 +1200)
committerDamyon Wiese <damyon@moodle.com>
Tue, 2 Jul 2013 04:23:31 +0000 (12:23 +0800)
Thanks to Francois Gauthier for report/fix.

mod/chat/gui_sockets/index.php

index ab3d83b..228454d 100644 (file)
@@ -27,9 +27,7 @@ if (!$cm = get_coursemodule_from_instance('chat', $chat->id, $course->id)) {
 require_login($course, false, $cm);
 $context = get_context_instance(CONTEXT_MODULE, $cm->id);
 
-if (isguestuser()) {
-    print_error('noguests', 'chat');
-}
+require_capability('mod/chat:chat', $context);
 
 /// Check to see if groups are being used here
  if ($groupmode = groups_get_activity_groupmode($cm)) {   // Groups are being used