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 <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2021-06-28 12:56:37 +02:00
parent c4a20d3d5d
commit de3aa22057
No known key found for this signature in database
GPG key ID: 7424F1874854DF23

View file

@ -146,7 +146,8 @@ class OfflineUser {
*/
public function getDN() {
if (!isset($this->dn)) {
$this->fetchDetails();
$dn = $this->mapping->getDNByName($this->ocName);
$this->dn = ($dn !== false) ? $dn : '';
}
return $this->dn;
}
@ -212,7 +213,7 @@ class OfflineUser {
*/
public function getHasActiveShares() {
if (!isset($this->hasActiveShares)) {
$this->fetchDetails();
$this->determineShares();
}
return $this->hasActiveShares;
}
@ -232,11 +233,6 @@ class OfflineUser {
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();
}
/**