]> git.mjollnir.org Git - moodle.git/commitdiff
fixed moodle/site:readallmessages MDL-7160 ; commented out unfinished buggy code...
authorskodak <skodak>
Sun, 22 Oct 2006 19:20:02 +0000 (19:20 +0000)
committerskodak <skodak>
Sun, 22 Oct 2006 19:20:02 +0000 (19:20 +0000)
message/history.php
message/lib.php
message/search.html
message/send.php

index 322cf2358e43507eba8cc087ab8a20d0e024b762..b5cd97ee96c1d045114d6c0d27e91c3de88f310c 100644 (file)
@@ -20,7 +20,7 @@
         error("User ID 1 was incorrect");
     }
 
-    if (has_capability('moodle/site:readmessages', get_context_instance(CONTEXT_SYSTEM, SITEID))) {             // Able to see any discussion
+    if (has_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM, SITEID))) {             // Able to see any discussion
         $userid2 = optional_param('user2', $USER->id, PARAM_INT);
         if (! $user2 = get_record("user", "id", $userid2)) {  // Check
             error("User ID 2 was incorrect");
index 40a4798ec7e8cf6280b478d69d769509e70798c3..2e9f3d88f2c49bb975e7246f2390d8e30ec1b75e 100644 (file)
@@ -232,6 +232,8 @@ function message_print_search() {
         message_print_search_results($frm);
         
     } else {
+/*
+/// unfinished buggy code disabled in search.html anyway 
         // find all courses this use has readallmessages capabilities in
         if ($teachers = get_user_capability_course('moodle/site:readallmessages')) {
             $courses = get_courses('all', 'c.sortorder ASC', 'c.id, c.shortname');
@@ -241,7 +243,7 @@ function message_print_search() {
             }
             $cs .= '</select>';
         }
-        
+*/
         include('search.html');
     }
 }
index 0d14aac0216565e5efa2459d5db63383f82a7a93..472fe2d3b4ec9e0496554a27ad0768883d7c506c 100644 (file)
@@ -43,7 +43,7 @@
     <tr><td>&nbsp;</td><td colspan="2"><input type="radio" name="keywordsoption" alt="<?php print_string('onlyfromme', 'message') ?>" value="fromme" /><?php print_string('onlyfromme', 'message') ?></td></tr>
     <tr><td>&nbsp;</td><td colspan="2"><input type="radio" checked="checked" name="keywordsoption" alt="<?php print_string('allmine', 'message') ?>" value="allmine" /><?php print_string('allmine', 'message') ?></td></tr>
     
-    <?php if (has_capability('moodle/site:readmessages', get_context_instance(CONTEXT_SYSTEM, SITEID))) { ?>
+    <?php if (has_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM, SITEID))) { ?>
     <tr><td>&nbsp;</td><td colspan="2"><input type="radio" name="keywordsoption" alt="<?php print_string('allusers', 'message') ?>" value="allusers" /><?php print_string('allusers', 'message') ?></td></tr>
     <?php } ?>
 
index a823473a857b496761f568c0ebfc4a28ed6e5d7c..00eeb794084d29407ef13ea004b0e3eea9520755 100644 (file)
@@ -47,7 +47,7 @@
 
 /// Check that the user is not blocking us!!
     if ($contact = get_record('message_contacts', 'userid', $user->id, 'contactid', $USER->id)) {
-        if ($contact->blocked and !has_capability('moodle/site:readmessages', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
+        if ($contact->blocked and !has_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
             print_heading(get_string('userisblockingyou', 'message'));
             exit;
         }