"MDL-14460, fix all the other get_context_instance,(use sed replace them), see tracker"
This commit is contained in:
@@ -93,7 +93,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:readallmessages', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
|
||||
if ($contact->blocked and !has_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM))) {
|
||||
print_heading(get_string('userisblockingyou', 'message'));
|
||||
exit;
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
error("User ID 1 was incorrect");
|
||||
}
|
||||
|
||||
if (has_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM, SITEID))) { // Able to see any discussion
|
||||
if (has_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM))) { // 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");
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
<tr><td> </td><td colspan="2"><input type="radio" name="keywordsoption" id="keywordsoption2" value="fromme" /><label for="keywordsoption2"><?php print_string('onlyfromme', 'message') ?></label></td></tr>
|
||||
<tr><td> </td><td colspan="2"><input type="radio" checked="checked" name="keywordsoption" id="keywordsoption3" value="allmine" /><label for="keywordsoption3"><?php print_string('allmine', 'message') ?></label></td></tr>
|
||||
|
||||
<?php if (has_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM, SITEID))) { ?>
|
||||
<?php if (has_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM))) { ?>
|
||||
<tr><td> </td><td colspan="2"><input type="radio" name="keywordsoption" id="keywordsoption4" value="allusers" /><label for="keywordsoption4"><?php print_string('allusers', 'message') ?></label></td></tr>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ if (has_capability('moodle/site:sendmessage', get_context_instance(CONTEXT_SYSTE
|
||||
|
||||
/// 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:readallmessages', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
|
||||
if ($contact->blocked and !has_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM))) {
|
||||
print_heading(get_string('userisblockingyou', 'message'));
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user