[TASK] Suppress mount point resolving if there are none 90/58290/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 16 Sep 2018 08:03:31 +0000 (10:03 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 18 Sep 2018 19:07:25 +0000 (21:07 +0200)
BE admins without mountpoints set have value '0' in
$this->groupData['webmounts']. If this is checked additonally
to empty string, some 'where uid=0' database calls can be suppressed.

Resolves: #86272
Releases: master
Change-Id: I4142034c3d3fac3c9319649fd39200da7955a8db
Reviewed-on: https://review.typo3.org/58290
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php

index 97e34ba..efe1f08 100644 (file)
@@ -1433,11 +1433,10 @@ class BackendUserAuthentication extends AbstractUserAuthentication
             $this->groupData['file_permissions'] = GeneralUtility::uniqueList($this->dataLists['file_permissions']);
             $this->groupData['workspace_perms'] = $this->dataLists['workspace_perms'];
 
-            // Checking read access to webmounts:
-            if (trim($this->groupData['webmounts']) !== '') {
+            if (!empty(trim($this->groupData['webmounts']))) {
+                // Checking read access to web mounts if there are mounts points (not empty string, false or 0)
                 $webmounts = explode(',', $this->groupData['webmounts']);
-                // Explode mounts
-                // Selecting all webmounts with permission clause for reading
+                // Selecting all web mounts with permission clause for reading
                 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages');
                 $queryBuilder->getRestrictions()
                     ->removeAll()