TYPO3 CMS  TYPO3_6-2
BackendUserHandler.php
Go to the documentation of this file.
1 <?php
3 
17 use \TYPO3\CMS\Core\Utility\GeneralUtility;
18 
23 
28  public function initialize(array $parameters, \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $frontendController) {
29  $backendUserId = (int)GeneralUtility::_GP('backendUserId');
30  $workspaceId = (int)GeneralUtility::_GP('workspaceId');
31 
32  if (empty($backendUserId) || empty($workspaceId)) {
33  return;
34  }
35 
36  $backendUser = $this->createBackendUser();
37  $backendUser->user = $this->getDatabaseConnection()->exec_SELECTgetSingleRow('*', 'be_users', 'uid=' . $backendUserId);
38  $backendUser->setTemporaryWorkspace($workspaceId);
39  $frontendController->beUserLogin = TRUE;
40 
41  $parameters['BE_USER'] = $backendUser;
42  $GLOBALS['BE_USER'] = $backendUser;
43  }
44 
48  protected function createBackendUser() {
50  'TYPO3\\CMS\\Backend\\FrontendBackendUserAuthentication'
51  );
52  }
53 
57  protected function getDatabaseConnection() {
58  return $GLOBALS['TYPO3_DB'];
59  }
60 
61 }
$parameters
Definition: FileDumpEID.php:15
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
initialize(array $parameters, \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $frontendController)