]> source.dussan.org Git - nextcloud-server.git/commitdiff
LDAP: determine shares of offline users only when needed 27703/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Mon, 28 Jun 2021 10:56:37 +0000 (12:56 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Mon, 28 Jun 2021 21:57:29 +0000 (23:57 +0200)
- 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>
apps/user_ldap/lib/User/OfflineUser.php

index e55df4e8c1cb87dd719af1842d593bfa5cdd4246..71a86e9783624779feef583b1154da4905ffdcf6 100644 (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();
        }
 
        /**