aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/User/LazyUser.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/User/LazyUser.php')
-rw-r--r--lib/private/User/LazyUser.php33
1 files changed, 28 insertions, 5 deletions
diff --git a/lib/private/User/LazyUser.php b/lib/private/User/LazyUser.php
index 80b2bfe510f..501169019d4 100644
--- a/lib/private/User/LazyUser.php
+++ b/lib/private/User/LazyUser.php
@@ -36,9 +36,12 @@ class LazyUser implements IUser {
$this->user = $this->userManager->get($this->uid);
}
}
- /** @var IUser */
- $user = $this->user;
- return $user;
+
+ if ($this->user === null) {
+ throw new NoUserException('User not found in backend');
+ }
+
+ return $this->user;
}
public function getUID() {
@@ -57,11 +60,15 @@ class LazyUser implements IUser {
return $this->getUser()->setDisplayName($displayName);
}
- public function getLastLogin() {
+ public function getLastLogin(): int {
return $this->getUser()->getLastLogin();
}
- public function updateLastLoginTimestamp() {
+ public function getFirstLogin(): int {
+ return $this->getUser()->getFirstLogin();
+ }
+
+ public function updateLastLoginTimestamp(): bool {
return $this->getUser()->updateLastLoginTimestamp();
}
@@ -73,6 +80,14 @@ class LazyUser implements IUser {
return $this->getUser()->setPassword($password, $recoveryPassword);
}
+ public function getPasswordHash(): ?string {
+ return $this->getUser()->getPasswordHash();
+ }
+
+ public function setPasswordHash(string $passwordHash): bool {
+ return $this->getUser()->setPasswordHash($passwordHash);
+ }
+
public function getHome() {
return $this->getUser()->getHome();
}
@@ -97,6 +112,10 @@ class LazyUser implements IUser {
return $this->getUser()->canChangeDisplayName();
}
+ public function canChangeEmail(): bool {
+ return $this->getUser()->canChangeEmail();
+ }
+
public function isEnabled() {
return $this->getUser()->isEnabled();
}
@@ -141,6 +160,10 @@ class LazyUser implements IUser {
return $this->getUser()->getQuota();
}
+ public function getQuotaBytes(): int|float {
+ return $this->getUser()->getQuotaBytes();
+ }
+
public function setQuota($quota) {
$this->getUser()->setQuota($quota);
}