mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 05:25:08 +02:00
Merge branch 'MDL-54928-master' of git://github.com/dpalou/moodle
This commit is contained in:
commit
88dd8edf7b
@ -43,7 +43,7 @@ class message_output_airnotifier extends message_output {
|
||||
* @return true if ok, false if error
|
||||
*/
|
||||
public function send_message($eventdata) {
|
||||
global $CFG;
|
||||
global $CFG, $DB;
|
||||
require_once($CFG->libdir . '/filelib.php');
|
||||
|
||||
if (!empty($CFG->noemailever)) {
|
||||
@ -59,6 +59,11 @@ class message_output_airnotifier extends message_output {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If username is empty we try to retrieve it, since it's required to generate the siteid.
|
||||
if (empty($eventdata->userto->username)) {
|
||||
$eventdata->userto->username = $DB->get_field('user', 'username', array('id' => $eventdata->userto->id));
|
||||
}
|
||||
|
||||
// Site id, to map with Moodle Mobile stored sites.
|
||||
$siteid = md5($CFG->wwwroot . $eventdata->userto->username);
|
||||
|
||||
|
@ -97,7 +97,7 @@ if ($data = data_submitted()) {
|
||||
if (!array_key_exists($m[2], $SESSION->emailto[$id])) {
|
||||
if ($user = $DB->get_record_select('user', "id = ?", array($m[2]), 'id, '.
|
||||
$namefields . ', idnumber, email, mailformat, lastaccess, lang, '.
|
||||
'maildisplay, auth, suspended, deleted, emailstop')) {
|
||||
'maildisplay, auth, suspended, deleted, emailstop, username')) {
|
||||
$SESSION->emailto[$id][$m[2]] = $user;
|
||||
$count++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user