63 $this->moduleData = $this->moduleDataStorageService->loadModuleData();
66 parent::processRequest($request, $response);
67 $this->moduleDataStorageService->persistModuleData($this->moduleData);
68 }
catch (\
TYPO3\CMS\Extbase\Mvc\Exception\StopActionException $e) {
69 $this->moduleDataStorageService->persistModuleData($this->moduleData);
86 if (empty($this->settings)) {
87 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);
99 if ($demand === NULL) {
100 $demand = $this->moduleData->getDemand();
102 $this->moduleData->setDemand($demand);
105 if (\
TYPO3\CMS\Core\Utility\GeneralUtility::_GP(
'SwitchUser')) {
107 \
TYPO3\CMS\Core\Utility\GeneralUtility::_GP(
'SwitchUser'),
108 \
TYPO3\CMS\Core\Utility\GeneralUtility::_GP(
'switchBackUser')
111 $compareUserList = $this->moduleData->getCompareUserList();
112 $this->view->assign(
'demand', $demand);
114 $this->view->assign(
'dateFormat',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'ddmmyy']);
115 $this->view->assign(
'timeFormat',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'hhmm']);
116 $this->view->assign(
'backendUsers', $this->backendUserRepository->findDemanded($demand));
117 $this->view->assign(
'backendUserGroups', array_merge(array(
''), $this->backendUserGroupRepository->findAll()->toArray()));
118 $this->view->assign(
'compareUserList', !empty($compareUserList) ? $this->backendUserRepository->findByUidList($compareUserList) :
'');
127 $onlineUsersAndSessions = array();
128 $onlineUsers = $this->backendUserRepository->findOnline();
129 foreach ($onlineUsers as $onlineUser) {
130 $onlineUsersAndSessions[] = array(
131 'backendUser' => $onlineUser,
132 'sessions' => $this->backendUserSessionRepository->findByBackendUser($onlineUser)
135 $this->view->assign(
'dateFormat',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'ddmmyy']);
136 $this->view->assign(
'timeFormat',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'hhmm']);
137 $this->view->assign(
'onlineUsersAndSessions', $onlineUsersAndSessions);
138 $this->view->assign(
'currentSessionId',
$GLOBALS[
'BE_USER']->user[
'ses_id']);
147 $compareUserList = $this->moduleData->getCompareUserList();
148 $this->view->assign(
'dateFormat',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'ddmmyy']);
149 $this->view->assign(
'timeFormat',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'hhmm']);
150 $this->view->assign(
'compareUserList', !empty($compareUserList) ? $this->backendUserRepository->findByUidList($compareUserList) :
'');
160 $this->moduleData->attachUidCompareUser(
$uid);
161 $this->moduleDataStorageService->persistModuleData($this->moduleData);
172 $this->moduleData->detachUidCompareUser(
$uid);
173 $this->moduleDataStorageService->persistModuleData($this->moduleData);
186 $GLOBALS[
'TYPO3_DB']->exec_DELETEquery(
188 'ses_userid = "' . (
int)$backendUser->getUid() .
'" AND ses_id = ' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($sessionId,
'be_sessions') .
' LIMIT 1' 190 if (
$GLOBALS[
'TYPO3_DB']->sql_affected_rows() == 1) {
191 $message =
'Session successfully terminated.';
192 $this->flashMessageContainer->add($message,
'', \
TYPO3\CMS\Core\Messaging\FlashMessage::OK);
204 protected function switchUser($switchUser, $switchBack = FALSE) {
205 $targetUser = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord(
'be_users', $switchUser);
206 if (is_array($targetUser) &&
$GLOBALS[
'BE_USER']->isAdmin()) {
207 $updateData[
'ses_userid'] = $targetUser[
'uid'];
210 $updateData[
'ses_backuserid'] = (int)
$GLOBALS[
'BE_USER']->user[
'uid'];
213 $GLOBALS[
'BE_USER']->uc[
'startModuleOnFirstLogin'] =
'system_BeuserTxBeuser';
217 $whereClause =
'ses_id=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr(
$GLOBALS[
'BE_USER']->
id,
'be_sessions');
218 $whereClause .=
' AND ses_name=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr(\
TYPO3\CMS\Core\Authentication\BackendUserAuthentication::getCookieName(),
'be_sessions');
219 $whereClause .=
' AND ses_userid=' . (int)
$GLOBALS[
'BE_USER']->user[
'uid'];
221 $GLOBALS[
'TYPO3_DB']->exec_UPDATEquery(
227 $redirectUrl =
$GLOBALS[
'BACK_PATH'] .
'index.php' . (
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'interfaces'] ?
'' :
'?commandLI=1');
removeFromCompareListAction($uid)
indexAction(\TYPO3\CMS\Beuser\Domain\Model\Demand $demand=NULL)
processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
$moduleDataStorageService
$backendUserSessionRepository
forward($actionName, $controllerName=NULL, $extensionName=NULL, array $arguments=NULL)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
addToCompareListAction($uid)
static redirect($url, $httpStatus=self::HTTP_STATUS_303)
terminateBackendUserSessionAction(\TYPO3\CMS\Beuser\Domain\Model\BackendUser $backendUser, $sessionId)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
$backendUserGroupRepository
switchUser($switchUser, $switchBack=FALSE)