diff --git a/typo3/sysext/beuser/Classes/Controller/BackendUserController.php b/typo3/sysext/beuser/Classes/Controller/BackendUserController.php index fd45767b4f366252f1fcfa38728211bf1e7bdb12..b8f19cf3f7817fcd1edb0d32a743ebcc9f72573b 100644 --- a/typo3/sysext/beuser/Classes/Controller/BackendUserController.php +++ b/typo3/sysext/beuser/Classes/Controller/BackendUserController.php @@ -240,8 +240,8 @@ class BackendUserController extends ActionController if (!$user || !$user->isPasswordResetEnabled() || !$context->getAspect('backend.user')->isAdmin()) { // Add an error message $this->addFlashMessage( - LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:flashMessage.resetPassword.error.text', 'beuser'), - LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:flashMessage.resetPassword.error.title', 'beuser'), + LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:flashMessage.resetPassword.error.text', 'beuser') ?? '', + LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:flashMessage.resetPassword.error.title', 'beuser') ?? '', FlashMessage::ERROR ); } else { @@ -251,8 +251,8 @@ class BackendUserController extends ActionController $user->getEmail() ); $this->addFlashMessage( - LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:flashMessage.resetPassword.success.text', 'beuser', [$user->getEmail()]), - LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:flashMessage.resetPassword.success.title', 'beuser'), + LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:flashMessage.resetPassword.success.text', 'beuser', [$user->getEmail()]) ?? '', + LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:flashMessage.resetPassword.success.title', 'beuser') ?? '', FlashMessage::OK ); } @@ -313,7 +313,7 @@ class BackendUserController extends ActionController $success = $sessionBackend->remove($sessionId); if ($success) { - $this->addFlashMessage(LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:terminateSessionSuccess', 'beuser')); + $this->addFlashMessage(LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:terminateSessionSuccess', 'beuser') ?? ''); } $this->forward('online'); } @@ -321,7 +321,7 @@ class BackendUserController extends ActionController /** * Switches to a given user (SU-mode) and then redirects to the start page of the backend to refresh the navigation etc. * - * @param string $switchUser BE-user record that will be switched to + * @param int $switchUser BE-user record that will be switched to */ protected function switchUser($switchUser) { @@ -358,7 +358,7 @@ class BackendUserController extends ActionController $event = new SwitchUserEvent( $this->getBackendUserAuthentication()->getSessionId(), $targetUser, - $this->getBackendUserAuthentication()->user + (array)$this->getBackendUserAuthentication()->user ); $this->eventDispatcher->dispatch($event); diff --git a/typo3/sysext/beuser/Classes/Controller/BackendUserGroupController.php b/typo3/sysext/beuser/Classes/Controller/BackendUserGroupController.php index 8ad8af5e61c2cf355e3c4ef48412670b8af3d02d..ad052d9b1e49efb0538159db89150c925b446cb0 100644 --- a/typo3/sysext/beuser/Classes/Controller/BackendUserGroupController.php +++ b/typo3/sysext/beuser/Classes/Controller/BackendUserGroupController.php @@ -15,6 +15,7 @@ namespace TYPO3\CMS\Beuser\Controller; +use TYPO3\CMS\Beuser\Domain\Model\BackendUserGroup; use TYPO3\CMS\Beuser\Domain\Repository\BackendUserGroupRepository; use TYPO3\CMS\Beuser\Service\UserInformationService; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; @@ -22,6 +23,7 @@ use TYPO3\CMS\Core\Pagination\SimplePagination; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Pagination\QueryResultPaginator; +use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; /** * Backend module user group administration controller @@ -59,6 +61,7 @@ class BackendUserGroupController extends ActionController */ public function indexAction(int $currentPage = 1): void { + /** @var QueryResultInterface<int, BackendUserGroup> $backendUsers */ $backendUsers = $this->backendUserGroupRepository->findAll(); $paginator = new QueryResultPaginator($backendUsers, $currentPage, 50); $pagination = new SimplePagination($paginator); diff --git a/typo3/sysext/beuser/Classes/Controller/PermissionAjaxController.php b/typo3/sysext/beuser/Classes/Controller/PermissionAjaxController.php index 1c639364948c4db9c629841370d4bf286d225fd4..f8eace3fa86bcb51d031359f844b1f5246dae003 100644 --- a/typo3/sysext/beuser/Classes/Controller/PermissionAjaxController.php +++ b/typo3/sysext/beuser/Classes/Controller/PermissionAjaxController.php @@ -281,7 +281,7 @@ class PermissionAjaxController * Print the string with the new edit lock state of a page record * * @param int $page The TYPO3 page id - * @param string $editLockState The state of the TYPO3 page (locked, unlocked) + * @param int $editLockState The state of the TYPO3 page (locked, unlocked) * @return string The new edit lock string wrapped in HTML */ protected function renderToggleEditLock($page, $editLockState) diff --git a/typo3/sysext/beuser/Classes/Controller/PermissionController.php b/typo3/sysext/beuser/Classes/Controller/PermissionController.php index 26744f75793d1ca3cefd9949e380b93855a553ef..90686d945f55f0d3699840fbcb478ade38931f35 100644 --- a/typo3/sysext/beuser/Classes/Controller/PermissionController.php +++ b/typo3/sysext/beuser/Classes/Controller/PermissionController.php @@ -194,8 +194,8 @@ class PermissionController extends ActionController if ($this->getBackendUser()->workspace != 0) { // Adding section with the permission setting matrix: $this->addFlashMessage( - LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarningText', 'beuser'), - LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarning', 'beuser'), + LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarningText', 'beuser') ?? '', + LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarning', 'beuser') ?? '', FlashMessage::WARNING ); } @@ -245,7 +245,7 @@ class PermissionController extends ActionController $this->view->assign('viewTree', $tree->tree); // CSH for permissions setting - $this->view->assign('cshItem', BackendUtility::cshItem('xMOD_csh_corebe', 'perm_module', null, '<span class="btn btn-default btn-sm">|</span>')); + $this->view->assign('cshItem', BackendUtility::cshItem('xMOD_csh_corebe', 'perm_module', '', '<span class="btn btn-default btn-sm">|</span>')); } /** @@ -262,8 +262,8 @@ class PermissionController extends ActionController if ($this->getBackendUser()->workspace != 0) { // Adding FlashMessage with the permission setting matrix: $this->addFlashMessage( - LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarningText', 'beuser'), - LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarning', 'beuser'), + LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarningText', 'beuser') ?? '', + LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarning', 'beuser') ?? '', FlashMessage::WARNING ); } diff --git a/typo3/sysext/beuser/Classes/Service/UserInformationService.php b/typo3/sysext/beuser/Classes/Service/UserInformationService.php index 83a666892a166d7f0350d3de493fb2af28e71d20..faab0380b771bb8cca7596672b97d9448b492a48 100644 --- a/typo3/sysext/beuser/Classes/Service/UserInformationService.php +++ b/typo3/sysext/beuser/Classes/Service/UserInformationService.php @@ -112,7 +112,7 @@ class UserInformationService $data['groups']['diff'] = array_diff($data['groups']['inherit'], $data['groups']['direct']); foreach ($data['groups'] as $type => $groups) { foreach ($groups as $key => $id) { - $record = BackendUtility::getRecord('be_groups', $id); + $record = BackendUtility::getRecord('be_groups', (int)$id); if ($record) { $data['groups']['all'][$record['uid']]['row'] = $record; $data['groups']['all'][$record['uid']][$type] = 1; @@ -124,7 +124,7 @@ class UserInformationService $languages = GeneralUtility::trimExplode(',', $user->dataLists['allowed_languages'], true); asort($languages); foreach ($languages as $language) { - $record = BackendUtility::getRecord('sys_language', $language); + $record = BackendUtility::getRecord('sys_language', (int)$language); if ($record) { $data['languages'][$language] = $record; } @@ -145,7 +145,7 @@ class UserInformationService $dbMounts = GeneralUtility::trimExplode(',', $user->dataLists['webmount_list'], true); asort($dbMounts); foreach ($dbMounts as $mount) { - $record = BackendUtility::getRecord('pages', $mount); + $record = BackendUtility::getRecord('pages', (int)$mount); if ($record) { $data['dbMounts'][] = $record; } @@ -155,7 +155,7 @@ class UserInformationService $fileMounts = GeneralUtility::trimExplode(',', $user->dataLists['filemount_list'], true); asort($fileMounts); foreach ($fileMounts as $mount) { - $record = BackendUtility::getRecord('sys_filemounts', $mount); + $record = BackendUtility::getRecord('sys_filemounts', (int)$mount); if ($record) { $data['fileMounts'][] = $record; } diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/PermissionsViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/PermissionsViewHelper.php index 37f0f19e79b7fc2d71c3b265a62fec75a7016cf5..76bd0e0396265f7bedb4bb543c743649a2804a98 100644 --- a/typo3/sysext/beuser/Classes/ViewHelpers/PermissionsViewHelper.php +++ b/typo3/sysext/beuser/Classes/ViewHelpers/PermissionsViewHelper.php @@ -93,7 +93,7 @@ class PermissionsViewHelper extends AbstractViewHelper . ' data-page="' . htmlspecialchars($arguments['pageId']) . '"' . ' data-permissions="' . htmlspecialchars($arguments['permission']) . '"' . ' data-who="' . htmlspecialchars($arguments['scope']) . '"' - . ' data-bits="' . htmlspecialchars($mask) . '"' + . ' data-bits="' . htmlspecialchars((string)$mask) . '"' . ' data-mode="' . htmlspecialchars($mode) . '"' . ' class="t3-icon btn-clear change-permission fa ' . htmlspecialchars($permissionClass) . '"></button>'; } diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/SwitchUserViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/SwitchUserViewHelper.php index c2077230a0aa554bb73141d39735a3f3d4e95296..1467875c63c78c324d2318e186e5657fc5ba9916 100644 --- a/typo3/sysext/beuser/Classes/ViewHelpers/SwitchUserViewHelper.php +++ b/typo3/sysext/beuser/Classes/ViewHelpers/SwitchUserViewHelper.php @@ -63,7 +63,7 @@ class SwitchUserViewHelper extends AbstractViewHelper if ($backendUser->getUid() == $GLOBALS['BE_USER']->user['uid'] || !$backendUser->isActive() || $GLOBALS['BE_USER']->user['ses_backuserid']) { return '<span class="btn btn-default disabled">' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render() . '</span>'; } - $title = LocalizationUtility::translate('switchBackMode', 'beuser'); + $title = LocalizationUtility::translate('switchBackMode', 'beuser') ?? ''; return '<a class="btn btn-default" href="' . htmlspecialchars(GeneralUtility::linkThisScript(['SwitchUser' => $backendUser->getUid()])) . '" target="_top" title="' . htmlspecialchars($title) . '">' .