From bbcd8c9a6850ad4a55ead19c75b67a90488c6140 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 28 Jun 2021 12:56:37 +0200 Subject: 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 --- apps/user_ldap/lib/User/OfflineUser.php | 10 +++------- 1 file 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(); } /** -- cgit v1.2.3