2 namespace TYPO3\CMS\Beuser\Controller;
95 $this->moduleData = $this->moduleDataStorageService->loadModuleData();
98 parent::processRequest($request, $response);
99 $this->moduleDataStorageService->persistModuleData($this->moduleData);
100 }
catch (\TYPO3\CMS\Extbase\Mvc\
Exception\StopActionException $e) {
101 $this->moduleDataStorageService->persistModuleData($this->moduleData);
119 if (empty($this->settings)) {
120 throw new \RuntimeException(
'No settings detected. This module can not work then. This usually happens if there is no frontend TypoScript template with root flag set. ' .
'Please create a frontend page with a TypoScript root template.', 1344375003);
131 public function indexAction(\TYPO3\CMS\Beuser\Domain\Model\Demand $demand = null)
133 if ($demand === null) {
134 $demand = $this->moduleData->getDemand();
136 $this->moduleData->setDemand($demand);
140 if ($switchUser > 0) {
143 $compareUserList = $this->moduleData->getCompareUserList();
146 $onlineUsers = $this->backendUserSessionRepository->findAllActive();
147 $onlineBackendUsers = array();
148 if (is_array($onlineUsers)) {
149 foreach ($onlineUsers as $onlineUser) {
150 $onlineBackendUsers[$onlineUser[
'ses_userid']] =
true;
153 $this->view->assign(
'onlineBackendUsers', $onlineBackendUsers);
155 $this->view->assign(
'demand', $demand);
156 $this->view->assign(
'returnUrl', rawurlencode(BackendUtility::getModuleUrl(
'system_BeuserTxBeuser')));
157 $this->view->assign(
'dateFormat',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'ddmmyy']);
158 $this->view->assign(
'timeFormat',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'hhmm']);
159 $this->view->assign(
'backendUsers', $this->backendUserRepository->findDemanded($demand));
160 $this->view->assign(
'backendUserGroups', array_merge(array(
''), $this->backendUserGroupRepository->findAll()->toArray()));
161 $this->view->assign(
'compareUserList', !empty($compareUserList) ? $this->backendUserRepository->findByUidList($compareUserList) :
'');
171 $onlineUsersAndSessions = array();
172 $onlineUsers = $this->backendUserRepository->findOnline();
173 foreach ($onlineUsers as $onlineUser) {
174 $onlineUsersAndSessions[] = array(
175 'backendUser' => $onlineUser,
176 'sessions' => $this->backendUserSessionRepository->findByBackendUser($onlineUser)
179 $this->view->assign(
'dateFormat',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'ddmmyy']);
180 $this->view->assign(
'timeFormat',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'hhmm']);
181 $this->view->assign(
'onlineUsersAndSessions', $onlineUsersAndSessions);
192 $compareUserList = $this->moduleData->getCompareUserList();
193 $this->view->assign(
'dateFormat',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'ddmmyy']);
194 $this->view->assign(
'timeFormat',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'hhmm']);
195 $this->view->assign(
'compareUserList', !empty($compareUserList) ? $this->backendUserRepository->findByUidList($compareUserList) :
'');
206 $this->moduleData->attachUidCompareUser($uid);
207 $this->moduleDataStorageService->persistModuleData($this->moduleData);
219 $this->moduleData->detachUidCompareUser($uid);
220 $this->moduleDataStorageService->persistModuleData($this->moduleData);
236 'ses_userid = "' . (
int)$backendUser->getUid() .
'" AND ses_id = ' . $this->
getDatabaseConnection()->fullQuoteStr($sessionId,
'be_sessions') .
' LIMIT 1'
252 $targetUser = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord(
'be_users', $switchUser);
254 $updateData[
'ses_userid'] = (int)$targetUser[
'uid'];
271 $redirectUrl =
'index.php' . (
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'interfaces'] ?
'' :
'?commandLI=1');
272 \TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl);