summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-03-22 13:54:27 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2024-01-18 11:32:04 +0100
commitfd5a22044bf3f99a63b01ac74e8343e22b325695 (patch)
treea750527f1931a6dfc1568373992aca977457c579 /apps/user_ldap
parent568ac734bba776bcdf5db54b9eac39bbcb2c049b (diff)
downloadnextcloud-server-fd5a22044bf3f99a63b01ac74e8343e22b325695.tar.gz
nextcloud-server-fd5a22044bf3f99a63b01ac74e8343e22b325695.zip
fix undefined method getExtStorageHome()
- adds a type check - defines missing method in OfflineUser Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/Handler/ExtStorageConfigHandler.php2
-rw-r--r--apps/user_ldap/lib/User/OfflineUser.php9
2 files changed, 10 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/Handler/ExtStorageConfigHandler.php b/apps/user_ldap/lib/Handler/ExtStorageConfigHandler.php
index 0d3c5b8f3f3..6f2a1007c16 100644
--- a/apps/user_ldap/lib/Handler/ExtStorageConfigHandler.php
+++ b/apps/user_ldap/lib/Handler/ExtStorageConfigHandler.php
@@ -62,7 +62,7 @@ class ExtStorageConfigHandler extends UserContext implements IConfigHandler {
}
$ldapUser = $access->userManager->get($user->getUID());
- $extHome = $ldapUser->getExtStorageHome();
+ $extHome = $ldapUser !== null ? $ldapUser->getExtStorageHome() : '';
return $this->processInput($optionValue, $extHome);
}
diff --git a/apps/user_ldap/lib/User/OfflineUser.php b/apps/user_ldap/lib/User/OfflineUser.php
index 4adf5302bfe..6801a21a1d2 100644
--- a/apps/user_ldap/lib/User/OfflineUser.php
+++ b/apps/user_ldap/lib/User/OfflineUser.php
@@ -60,6 +60,7 @@ class OfflineUser {
* @var string $foundDeleted the timestamp when the user was detected as unavailable
*/
protected $foundDeleted;
+ protected ?string $extStorageHome = null;
/**
* @var string $email
*/
@@ -207,6 +208,13 @@ class OfflineUser {
return (int)$this->foundDeleted;
}
+ public function getExtStorageHome(): string {
+ if ($this->extStorageHome === null) {
+ $this->fetchDetails();
+ }
+ return (string)$this->extStorageHome;
+ }
+
/**
* getter for having active shares
* @return bool
@@ -227,6 +235,7 @@ class OfflineUser {
'uid' => 'user_ldap',
'homePath' => 'user_ldap',
'foundDeleted' => 'user_ldap',
+ 'extStorageHome' => 'user_ldap',
'email' => 'settings',
'lastLogin' => 'login',
];