Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix undefined method getExtStorageHome()
- adds a type check
- defines missing method in OfflineUser

Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz authored and skjnldsv committed Jan 18, 2024
commit fd5a22044bf3f99a63b01ac74e8343e22b325695
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