mirror of
https://github.com/moodle/moodle.git
synced 2025-01-30 03:58:34 +01:00
Merge branch 'MDL-81991-404-alt' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE
This commit is contained in:
commit
ba80f884f7
@ -979,6 +979,15 @@ function get_user_accessdata($userid, $preloadonly=false) {
|
||||
$ACCESSLIB_PRIVATE->accessdatabyuser[$USER->id] = $USER->access;
|
||||
}
|
||||
|
||||
// Unfortunately, we can't use the $ACCESSLIB_PRIVATE->dirtyusers array because it is not available in CLI.
|
||||
// So we need to check if the user has been marked as dirty or not in the cache directly.
|
||||
// This will add additional queries to the database, but it is the best we can do.
|
||||
if (CLI_SCRIPT && !empty($ACCESSLIB_PRIVATE->accessdatabyuser[$userid])) {
|
||||
if (get_cache_flag('accesslib/dirtyusers', $userid, $ACCESSLIB_PRIVATE->accessdatabyuser[$userid]['time'])) {
|
||||
unset($ACCESSLIB_PRIVATE->accessdatabyuser[$userid]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($ACCESSLIB_PRIVATE->accessdatabyuser[$userid])) {
|
||||
if (empty($userid)) {
|
||||
if (!empty($CFG->notloggedinroleid)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user