"MDL-14129, fix print_error"
This commit is contained in:
@@ -17,6 +17,7 @@ $string['blocknoncontacts'] = 'Block all new messages from people who are not on
|
||||
$string['contactlistempty'] = 'Your contact list is currently empty';
|
||||
$string['contacts'] = 'Contacts';
|
||||
$string['context'] = 'context';
|
||||
$string['disabled'] = 'Messaging is disabled on this site';
|
||||
$string['deletemessagesdays'] = 'Number of days before old messages are automatically deleted';
|
||||
$string['discussion'] = 'Discussion';
|
||||
$string['emailmessages'] = 'Email messages when I am offline';
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
}
|
||||
|
||||
if (empty($CFG->messaging)) {
|
||||
print_error("Messaging is disabled on this site");
|
||||
print_error('disabled', 'message');
|
||||
}
|
||||
|
||||
/// Script parameters
|
||||
|
||||
+3
-3
@@ -11,19 +11,19 @@
|
||||
}
|
||||
|
||||
if (empty($CFG->messaging)) {
|
||||
print_error("Messaging is disabled on this site");
|
||||
print_error('disabled', 'message');
|
||||
}
|
||||
|
||||
/// Script parameters
|
||||
$userid1 = required_param('user1', PARAM_INT);
|
||||
if (! $user1 = $DB->get_record("user", array("id"=>$userid1))) { // Check it's correct
|
||||
print_error("User ID 1 was incorrect");
|
||||
print_error('invaliduserid');
|
||||
}
|
||||
|
||||
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 = $DB->get_record("user", array("id"=>$userid2))) { // Check
|
||||
print_error("User ID 2 was incorrect");
|
||||
print_error('invaliduserid');
|
||||
}
|
||||
} else {
|
||||
$userid2 = $USER->id; // Can only see messages involving yourself
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
}
|
||||
|
||||
if (empty($CFG->messaging)) {
|
||||
print_error("Messaging is disabled on this site");
|
||||
print_error('disabled', 'message');
|
||||
}
|
||||
|
||||
/// Optional variables that may be passed in
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
}
|
||||
|
||||
if (empty($CFG->messaging)) {
|
||||
print_error("Messaging is disabled on this site");
|
||||
print_error('disabled', 'message');
|
||||
}
|
||||
|
||||
/// Script parameters
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ if (isguest()) {
|
||||
}
|
||||
|
||||
if (empty($CFG->messaging)) {
|
||||
print_error("Messaging is disabled on this site");
|
||||
print_error('disabled', 'message');
|
||||
}
|
||||
|
||||
if (has_capability('moodle/site:sendmessage', get_context_instance(CONTEXT_SYSTEM))) {
|
||||
@@ -51,7 +51,7 @@ if (has_capability('moodle/site:sendmessage', get_context_instance(CONTEXT_SYSTE
|
||||
|
||||
/// Check the user we are talking to is valid
|
||||
if (! $user = $DB->get_record('user', array('id'=>$userid))) {
|
||||
print_error("User ID was incorrect");
|
||||
print_error('invaliduserid');
|
||||
}
|
||||
|
||||
/// Check that the user is not blocking us!!
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@
|
||||
}
|
||||
|
||||
if (empty($CFG->messaging)) {
|
||||
print_error("Messaging is disabled on this site");
|
||||
print_error('disabled', 'message');
|
||||
}
|
||||
|
||||
/// Script parameters
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
/// Check the user we are talking to is valid
|
||||
if (! $user = $DB->get_record('user', array('id'=>$userid))) {
|
||||
print_error("User ID was incorrect");
|
||||
print_error('invaliduserid');
|
||||
}
|
||||
|
||||
/// Possibly change some contacts if requested
|
||||
|
||||
Reference in New Issue
Block a user