Skip to content

Commit 28df133

Browse files
authored
Merge pull request #42925 from nextcloud/backport/37346/stable26
[stable26] fix undefined method getExtStorageHome()
2 parents c9b69b4 + fd5a220 commit 28df133

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

apps/user_ldap/lib/Handler/ExtStorageConfigHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function handle($optionValue) {
6262
}
6363

6464
$ldapUser = $access->userManager->get($user->getUID());
65-
$extHome = $ldapUser->getExtStorageHome();
65+
$extHome = $ldapUser !== null ? $ldapUser->getExtStorageHome() : '';
6666

6767
return $this->processInput($optionValue, $extHome);
6868
}

apps/user_ldap/lib/User/OfflineUser.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class OfflineUser {
6060
* @var string $foundDeleted the timestamp when the user was detected as unavailable
6161
*/
6262
protected $foundDeleted;
63+
protected ?string $extStorageHome = null;
6364
/**
6465
* @var string $email
6566
*/
@@ -207,6 +208,13 @@ public function getDetectedOn() {
207208
return (int)$this->foundDeleted;
208209
}
209210

211+
public function getExtStorageHome(): string {
212+
if ($this->extStorageHome === null) {
213+
$this->fetchDetails();
214+
}
215+
return (string)$this->extStorageHome;
216+
}
217+
210218
/**
211219
* getter for having active shares
212220
* @return bool
@@ -227,6 +235,7 @@ protected function fetchDetails() {
227235
'uid' => 'user_ldap',
228236
'homePath' => 'user_ldap',
229237
'foundDeleted' => 'user_ldap',
238+
'extStorageHome' => 'user_ldap',
230239
'email' => 'settings',
231240
'lastLogin' => 'login',
232241
];

0 commit comments

Comments
 (0)