MDL-35257 lib: if $CFG->logguests is disabled, avoid some log actions

This is for performance, else there can be great contention on the guest
user record as we've seen on moodle.org.
This commit is contained in:
Dan Poltawski
2012-09-07 10:25:59 +08:00
parent 555112a5ca
commit 879c7655f2
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -3201,6 +3201,11 @@ function get_user_key($script, $userid, $instance=null, $iprestriction=null, $va
function update_user_login_times() {
global $USER, $DB;
if (isguestuser()) {
// Do not update guest access times/ips for performance.
return true;
}
$now = time();
$user = new stdClass();