mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-41999 fix setting of USER in chat
This commit is contained in:
parent
5fed843324
commit
92911ef1b8
3 changed files with 6 additions and 7 deletions
|
@ -29,10 +29,10 @@ if (!$course = $DB->get_record('course', array('id'=>$chatuser->course))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the user theme and enough info to be used in chat_format_message() which passes it along to
|
//Get the user theme and enough info to be used in chat_format_message() which passes it along to
|
||||||
if (!$USER = $DB->get_record('user', array('id'=>$chatuser->userid))) { // no optimisation here, it would break again in future!
|
if (!$user = $DB->get_record('user', array('id'=>$chatuser->userid, 'deleted'=>0, 'suspended'=>0))) { // no optimisation here, it would break again in future!
|
||||||
print_error('invaliduser');
|
print_error('invaliduser');
|
||||||
}
|
}
|
||||||
$USER->description = '';
|
\core\session\manager::set_user($user);
|
||||||
|
|
||||||
//Setup course, lang and theme
|
//Setup course, lang and theme
|
||||||
$PAGE->set_course($course);
|
$PAGE->set_course($course);
|
||||||
|
|
|
@ -55,10 +55,10 @@ if (!$course = $DB->get_record('course', array('id'=>$chatuser->course))) {
|
||||||
|
|
||||||
//Get the user theme and enough info to be used in chat_format_message() which passes it along to
|
//Get the user theme and enough info to be used in chat_format_message() which passes it along to
|
||||||
// chat_format_message_manually() -- and only id and timezone are used.
|
// chat_format_message_manually() -- and only id and timezone are used.
|
||||||
if (!$USER = $DB->get_record('user', array('id'=>$chatuser->userid))) { // no optimisation here, it would break again in future!
|
if (!$user = $DB->get_record('user', array('id'=>$chatuser->userid, 'deleted'=>0, 'suspended'=>0))) { // no optimisation here, it would break again in future!
|
||||||
print_error('invaliduser');
|
print_error('invaliduser');
|
||||||
}
|
}
|
||||||
$USER->description = '';
|
\core\session\manager::set_user($user);
|
||||||
|
|
||||||
//Setup course, lang and theme
|
//Setup course, lang and theme
|
||||||
$PAGE->set_course($course);
|
$PAGE->set_course($course);
|
||||||
|
|
|
@ -21,14 +21,13 @@ if (!$course = $DB->get_record('course', array('id'=>$chatuser->course))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the user theme and enough info to be used in chat_format_message() which passes it along to
|
//Get the user theme and enough info to be used in chat_format_message() which passes it along to
|
||||||
if (!$USER = $DB->get_record('user', array('id'=>$chatuser->userid))) { // no optimisation here, it would break again in future!
|
if (!$user = $DB->get_record('user', array('id'=>$chatuser->userid, 'deleted'=>0, 'suspended'=>0))) { // no optimisation here, it would break again in future!
|
||||||
print_error('invaliduser');
|
print_error('invaliduser');
|
||||||
}
|
}
|
||||||
|
\core\session\manager::set_user($user);
|
||||||
|
|
||||||
$PAGE->set_pagelayout('embedded');
|
$PAGE->set_pagelayout('embedded');
|
||||||
|
|
||||||
$USER->description = '';
|
|
||||||
|
|
||||||
//Setup course, lang and theme
|
//Setup course, lang and theme
|
||||||
$PAGE->set_course($course);
|
$PAGE->set_course($course);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue