From: skodak Date: Sun, 22 Oct 2006 19:20:02 +0000 (+0000) Subject: fixed moodle/site:readallmessages MDL-7160 ; commented out unfinished buggy code... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1ac417517e8b62faf67d68e98510cb4e811d0bf2;p=moodle.git fixed moodle/site:readallmessages MDL-7160 ; commented out unfinished buggy code; merged from MOODLE_17_STABLE --- diff --git a/message/history.php b/message/history.php index 322cf2358e..b5cd97ee96 100644 --- a/message/history.php +++ b/message/history.php @@ -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"); diff --git a/message/lib.php b/message/lib.php index 40a4798ec7..2e9f3d88f2 100644 --- a/message/lib.php +++ b/message/lib.php @@ -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 .= ''; } - +*/ include('search.html'); } } diff --git a/message/search.html b/message/search.html index 0d14aac021..472fe2d3b4 100644 --- a/message/search.html +++ b/message/search.html @@ -43,7 +43,7 @@     - +   diff --git a/message/send.php b/message/send.php index a823473a85..00eeb79408 100644 --- a/message/send.php +++ b/message/send.php @@ -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; }