Skip to content

Commit

Permalink
Merged fix for MDL-10732 from stable
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Aug 6, 2007
1 parent 5c5085b commit 6200420
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion message/send.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,24 @@
exit;
}
}
if (get_user_preferences('message_blocknoncontacts', 0, $user->id)) { // User is blocking non-contacts
$userpreferences = get_user_preferences(NULL, NULL, $user->id);

if (!empty($userpreferences['message_blocknoncontacts'])) { // User is blocking non-contacts
if (empty($contact)) { // We are not a contact!
print_heading(get_string('userisblockingyounoncontact', 'message'));
exit;
}
}

/// Make sure the receiving user has preferences
if (!isset($userpreferences['message_showmessagewindow'])) { // User has not used messaging before
set_user_preference('message_showmessagewindow', 1, $user->id);
set_user_preference('message_emailmessages', 1, $user->id);
set_user_preference('message_emailtimenosee', 10, $user->id);
set_user_preference('message_emailaddress', $user->email, $user->id);
}


if ($message!='' and confirm_sesskey()) { /// Current user has just sent a message

/// Save it to the database...
Expand Down

0 comments on commit 6200420

Please sign in to comment.