setName("ot:users:enfeedit") ->setDescription("Enable front-end editing for all be-users"); } /** * -- This method is expected by Typo3, do not rename ou remove -- * * Executes the command for creating the new organization * * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable('be_users'); $queryBuilder->getRestrictions()->removeAll(); $statement = $queryBuilder ->select('be_users.*') ->from('be_users') ->where( $queryBuilder->expr()->eq('be_users.usergroup', $queryBuilder->createNamedParameter(3, \PDO::PARAM_INT)) ) ->execute() ; while ($row = $statement->fetch()) { $id = (int)$row['uid']; $BE_USER = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication'); $user = $BE_USER->getRawUserByUid($id); $BE_USER->user = $user; $BE_USER->backendSetUC(); $BE_USER->uc['frontend_editing'] = 1; $BE_USER->writeUC($BE_USER->uc); } $io->success(sprintf("-- done --")); } }