Commit 28fc80f6 authored by Ghada El-Zoghbi's avatar Ghada El-Zoghbi

Bug 1830302: Check if site is set for isolated institutions

When sending a message to another user, the check was
assuming that the site is set up as an isolated
institution and ignoring the user preference for
messages.

Sponsored by The Australian National University

behatnotneeded

Change-Id: I52936cd153336580146a9ac3eaf6e150a0e3affb
parent 8fc0ba1e
......@@ -1835,12 +1835,14 @@ function can_send_message($from, $to) {
$cansend = true;
}
// Can send message if the 'isolatedinstitutions' is set and both users are from the same institution
try {
isolatedinstitution_access($to, $from->id);
$cansend = true;
}
catch (AccessDeniedException $e) {
$cansend = false;
if (is_isolated()) {
try {
isolatedinstitution_access($to, $from->id);
$cansend = true;
}
catch (AccessDeniedException $e) {
$cansend = false;
}
}
return $cansend;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment