[BUGFIX] Install tool: CLI user is no system maintainer 81/53981/3
authorMathias Brodala <mbrodala@pagemachine.de>
Fri, 8 Sep 2017 06:51:00 +0000 (08:51 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Fri, 8 Sep 2017 07:57:48 +0000 (09:57 +0200)
Prevent selection of _cli_ user as system maintainer.

Related: #82319
Resolves: #82367
Releases: master
Change-Id: Ia1e67faea383817d4931c956a166525e1aa9e8e0
Reviewed-on: https://review.typo3.org/53981
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/install/Classes/Controller/Action/Ajax/SystemMaintainerGetList.php

index 5caebd9..bc3ec60 100644 (file)
@@ -42,7 +42,8 @@ class SystemMaintainerGetList extends AbstractAjaxAction
             ->where(
                 $queryBuilder->expr()->andX(
                     $queryBuilder->expr()->eq('deleted', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)),
-                    $queryBuilder->expr()->eq('admin', $queryBuilder->createNamedParameter(1, \PDO::PARAM_INT))
+                    $queryBuilder->expr()->eq('admin', $queryBuilder->createNamedParameter(1, \PDO::PARAM_INT)),
+                    $queryBuilder->expr()->neq('username', $queryBuilder->createNamedParameter('_cli_', \PDO::PARAM_STR))
                 )
             )
             ->orderBy('uid')