summaryrefslogtreecommitdiffstats
path: root/lib/private/user/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/user/user.php')
-rw-r--r--lib/private/user/user.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/private/user/user.php b/lib/private/user/user.php
index 8aba7188e24..82f02e0f2b5 100644
--- a/lib/private/user/user.php
+++ b/lib/private/user/user.php
@@ -53,6 +53,11 @@ class User {
private $config;
/**
+ * @var int $home
+ */
+ private $lastLogin;
+
+ /**
* @param string $uid
* @param \OC_User_Interface $backend
* @param \OC\Hooks\Emitter $emitter
@@ -243,4 +248,19 @@ class User {
$this->config->setUserValue($this->uid, 'core', 'enabled', $enabled);
}
}
+
+ /**
+ * returns the timestamp of the user's last login or 0 if the user did never
+ * login
+ *
+ * @return int
+ */
+ public function getLastLogin() {
+ return $this->lastLogin;
+ }
+
+ public function updateLastLogin() {
+ $this->lastLogin = time();
+ \OC_Preferences::setValue($this->uid, 'login', 'lastLogin', $this->lastLogin);
+ }
}