Skip to content

Commit

Permalink
Merge pull request #46612 from nextcloud/backport/42892/stable24
Browse files Browse the repository at this point in the history
[stable24] fix undefined method getExtStorageHome()
  • Loading branch information
blizzz authored Jul 31, 2024
2 parents 3270933 + bfacdd3 commit 0d67331
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/user_ldap/lib/Handler/ExtStorageConfigHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function handle($optionValue) {
}

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

return $this->processInput($optionValue, $extHome);
}
Expand Down
9 changes: 9 additions & 0 deletions apps/user_ldap/lib/User/OfflineUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -207,6 +208,13 @@ public function getDetectedOn() {
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
Expand All @@ -227,6 +235,7 @@ protected function fetchDetails() {
'uid' => 'user_ldap',
'homePath' => 'user_ldap',
'foundDeleted' => 'user_ldap',
'extStorageHome' => 'user_ldap',
'email' => 'settings',
'lastLogin' => 'login',
];
Expand Down

0 comments on commit 0d67331

Please sign in to comment.