diff --git a/lib/private/User/User.php b/lib/private/User/User.php index c5306d1df273c..7f7d6273e306b 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -244,10 +244,15 @@ public function getLastLogin() { * updates the timestamp of the most recent login of this user */ public function updateLastLoginTimestamp() { - $firstTimeLogin = ($this->getLastLogin() === 0); - $this->lastLogin = time(); - $this->config->setUserValue( - $this->uid, 'login', 'lastLogin', (string)$this->lastLogin); + $previousLogin = $this->getLastLogin(); + $now = time(); + $firstTimeLogin = $previousLogin === 0; + + if ($now - $previousLogin > 60) { + $this->lastLogin = time(); + $this->config->setUserValue( + $this->uid, 'login', 'lastLogin', (string)$this->lastLogin); + } return $firstTimeLogin; }