Skip to content
Merged
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
LDAP: determine shares of offline users only when needed
- determine shares may via Sharing code result in user exists checks
- this may result in an infinite loop when user exists was called before
- the info is really only required at one occ command

Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz committed Jun 28, 2021
commit bbcd8c9a6850ad4a55ead19c75b67a90488c6140
10 changes: 3 additions & 7 deletions apps/user_ldap/lib/User/OfflineUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ public function getUID() {
*/
public function getDN() {
if ($this->dn === null) {
$this->fetchDetails();
$dn = $this->mapping->getDNByName($this->ocName);
$this->dn = ($dn !== false) ? $dn : '';
}
return $this->dn;
}
Expand Down Expand Up @@ -212,7 +213,7 @@ public function getDetectedOn() {
*/
public function getHasActiveShares() {
if ($this->hasActiveShares === null) {
$this->fetchDetails();
$this->determineShares();
}
return $this->hasActiveShares;
}
Expand All @@ -232,11 +233,6 @@ protected function fetchDetails() {
foreach ($properties as $property => $app) {
$this->$property = $this->config->getUserValue($this->ocName, $app, $property, '');
}

$dn = $this->mapping->getDNByName($this->ocName);
$this->dn = ($dn !== false) ? $dn : '';

$this->determineShares();
}

/**
Expand Down