TYPO3.CMS 7.6 Schnipsel: Unterschied zwischen den Versionen
Aus Vosp.info
F (Diskussion | Beiträge) |
F (Diskussion | Beiträge) (→logout / login) |
||
Zeile 13: | Zeile 13: | ||
$user = $this->userRepository->findByUid($ncfeuserid); | $user = $this->userRepository->findByUid($ncfeuserid); | ||
$GLOBALS['TSFE']->fe_user->createUserSession($user->_getProperties()); | $GLOBALS['TSFE']->fe_user->createUserSession($user->_getProperties()); | ||
+ | $GLOBALS["TSFE"]->fe_user->user = $GLOBALS["TSFE"]->fe_user->fetchUserSession(); | ||
} | } | ||
Zeile 19: | Zeile 20: | ||
} | } | ||
</source> | </source> | ||
+ | |||
+ | * https://forge.typo3.org/issues/62194 | ||
== Controller == | == Controller == |
Version vom 17. Dezember 2015, 13:46 Uhr
Inhaltsverzeichnis
extbase (php)
Generell
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
$ncmail = $objectManager->get('Netzcoop\Extension\Services\Ncmail');
logout / login
protected function login($ncfeuserid) {
$user = $this->userRepository->findByUid($ncfeuserid);
$GLOBALS['TSFE']->fe_user->createUserSession($user->_getProperties());
$GLOBALS["TSFE"]->fe_user->user = $GLOBALS["TSFE"]->fe_user->fetchUserSession();
}
protected function logout() {
$GLOBALS['TSFE']->fe_user->logoff();
}
Controller
Url/Link erstellen
$uriBuilder = $this->controllerContext->getUriBuilder();
$uriBuilder->reset();
$uriBuilder->setArguments(array(
strtolower($this->extensionName) => array(
'param1' => $user->getUid(),
'param2' => 'test',
)
));
$uri = $uriBuilder->build();