|
|
|
@ -655,6 +655,7 @@ class SystemAnnouncementManager |
|
|
|
|
|
|
|
|
|
$title = api_html_entity_decode(stripslashes($title), ENT_QUOTES, $charset); |
|
|
|
|
$content = api_html_entity_decode(stripslashes(str_replace(array('\r\n', '\n', '\r'),'', $content)), ENT_QUOTES, $charset); |
|
|
|
|
$now = api_get_utc_datetime(); |
|
|
|
|
|
|
|
|
|
if ($sendEmailTest) { |
|
|
|
|
MessageManager::send_message_simple(api_get_user_id(), $title, $content); |
|
|
|
@ -691,6 +692,9 @@ class SystemAnnouncementManager |
|
|
|
|
// Sent to active users. |
|
|
|
|
$sql .= " AND email <>'' AND active = 1 "; |
|
|
|
|
|
|
|
|
|
// Expiration date |
|
|
|
|
$sql .= " AND (expiration_date = '' OR expiration_date IS NULL OR expiration_date > '$now') "; |
|
|
|
|
|
|
|
|
|
if ((empty($teacher) or $teacher == '0') AND (empty($student) or $student == '0')) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|