diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-06-28 12:56:37 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-06-28 12:56:37 +0200 |
commit | bbcd8c9a6850ad4a55ead19c75b67a90488c6140 (patch) | |
tree | c20ba1647a9453536b953d9e9d750940b301db19 /apps/user_ldap/lib | |
parent | ac97873a179d9383c682d10e88c750c3b6a72f79 (diff) | |
download | nextcloud-server-bbcd8c9a6850ad4a55ead19c75b67a90488c6140.tar.gz nextcloud-server-bbcd8c9a6850ad4a55ead19c75b67a90488c6140.zip |
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>
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r-- | apps/user_ldap/lib/User/OfflineUser.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/user_ldap/lib/User/OfflineUser.php b/apps/user_ldap/lib/User/OfflineUser.php index 0c9e6e73ff3..4adf5302bfe 100644 --- a/apps/user_ldap/lib/User/OfflineUser.php +++ b/apps/user_ldap/lib/User/OfflineUser.php @@ -146,7 +146,8 @@ class OfflineUser { */ public function getDN() { if ($this->dn === null) { - $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 ($this->hasActiveShares === null) { - $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(); } /** |