Index: report.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/chat/report.php,v
retrieving revision 1.42
diff -c -r1.42 report.php
*** report.php	8 Jun 2008 15:49:36 -0000	1.42
--- report.php	17 Jun 2008 08:47:16 -0000
***************
*** 24,30 ****
      $context = get_context_instance(CONTEXT_MODULE, $cm->id);
      require_login($course->id, false, $cm);
  
!     require_capability('mod/chat:readlog', $context); 
  
      add_to_log($course->id, 'chat', 'report', "report.php?id=$cm->id", $chat->id, $cm->id);
  
--- 24,30 ----
      $context = get_context_instance(CONTEXT_MODULE, $cm->id);
      require_login($course->id, false, $cm);
  
!     require_capability('mod/chat:readlog', $context);
  
      add_to_log($course->id, 'chat', 'report', "report.php?id=$cm->id", $chat->id, $cm->id);
  
***************
*** 35,41 ****
      $strdeletesession = get_string('deletesession', 'chat');
  
      $navlinks = array();
!     
  /// Print a session if one has been specified
  
      if ($start and $end and !$confirmdelete) {   // Show a full transcript
--- 35,41 ----
      $strdeletesession = get_string('deletesession', 'chat');
  
      $navlinks = array();
! 
  /// Print a session if one has been specified
  
      if ($start and $end and !$confirmdelete) {   // Show a full transcript
***************
*** 62,70 ****
                           "report.php?id=$cm->id");
          }
  
!         if (!$messages = $DB->get_records_select('chat_messages', "chatid = :chatid AND
!                                                                    timestamp >= :start AND
!                                                                    timestamp <= :end $groupselect", "timestamp ASC", $params)) {
              print_heading(get_string('nomessages', 'chat'));
  
          } else {
--- 62,68 ----
                           "report.php?id=$cm->id");
          }
  
!         if (!$messages = $DB->get_records_select('chat_messages', "chatid = :chatid AND timestamp >= :start AND timestamp <= :end $groupselect", $params, "timestamp ASC")) {
              print_heading(get_string('nomessages', 'chat'));
  
          } else {
