Skip to content

Commit

Permalink
MDL-75010 core: Prevent user last access update on user key login
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden committed Oct 31, 2022
1 parent 98fd15d commit 4d36e00
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/datalib.php
Expand Up @@ -1592,6 +1592,11 @@ function user_accesstime_log($courseid=0) {
return;
}

if (defined('USER_KEY_LOGIN') && USER_KEY_LOGIN === true) {
// Do not update user login time when using user key login.
return;
}

if (empty($courseid)) {
$courseid = SITEID;
}
Expand Down
5 changes: 5 additions & 0 deletions lib/moodlelib.php
Expand Up @@ -3379,6 +3379,11 @@ function update_user_login_times() {
return true;
}

if (defined('USER_KEY_LOGIN') && USER_KEY_LOGIN === true) {
// Do not update user login time when using user key login.
return true;
}

$now = time();

$user = new stdClass();
Expand Down

0 comments on commit 4d36e00

Please sign in to comment.