7b49f38d33535007097fbdd8196ade36531882a7
[Packages/TYPO3.CMS.git] / typo3 / sysext / felogin / Classes / Controller / FrontendLoginController.php
1 <?php
2 namespace TYPO3\CMS\Felogin\Controller;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use Psr\Log\LoggerAwareInterface;
18 use Psr\Log\LoggerAwareTrait;
19 use TYPO3\CMS\Core\Authentication\LoginType;
20 use TYPO3\CMS\Core\Context\Context;
21 use TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory;
22 use TYPO3\CMS\Core\Crypto\Random;
23 use TYPO3\CMS\Core\Database\Connection;
24 use TYPO3\CMS\Core\Database\ConnectionPool;
25 use TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer;
26 use TYPO3\CMS\Core\Utility\GeneralUtility;
27 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
28 use TYPO3\CMS\Frontend\Plugin\AbstractPlugin;
29
30 /**
31 * Plugin 'Website User Login' for the 'felogin' extension.
32 */
33 class FrontendLoginController extends AbstractPlugin implements LoggerAwareInterface
34 {
35 use LoggerAwareTrait;
36
37 /**
38 * Same as class name
39 *
40 * @var string
41 */
42 public $prefixId = 'tx_felogin_pi1';
43
44 /**
45 * The extension key.
46 *
47 * @var string
48 */
49 public $extKey = 'felogin';
50
51 /**
52 * @var bool
53 */
54 public $pi_checkCHash = false;
55
56 /**
57 * @var bool
58 */
59 public $pi_USER_INT_obj = true;
60
61 /**
62 * Is user logged in?
63 *
64 * @var bool
65 */
66 protected $userIsLoggedIn;
67
68 /**
69 * Holds the template for FE rendering
70 *
71 * @var string
72 */
73 protected $template;
74
75 /**
76 * URL for the redirect
77 *
78 * @var string
79 */
80 protected $redirectUrl;
81
82 /**
83 * Flag for disable the redirect
84 *
85 * @var bool
86 */
87 protected $noRedirect = false;
88
89 /**
90 * Logintype (given as GPvar), possible: login, logout
91 *
92 * @var string
93 */
94 protected $logintype;
95
96 /**
97 * A list of page UIDs, either an integer or a comma-separated list of integers
98 *
99 * @var string
100 */
101 public $spid;
102
103 /**
104 * Referrer
105 *
106 * @var string
107 */
108 public $referer;
109
110 /**
111 * The main method of the plugin
112 *
113 * @param string $content The PlugIn content
114 * @param array $conf The PlugIn configuration
115 * @return string The content that is displayed on the website
116 * @throws \RuntimeException when no storage PID was configured.
117 */
118 public function main($content, $conf)
119 {
120 // Loading TypoScript array into object variable:
121 $this->conf = $conf;
122 // Loading default pivars
123 $this->pi_setPiVarDefaults();
124 // Loading language-labels
125 $this->pi_loadLL('EXT:felogin/Resources/Private/Language/locallang.xlf');
126 // Init FlexForm configuration for plugin:
127 $this->pi_initPIflexForm();
128 $this->mergeflexFormValuesIntoConf();
129 // Get storage PIDs:
130 if ($this->conf['storagePid']) {
131 if ((int)$this->conf['recursive']) {
132 $this->spid = $this->pi_getPidList($this->conf['storagePid'], (int)$this->conf['recursive']);
133 } else {
134 $this->spid = $this->conf['storagePid'];
135 }
136 } else {
137 throw new \RuntimeException('No storage folder (option storagePid) for frontend users given.', 1450904202);
138 }
139 // GPvars:
140 $this->logintype = GeneralUtility::_GP('logintype');
141 $this->referer = $this->validateRedirectUrl(GeneralUtility::_GP('referer'));
142 $this->noRedirect = $this->piVars['noredirect'] || $this->conf['redirectDisable'];
143 // If config.typolinkLinkAccessRestrictedPages is set, the var is return_url
144 $returnUrl = GeneralUtility::_GP('return_url');
145 if ($returnUrl) {
146 $this->redirectUrl = $returnUrl;
147 } else {
148 $this->redirectUrl = GeneralUtility::_GP('redirect_url');
149 }
150 $this->redirectUrl = $this->validateRedirectUrl($this->redirectUrl);
151 // Get Template
152 $templateFile = $this->conf['templateFile'] ?: 'EXT:felogin/Resources/Private/Templates/FrontendLogin.html';
153 $template = GeneralUtility::getFileAbsFileName($templateFile);
154 if ($template !== '' && file_exists($template)) {
155 $this->template = file_get_contents($template);
156 }
157 // Is user logged in?
158 $this->userIsLoggedIn = GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('frontend.user', 'isLoggedIn');
159 // Redirect
160 if ($this->conf['redirectMode'] && !$this->conf['redirectDisable'] && !$this->noRedirect) {
161 $redirectUrl = $this->processRedirect();
162 if (!empty($redirectUrl)) {
163 $this->redirectUrl = $this->conf['redirectFirstMethod'] ? array_shift($redirectUrl) : array_pop($redirectUrl);
164 } else {
165 $this->redirectUrl = '';
166 }
167 }
168 // What to display
169 $content = '';
170 if ($this->piVars['forgot'] && $this->conf['showForgotPasswordLink']) {
171 $content .= $this->showForgot();
172 } elseif ($this->piVars['forgothash']) {
173 $content .= $this->changePassword();
174 } else {
175 if ($this->userIsLoggedIn && !$this->logintype) {
176 $content .= $this->showLogout();
177 } else {
178 $content .= $this->showLogin();
179 }
180 }
181 // Process the redirect
182 if (($this->logintype === LoginType::LOGIN || $this->logintype === LoginType::LOGOUT) && $this->redirectUrl && !$this->noRedirect) {
183 if (!$this->frontendController->fe_user->isCookieSet() && $this->userIsLoggedIn) {
184 $content .= $this->cObj->stdWrap($this->pi_getLL('cookie_warning'), $this->conf['cookieWarning_stdWrap.']);
185 } else {
186 // Add hook for extra processing before redirect
187 $_params = [
188 'loginType' => $this->logintype,
189 'redirectUrl' => &$this->redirectUrl
190 ];
191 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['beforeRedirect'] ?? [] as $_funcRef) {
192 if ($_funcRef) {
193 GeneralUtility::callUserFunction($_funcRef, $_params, $this);
194 }
195 }
196 \TYPO3\CMS\Core\Utility\HttpUtility::redirect($this->redirectUrl);
197 }
198 }
199 // Adds hook for processing of extra item markers / special
200 $_params = [
201 'content' => $content
202 ];
203 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['postProcContent'] ?? [] as $_funcRef) {
204 $content = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
205 }
206 return $this->conf['wrapContentInBaseClass'] ? $this->pi_wrapInBaseClass($content) : $content;
207 }
208
209 /**
210 * Shows the forgot password form
211 *
212 * @return string Content
213 */
214 protected function showForgot()
215 {
216 $subpart = $this->templateService->getSubpart($this->template, '###TEMPLATE_FORGOT###');
217 $subpartArray = ($linkpartArray = []);
218 $postData = GeneralUtility::_POST($this->prefixId);
219 if ($postData['forgot_email']) {
220 // Get hashes for compare
221 $postedHash = $postData['forgot_hash'];
222 $hashData = $this->frontendController->fe_user->getKey('ses', 'forgot_hash');
223 if ($postedHash === $hashData['forgot_hash']) {
224 $userTable = $this->frontendController->fe_user->user_table;
225 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($userTable);
226 $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
227 $row = $queryBuilder
228 ->select('*')
229 ->from($userTable)
230 ->where(
231 $queryBuilder->expr()->orX(
232 $queryBuilder->expr()->eq(
233 'email',
234 $queryBuilder->createNamedParameter($this->piVars['forgot_email'], \PDO::PARAM_STR)
235 ),
236 $queryBuilder->expr()->eq(
237 'username',
238 $queryBuilder->createNamedParameter($this->piVars['forgot_email'], \PDO::PARAM_STR)
239 )
240 ),
241 $queryBuilder->expr()->in(
242 'pid',
243 $queryBuilder->createNamedParameter(
244 GeneralUtility::intExplode(',', $this->spid),
245 Connection::PARAM_INT_ARRAY
246 )
247 )
248 )
249 ->execute()
250 ->fetch();
251
252 $error = null;
253 if ($row) {
254 // Generate an email with the hashed link
255 $error = $this->generateAndSendHash($row);
256 } elseif ($this->conf['exposeNonexistentUserInForgotPasswordDialog']) {
257 $error = $this->pi_getLL('ll_forgot_reset_message_error');
258 }
259 // Generate message
260 if ($error) {
261 $markerArray['###STATUS_MESSAGE###'] = $this->cObj->stdWrap($error, $this->conf['forgotErrorMessage_stdWrap.']);
262 } else {
263 $markerArray['###STATUS_MESSAGE###'] = $this->cObj->stdWrap(
264 $this->pi_getLL('ll_forgot_reset_message_emailSent'),
265 $this->conf['forgotResetMessageEmailSentMessage_stdWrap.']
266 );
267 }
268 $subpartArray['###FORGOT_FORM###'] = '';
269 } else {
270 // Wrong email
271 $markerArray['###STATUS_MESSAGE###'] = $this->getDisplayText('forgot_reset_message', $this->conf['forgotMessage_stdWrap.']);
272 $markerArray['###BACKLINK_LOGIN###'] = '';
273 }
274 } else {
275 $markerArray['###STATUS_MESSAGE###'] = $this->getDisplayText('forgot_reset_message', $this->conf['forgotMessage_stdWrap.']);
276 $markerArray['###BACKLINK_LOGIN###'] = '';
277 }
278 $markerArray['###BACKLINK_LOGIN###'] = $this->getPageLink(htmlspecialchars($this->pi_getLL('ll_forgot_header_backToLogin')), []);
279 $markerArray['###STATUS_HEADER###'] = $this->getDisplayText('forgot_header', $this->conf['forgotHeader_stdWrap.']);
280 $markerArray['###LEGEND###'] = htmlspecialchars($this->pi_getLL('legend', $this->pi_getLL('reset_password')));
281 $markerArray['###ACTION_URI###'] = $this->getPageLink('', [$this->prefixId . '[forgot]' => 1], true);
282 $markerArray['###EMAIL_LABEL###'] = htmlspecialchars($this->pi_getLL('your_email'));
283 $markerArray['###FORGOT_PASSWORD_ENTEREMAIL###'] = htmlspecialchars($this->pi_getLL('forgot_password_enterEmail'));
284 $markerArray['###FORGOT_EMAIL###'] = $this->prefixId . '[forgot_email]';
285 $markerArray['###SEND_PASSWORD###'] = htmlspecialchars($this->pi_getLL('reset_password'));
286 $markerArray['###DATA_LABEL###'] = htmlspecialchars($this->pi_getLL('ll_enter_your_data'));
287 $markerArray = array_merge($markerArray, $this->getUserFieldMarkers());
288 // Generate hash
289 $hash = md5($this->generatePassword(3));
290 $markerArray['###FORGOTHASH###'] = $hash;
291 // Set hash in feuser session
292 $this->frontendController->fe_user->setKey('ses', 'forgot_hash', ['forgot_hash' => $hash]);
293 return $this->templateService->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
294 }
295
296 /**
297 * This function checks the hash from link and checks the validity. If it's valid it shows the form for
298 * changing the password and process the change of password after submit, if not valid it returns the error message
299 *
300 * @return string The content.
301 */
302 protected function changePassword()
303 {
304 $subpartArray = ($linkpartArray = []);
305 $done = false;
306 $minLength = (int)$this->conf['newPasswordMinLength'] ?: 6;
307 $subpart = $this->templateService->getSubpart($this->template, '###TEMPLATE_CHANGEPASSWORD###');
308 $markerArray['###STATUS_HEADER###'] = $this->getDisplayText('change_password_header', $this->conf['changePasswordHeader_stdWrap.']);
309 $markerArray['###STATUS_MESSAGE###'] = sprintf($this->getDisplayText(
310 'change_password_message',
311 $this->conf['changePasswordMessage_stdWrap.']
312 ), $minLength);
313
314 $markerArray['###BACKLINK_LOGIN###'] = '';
315 $uid = $this->piVars['user'];
316 $piHash = $this->piVars['forgothash'];
317 $hash = explode('|', rawurldecode($piHash));
318 if ((int)$uid === 0) {
319 $markerArray['###STATUS_MESSAGE###'] = $this->getDisplayText(
320 'change_password_notvalid_message',
321 $this->conf['changePasswordNotValidMessage_stdWrap.']
322 );
323 $subpartArray['###CHANGEPASSWORD_FORM###'] = '';
324 } else {
325 $user = $this->pi_getRecord('fe_users', (int)$uid);
326 $userHash = $user['felogin_forgotHash'];
327 $compareHash = explode('|', $userHash);
328 if (!$compareHash || !$compareHash[1] || $compareHash[0] < time() || $hash[0] != $compareHash[0] || md5($hash[1]) != $compareHash[1]) {
329 $markerArray['###STATUS_MESSAGE###'] = $this->getDisplayText(
330 'change_password_notvalid_message',
331 $this->conf['changePasswordNotValidMessage_stdWrap.']
332 );
333 $subpartArray['###CHANGEPASSWORD_FORM###'] = '';
334 } else {
335 // All is fine, continue with new password
336 $postData = GeneralUtility::_POST($this->prefixId);
337 if (isset($postData['changepasswordsubmit'])) {
338 if (strlen($postData['password1']) < $minLength) {
339 $markerArray['###STATUS_MESSAGE###'] = sprintf(
340 $this->getDisplayText(
341 'change_password_tooshort_message',
342 $this->conf['changePasswordTooShortMessage_stdWrap.']
343 ),
344 $minLength
345 );
346 } elseif ($postData['password1'] != $postData['password2']) {
347 $markerArray['###STATUS_MESSAGE###'] = sprintf(
348 $this->getDisplayText(
349 'change_password_notequal_message',
350 $this->conf['changePasswordNotEqualMessage_stdWrap.']
351 ),
352 $minLength
353 );
354 } else {
355 // Hash password using configured salted passwords hash mechanism for FE
356 $hashInstance = GeneralUtility::makeInstance(PasswordHashFactory::class)->getDefaultHashInstance('FE');
357 $newPass = $hashInstance->getHashedPassword($postData['password1']);
358
359 // Call a hook for further password processing
360 if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['password_changed']) {
361 $_params = [
362 'user' => $user,
363 'newPassword' => $newPass,
364 'newPasswordUnencrypted' => $postData['password1']
365 ];
366 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['password_changed'] as $_funcRef) {
367 if ($_funcRef) {
368 GeneralUtility::callUserFunction($_funcRef, $_params, $this);
369 }
370 }
371 $newPass = $_params['newPassword'];
372 }
373
374 // Save new password and clear DB-hash
375 $userTable = $this->frontendController->fe_user->user_table;
376 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($userTable);
377 $queryBuilder->getRestrictions()->removeAll();
378 $queryBuilder->update($userTable)
379 ->set('password', $newPass)
380 ->set('felogin_forgotHash', '')
381 ->set('tstamp', (int)$GLOBALS['EXEC_TIME'])
382 ->where(
383 $queryBuilder->expr()->eq(
384 'uid',
385 $queryBuilder->createNamedParameter($user['uid'], \PDO::PARAM_INT)
386 )
387 )
388 ->execute();
389
390 $markerArray['###STATUS_MESSAGE###'] = $this->getDisplayText(
391 'change_password_done_message',
392 $this->conf['changePasswordDoneMessage_stdWrap.']
393 );
394 $done = true;
395 $subpartArray['###CHANGEPASSWORD_FORM###'] = '';
396 $markerArray['###BACKLINK_LOGIN###'] = $this->getPageLink(
397 htmlspecialchars($this->pi_getLL('ll_forgot_header_backToLogin')),
398 [$this->prefixId . '[redirectReferrer]' => 'off']
399 );
400 }
401 }
402 if (!$done) {
403 // Change password form
404 $markerArray['###ACTION_URI###'] = $this->getPageLink('', [
405 $this->prefixId . '[user]' => $user['uid'],
406 $this->prefixId . '[forgothash]' => $piHash
407 ], true);
408 $markerArray['###LEGEND###'] = htmlspecialchars($this->pi_getLL('change_password'));
409 $markerArray['###NEWPASSWORD1_LABEL###'] = htmlspecialchars($this->pi_getLL('newpassword_label1'));
410 $markerArray['###NEWPASSWORD2_LABEL###'] = htmlspecialchars($this->pi_getLL('newpassword_label2'));
411 $markerArray['###NEWPASSWORD1###'] = $this->prefixId . '[password1]';
412 $markerArray['###NEWPASSWORD2###'] = $this->prefixId . '[password2]';
413 $markerArray['###STORAGE_PID###'] = $this->spid;
414 $markerArray['###SEND_PASSWORD###'] = htmlspecialchars($this->pi_getLL('change_password'));
415 $markerArray['###FORGOTHASH###'] = $piHash;
416 }
417 }
418 }
419 return $this->templateService->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
420 }
421
422 /**
423 * Generates a hashed link and send it with email
424 *
425 * @param array $user Contains user data
426 * @return string Empty string with success, error message with no success
427 */
428 protected function generateAndSendHash($user)
429 {
430 $hours = (int)$this->conf['forgotLinkHashValidTime'] > 0 ? (int)$this->conf['forgotLinkHashValidTime'] : 24;
431 $validEnd = time() + 3600 * $hours;
432 $validEndString = date($this->conf['dateFormat'], $validEnd);
433 $hash = md5(GeneralUtility::makeInstance(Random::class)->generateRandomBytes(64));
434 $randHash = $validEnd . '|' . $hash;
435 $randHashDB = $validEnd . '|' . md5($hash);
436
437 // Write hash to DB
438 $userTable = $this->frontendController->fe_user->user_table;
439 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($userTable);
440 $queryBuilder->getRestrictions()->removeAll();
441 $queryBuilder->update($userTable)
442 ->set('felogin_forgotHash', $randHashDB)
443 ->where(
444 $queryBuilder->expr()->eq(
445 'uid',
446 $queryBuilder->createNamedParameter($user['uid'], \PDO::PARAM_INT)
447 )
448 )
449 ->execute();
450
451 // Send hashlink to user
452 $this->conf['linkPrefix'] = -1;
453 $isAbsRefPrefix = !empty($this->frontendController->absRefPrefix);
454 $isBaseURL = !empty($this->frontendController->baseUrl);
455 $isFeloginBaseURL = !empty($this->conf['feloginBaseURL']);
456 $link = $this->pi_getPageLink($this->frontendController->id, '', [
457 rawurlencode($this->prefixId . '[user]') => $user['uid'],
458 rawurlencode($this->prefixId . '[forgothash]') => $randHash
459 ]);
460 // Prefix link if necessary
461 if ($isFeloginBaseURL) {
462 // First priority, use specific base URL
463 // "absRefPrefix" must be removed first, otherwise URL will be prepended twice
464 if ($isAbsRefPrefix) {
465 $link = substr($link, strlen($this->frontendController->absRefPrefix));
466 }
467 $link = $this->conf['feloginBaseURL'] . $link;
468 } elseif ($isAbsRefPrefix) {
469 // Second priority
470 // absRefPrefix must not necessarily contain a hostname and URL scheme, so add it if needed
471 $link = GeneralUtility::locationHeaderUrl($link);
472 } elseif ($isBaseURL) {
473 // Third priority
474 // Add the global base URL to the link
475 $link = $this->frontendController->baseUrlWrap($link);
476 } else {
477 // No prefix is set, return the error
478 return $this->pi_getLL('ll_change_password_nolinkprefix_message');
479 }
480 $msg = sprintf($this->pi_getLL('ll_forgot_validate_reset_password'), $user['username'], $link, $validEndString);
481 // Add hook for extra processing of mail message
482 $params = [
483 'message' => &$msg,
484 'user' => &$user
485 ];
486 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['forgotPasswordMail'] ?? [] as $reference) {
487 if ($reference) {
488 GeneralUtility::callUserFunction($reference, $params, $this);
489 }
490 }
491 if ($user['email']) {
492 $this->cObj->sendNotifyEmail($msg, $user['email'], '', $this->conf['email_from'], $this->conf['email_fromName'], $this->conf['replyTo']);
493 }
494
495 return '';
496 }
497
498 /**
499 * Shows logout form
500 *
501 * @return string The content.
502 */
503 protected function showLogout()
504 {
505 $subpart = $this->templateService->getSubpart($this->template, '###TEMPLATE_LOGOUT###');
506 $subpartArray = ($linkpartArray = []);
507 $markerArray['###STATUS_HEADER###'] = $this->getDisplayText('status_header', $this->conf['logoutHeader_stdWrap.']);
508 $markerArray['###STATUS_MESSAGE###'] = $this->getDisplayText('status_message', $this->conf['logoutMessage_stdWrap.']);
509 $this->cObj->stdWrap($this->flexFormValue('message', 's_status'), $this->conf['logoutMessage_stdWrap.']);
510 $markerArray['###LEGEND###'] = htmlspecialchars($this->pi_getLL('logout'));
511 $markerArray['###ACTION_URI###'] = $this->getPageLink('', [], true);
512 $markerArray['###LOGOUT_LABEL###'] = htmlspecialchars($this->pi_getLL('logout'));
513 $markerArray['###NAME###'] = htmlspecialchars($this->frontendController->fe_user->user['name']);
514 $markerArray['###STORAGE_PID###'] = $this->spid;
515 $markerArray['###USERNAME###'] = htmlspecialchars($this->frontendController->fe_user->user['username']);
516 $markerArray['###USERNAME_LABEL###'] = htmlspecialchars($this->pi_getLL('username'));
517 $markerArray['###NOREDIRECT###'] = $this->noRedirect ? '1' : '0';
518 $markerArray['###PREFIXID###'] = $this->prefixId;
519 $markerArray = array_merge($markerArray, $this->getUserFieldMarkers());
520 if ($this->redirectUrl) {
521 // Use redirectUrl for action tag because of possible access restricted pages
522 $markerArray['###ACTION_URI###'] = htmlspecialchars($this->redirectUrl);
523 $this->redirectUrl = '';
524 }
525 return $this->templateService->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
526 }
527
528 /**
529 * Shows login form
530 *
531 * @return string Content
532 */
533 protected function showLogin()
534 {
535 $subpart = $this->templateService->getSubpart($this->template, '###TEMPLATE_LOGIN###');
536 $subpartArray = ($linkpartArray = ($markerArray = []));
537 $gpRedirectUrl = '';
538 $markerArray['###LEGEND###'] = htmlspecialchars($this->pi_getLL('oLabel_header_welcome'));
539 if ($this->logintype === LoginType::LOGIN) {
540 if ($this->userIsLoggedIn) {
541 // login success
542 $markerArray['###STATUS_HEADER###'] = $this->getDisplayText('success_header', $this->conf['successHeader_stdWrap.']);
543 $markerArray['###STATUS_MESSAGE###'] = $this->getDisplayText('success_message', $this->conf['successMessage_stdWrap.']);
544 $markerArray = array_merge($markerArray, $this->getUserFieldMarkers());
545 $subpartArray['###LOGIN_FORM###'] = '';
546 // Hook for general actions after after login has been confirmed (by Thomas Danzl <thomas@danzl.org>)
547 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_confirmed'] ?? [] as $_funcRef) {
548 $_params = [];
549 if ($_funcRef) {
550 GeneralUtility::callUserFunction($_funcRef, $_params, $this);
551 }
552 }
553 // show logout form directly
554 if ($this->conf['showLogoutFormAfterLogin']) {
555 $this->redirectUrl = '';
556 return $this->showLogout();
557 }
558 } else {
559 // Hook for general actions on login error
560 $params = [];
561 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_error'] ?? [] as $funcRef) {
562 if ($funcRef) {
563 GeneralUtility::callUserFunction($funcRef, $params, $this);
564 }
565 }
566 // login error
567 $markerArray['###STATUS_HEADER###'] = $this->getDisplayText('error_header', $this->conf['errorHeader_stdWrap.']);
568 $markerArray['###STATUS_MESSAGE###'] = $this->getDisplayText('error_message', $this->conf['errorMessage_stdWrap.']);
569 $gpRedirectUrl = GeneralUtility::_GP('redirect_url');
570 }
571 } else {
572 if ($this->logintype === LoginType::LOGOUT) {
573 // login form after logout
574 $markerArray['###STATUS_HEADER###'] = $this->getDisplayText('logout_header', $this->conf['logoutHeader_stdWrap.']);
575 $markerArray['###STATUS_MESSAGE###'] = $this->getDisplayText('logout_message', $this->conf['logoutMessage_stdWrap.']);
576 } else {
577 // login form
578 $markerArray['###STATUS_HEADER###'] = $this->getDisplayText('welcome_header', $this->conf['welcomeHeader_stdWrap.']);
579 $markerArray['###STATUS_MESSAGE###'] = $this->getDisplayText('welcome_message', $this->conf['welcomeMessage_stdWrap.']);
580 }
581 }
582
583 // This hook allows to call User JS functions.
584 // The methods should also set the required JS functions to get included
585 $onSubmit = '';
586 $extraHidden = '';
587 $onSubmitAr = [];
588 $extraHiddenAr = [];
589 // Check for referer redirect method. if present, save referer in form field
590 if (GeneralUtility::inList($this->conf['redirectMode'], 'referer') || GeneralUtility::inList($this->conf['redirectMode'], 'refererDomains')) {
591 $referer = $this->referer ? $this->referer : GeneralUtility::getIndpEnv('HTTP_REFERER');
592 if ($referer) {
593 $extraHiddenAr[] = '<input type="hidden" name="referer" value="' . htmlspecialchars($referer) . '" />';
594 if ($this->piVars['redirectReferrer'] === 'off') {
595 $extraHiddenAr[] = '<input type="hidden" name="' . $this->prefixId . '[redirectReferrer]" value="off" />';
596 }
597 }
598 }
599 $_params = [];
600 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['loginFormOnSubmitFuncs'] ?? [] as $funcRef) {
601 list($onSub, $hid) = GeneralUtility::callUserFunction($funcRef, $_params, $this);
602 $onSubmitAr[] = $onSub;
603 $extraHiddenAr[] = $hid;
604 }
605 if (!empty($onSubmitAr)) {
606 $onSubmit = implode('; ', $onSubmitAr) . '; return true;';
607 }
608 if (!empty($extraHiddenAr)) {
609 $extraHidden = implode(LF, $extraHiddenAr);
610 }
611 if (!$gpRedirectUrl && $this->redirectUrl) {
612 $gpRedirectUrl = $this->redirectUrl;
613 }
614 // Login form
615 $markerArray['###ACTION_URI###'] = $this->getPageLink('', [], true);
616 // Used by kb_md5fepw extension...
617 $markerArray['###EXTRA_HIDDEN###'] = $extraHidden;
618 $markerArray['###LEGEND###'] = htmlspecialchars($this->pi_getLL('login'));
619 $markerArray['###LOGIN_LABEL###'] = htmlspecialchars($this->pi_getLL('login'));
620 // Used by kb_md5fepw extension...
621 $markerArray['###ON_SUBMIT###'] = $onSubmit;
622 $markerArray['###PASSWORD_LABEL###'] = htmlspecialchars($this->pi_getLL('password'));
623 $markerArray['###STORAGE_PID###'] = $this->spid;
624 $markerArray['###USERNAME_LABEL###'] = htmlspecialchars($this->pi_getLL('username'));
625 $markerArray['###REDIRECT_URL###'] = htmlspecialchars($gpRedirectUrl);
626 $markerArray['###NOREDIRECT###'] = $this->noRedirect ? '1' : '0';
627 $markerArray['###PREFIXID###'] = $this->prefixId;
628 $markerArray = array_merge($markerArray, $this->getUserFieldMarkers());
629 if ($this->conf['showForgotPasswordLink']) {
630 $linkpartArray['###FORGOT_PASSWORD_LINK###'] = explode('|', $this->getPageLink('|', [$this->prefixId . '[forgot]' => 1]));
631 $markerArray['###FORGOT_PASSWORD###'] = htmlspecialchars($this->pi_getLL('ll_forgot_header'));
632 } else {
633 $subpartArray['###FORGOTP_VALID###'] = '';
634 }
635 // The permanent login checkbox should only be shown if permalogin is not deactivated (-1),
636 // not forced to be always active (2) and lifetime is greater than 0
637 $permalogin = (int)$GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'];
638 if (
639 $this->conf['showPermaLogin']
640 && ($permalogin === 0 || $permalogin === 1)
641 && $GLOBALS['TYPO3_CONF_VARS']['FE']['lifetime'] > 0
642 ) {
643 $markerArray['###PERMALOGIN###'] = htmlspecialchars($this->pi_getLL('permalogin'));
644 if ($permalogin === 1) {
645 $markerArray['###PERMALOGIN_HIDDENFIELD_ATTRIBUTES###'] = 'disabled="disabled"';
646 $markerArray['###PERMALOGIN_CHECKBOX_ATTRIBUTES###'] = 'checked="checked"';
647 } else {
648 $markerArray['###PERMALOGIN_HIDDENFIELD_ATTRIBUTES###'] = '';
649 $markerArray['###PERMALOGIN_CHECKBOX_ATTRIBUTES###'] = '';
650 }
651 } else {
652 $subpartArray['###PERMALOGIN_VALID###'] = '';
653 }
654 return $this->templateService->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
655 }
656
657 /**
658 * Process redirect methods. The function searches for a redirect url using all configured methods.
659 *
660 * @return array Redirect URLs
661 */
662 protected function processRedirect()
663 {
664 $redirect_url = [];
665 if ($this->conf['redirectMode']) {
666 $redirectMethods = GeneralUtility::trimExplode(',', $this->conf['redirectMode'], true);
667 foreach ($redirectMethods as $redirMethod) {
668 if ($this->userIsLoggedIn && $this->logintype === LoginType::LOGIN) {
669 // Logintype is needed because the login-page wouldn't be accessible anymore after a login (would always redirect)
670 switch ($redirMethod) {
671 case 'groupLogin':
672 // taken from dkd_redirect_at_login written by Ingmar Schlecht; database-field changed
673 $groupData = $this->frontendController->fe_user->groupData;
674 if (!empty($groupData['uid'])) {
675
676 // take the first group with a redirect page
677 $userGroupTable = $this->frontendController->fe_user->usergroup_table;
678 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($userGroupTable);
679 $queryBuilder->getRestrictions()->removeAll();
680 $row = $queryBuilder
681 ->select('felogin_redirectPid')
682 ->from($userGroupTable)
683 ->where(
684 $queryBuilder->expr()->neq(
685 'felogin_redirectPid',
686 $queryBuilder->createNamedParameter('', \PDO::PARAM_STR)
687 ),
688 $queryBuilder->expr()->in(
689 'uid',
690 $queryBuilder->createNamedParameter(
691 $groupData['uid'],
692 Connection::PARAM_INT_ARRAY
693 )
694 )
695 )
696 ->execute()
697 ->fetch();
698
699 if ($row) {
700 $redirect_url[] = $this->pi_getPageLink($row['felogin_redirectPid']);
701 }
702 }
703 break;
704 case 'userLogin':
705
706 $userTable = $this->frontendController->fe_user->user_table;
707 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($userTable);
708 $queryBuilder->getRestrictions()->removeAll();
709 $row = $queryBuilder
710 ->select('felogin_redirectPid')
711 ->from($userTable)
712 ->where(
713 $queryBuilder->expr()->neq(
714 'felogin_redirectPid',
715 $queryBuilder->createNamedParameter('', \PDO::PARAM_STR)
716 ),
717 $queryBuilder->expr()->eq(
718 $this->frontendController->fe_user->userid_column,
719 $queryBuilder->createNamedParameter(
720 $this->frontendController->fe_user->user['uid'],
721 \PDO::PARAM_INT
722 )
723 )
724 )
725 ->execute()
726 ->fetch();
727
728 if ($row) {
729 $redirect_url[] = $this->pi_getPageLink($row['felogin_redirectPid']);
730 }
731
732 break;
733 case 'login':
734 if ($this->conf['redirectPageLogin']) {
735 $redirect_url[] = $this->pi_getPageLink((int)$this->conf['redirectPageLogin']);
736 }
737 break;
738 case 'getpost':
739 $redirect_url[] = $this->redirectUrl;
740 break;
741 case 'referer':
742 // Avoid redirect when logging in after changing password
743 if ($this->piVars['redirectReferrer'] !== 'off') {
744 // Avoid forced logout, when trying to login immediately after a logout
745 $redirect_url[] = preg_replace('/[&?]logintype=[a-z]+/', '', $this->referer);
746 }
747 break;
748 case 'refererDomains':
749 // Auto redirect.
750 // Feature to redirect to the page where the user came from (HTTP_REFERER).
751 // Allowed domains to redirect to, can be configured with plugin.tx_felogin_pi1.domains
752 // Thanks to plan2.net / Martin Kutschker for implementing this feature.
753 // also avoid redirect when logging in after changing password
754 if ($this->conf['domains'] && $this->piVars['redirectReferrer'] !== 'off') {
755 $url = $this->referer;
756 // Is referring url allowed to redirect?
757 $match = [];
758 if (preg_match('#^http://([[:alnum:]._-]+)/#', $url, $match)) {
759 $redirect_domain = $match[1];
760 $found = false;
761 foreach (GeneralUtility::trimExplode(',', $this->conf['domains'], true) as $d) {
762 if (preg_match('/(?:^|\\.)' . $d . '$/', $redirect_domain)) {
763 $found = true;
764 break;
765 }
766 }
767 if (!$found) {
768 $url = '';
769 }
770 }
771 // Avoid forced logout, when trying to login immediately after a logout
772 if ($url) {
773 $redirect_url[] = preg_replace('/[&?]logintype=[a-z]+/', '', $url);
774 }
775 }
776 break;
777 }
778 } elseif ($this->logintype === LoginType::LOGIN) {
779 // after login-error
780 switch ($redirMethod) {
781 case 'loginError':
782 if ($this->conf['redirectPageLoginError']) {
783 $redirect_url[] = $this->pi_getPageLink((int)$this->conf['redirectPageLoginError']);
784 }
785 break;
786 }
787 } elseif ($this->logintype == '' && $redirMethod === 'login' && $this->conf['redirectPageLogin']) {
788 // If login and page not accessible
789 $this->cObj->typoLink('', [
790 'parameter' => $this->conf['redirectPageLogin'],
791 'linkAccessRestrictedPages' => true
792 ]);
793 $redirect_url[] = $this->cObj->lastTypoLinkUrl;
794 } elseif ($this->logintype == '' && $redirMethod === 'logout' && $this->conf['redirectPageLogout'] && $this->userIsLoggedIn) {
795 // If logout and page not accessible
796 $redirect_url[] = $this->pi_getPageLink((int)$this->conf['redirectPageLogout']);
797 } elseif ($this->logintype === LoginType::LOGOUT) {
798 // after logout
799 // Hook for general actions after after logout has been confirmed
800 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['logout_confirmed'] ?? [] as $_funcRef) {
801 $_params = [];
802 if ($_funcRef) {
803 GeneralUtility::callUserFunction($_funcRef, $_params, $this);
804 }
805 }
806 switch ($redirMethod) {
807 case 'logout':
808 if ($this->conf['redirectPageLogout']) {
809 $redirect_url[] = $this->pi_getPageLink((int)$this->conf['redirectPageLogout']);
810 }
811 break;
812 }
813 } else {
814 // not logged in
815 // Placeholder for maybe future options
816 switch ($redirMethod) {
817 case 'getpost':
818 // Preserve the get/post value
819 $redirect_url[] = $this->redirectUrl;
820 break;
821 }
822 }
823 }
824 }
825 // Remove empty values, but keep "0" as value (that's why "strlen" is used as second parameter)
826 if (!empty($redirect_url)) {
827 return array_filter($redirect_url, 'strlen');
828 }
829 return [];
830 }
831
832 /**
833 * Reads flexform configuration and merge it with $this->conf
834 */
835 protected function mergeflexFormValuesIntoConf()
836 {
837 $flex = [];
838 if ($this->flexFormValue('showForgotPassword', 'sDEF')) {
839 $flex['showForgotPasswordLink'] = $this->flexFormValue('showForgotPassword', 'sDEF');
840 }
841 if ($this->flexFormValue('showPermaLogin', 'sDEF')) {
842 $flex['showPermaLogin'] = $this->flexFormValue('showPermaLogin', 'sDEF');
843 }
844 if ($this->flexFormValue('showLogoutFormAfterLogin', 'sDEF')) {
845 $flex['showLogoutFormAfterLogin'] = $this->flexFormValue('showLogoutFormAfterLogin', 'sDEF');
846 }
847 if ($this->flexFormValue('pages', 'sDEF')) {
848 $flex['pages'] = $this->flexFormValue('pages', 'sDEF');
849 }
850 if ($this->flexFormValue('recursive', 'sDEF')) {
851 $flex['recursive'] = $this->flexFormValue('recursive', 'sDEF');
852 }
853 if ($this->flexFormValue('redirectMode', 's_redirect')) {
854 $flex['redirectMode'] = $this->flexFormValue('redirectMode', 's_redirect');
855 }
856 if ($this->flexFormValue('redirectFirstMethod', 's_redirect')) {
857 $flex['redirectFirstMethod'] = $this->flexFormValue('redirectFirstMethod', 's_redirect');
858 }
859 if ($this->flexFormValue('redirectDisable', 's_redirect')) {
860 $flex['redirectDisable'] = $this->flexFormValue('redirectDisable', 's_redirect');
861 }
862 if ($this->flexFormValue('redirectPageLogin', 's_redirect')) {
863 $flex['redirectPageLogin'] = $this->flexFormValue('redirectPageLogin', 's_redirect');
864 }
865 if ($this->flexFormValue('redirectPageLoginError', 's_redirect')) {
866 $flex['redirectPageLoginError'] = $this->flexFormValue('redirectPageLoginError', 's_redirect');
867 }
868 if ($this->flexFormValue('redirectPageLogout', 's_redirect')) {
869 $flex['redirectPageLogout'] = $this->flexFormValue('redirectPageLogout', 's_redirect');
870 }
871 $pid = $flex['pages'] ? $this->pi_getPidList($flex['pages'], $flex['recursive']) : 0;
872 if ($pid > 0) {
873 $flex['storagePid'] = $pid;
874 }
875 $this->conf = array_merge($this->conf, $flex);
876 }
877
878 /**
879 * Loads a variable from the flexform
880 *
881 * @param string $var Name of variable
882 * @param string $sheet Name of sheet
883 * @return string Value of var
884 */
885 protected function flexFormValue($var, $sheet)
886 {
887 return $this->pi_getFFvalue($this->cObj->data['pi_flexform'], $var, $sheet);
888 }
889
890 /**
891 * Generate link with typolink function
892 *
893 * @param string $label Linktext
894 * @param array $piVars Link vars
895 * @param bool $returnUrl TRUE: returns only url FALSE (default) returns the link)
896 * @return string Link or url
897 */
898 protected function getPageLink($label, $piVars, $returnUrl = false)
899 {
900 $additionalParams = '';
901 if (!empty($piVars)) {
902 foreach ($piVars as $key => $val) {
903 $additionalParams .= '&' . $key . '=' . $val;
904 }
905 }
906 // Should GETvars be preserved?
907 if ($this->conf['preserveGETvars']) {
908 $additionalParams .= $this->getPreserveGetVars();
909 }
910 $this->conf['linkConfig.']['parameter'] = $this->frontendController->id;
911 if ($additionalParams) {
912 $this->conf['linkConfig.']['additionalParams'] = $additionalParams;
913 }
914 if ($returnUrl) {
915 return htmlspecialchars($this->cObj->typoLink_URL($this->conf['linkConfig.']));
916 }
917 return $this->cObj->typoLink($label, $this->conf['linkConfig.']);
918 }
919
920 /**
921 * Add additional parameters for links according to TS setting preserveGETvars.
922 * Possible values are "all" or a comma separated list of allowed GET-vars.
923 * Supports multi-dimensional GET-vars.
924 * Some hardcoded values are dropped.
925 *
926 * @return string additionalParams-string
927 */
928 protected function getPreserveGetVars()
929 {
930 $getVars = GeneralUtility::_GET();
931 unset(
932 $getVars['id'],
933 $getVars['no_cache'],
934 $getVars['logintype'],
935 $getVars['redirect_url'],
936 $getVars['cHash'],
937 $getVars[$this->prefixId]
938 );
939 if ($this->conf['preserveGETvars'] === 'all') {
940 $preserveQueryParts = $getVars;
941 } else {
942 $preserveQueryStringProperties = GeneralUtility::trimExplode(',', $this->conf['preserveGETvars']);
943 $preserveQueryParts = [];
944 parse_str(implode('=1&', $preserveQueryStringProperties) . '=1', $preserveQueryParts);
945 $preserveQueryParts = \TYPO3\CMS\Core\Utility\ArrayUtility::intersectRecursive($getVars, $preserveQueryParts);
946 }
947 $parameters = GeneralUtility::implodeArrayForUrl('', $preserveQueryParts);
948 return $parameters;
949 }
950
951 /**
952 * Is used by forgot password - function with md5 option.
953 * @param int $len Length of new password
954 * @return string New password
955 */
956 protected function generatePassword($len)
957 {
958 $pass = '';
959 while ($len--) {
960 $char = rand(0, 35);
961 if ($char < 10) {
962 $pass .= '' . $char;
963 } else {
964 $pass .= chr($char - 10 + 97);
965 }
966 }
967 return $pass;
968 }
969
970 /**
971 * Returns the header / message value from flexform if present, else from locallang.xlf
972 *
973 * @param string $label label name
974 * @param array $stdWrapArray TS stdWrap array
975 * @return string label text
976 */
977 protected function getDisplayText($label, $stdWrapArray = [])
978 {
979 $text = $this->flexFormValue($label, 's_messages') ? $this->cObj->stdWrap($this->flexFormValue($label, 's_messages'), $stdWrapArray) : $this->cObj->stdWrap($this->pi_getLL('ll_' . $label), $stdWrapArray);
980 $replace = $this->getUserFieldMarkers();
981 return strtr($text, $replace);
982 }
983
984 /**
985 * Returns Array of markers filled with user fields
986 *
987 * @return array Marker array
988 */
989 protected function getUserFieldMarkers()
990 {
991 $marker = [];
992 // replace markers with fe_user data
993 if ($this->frontendController->fe_user->user) {
994 // All fields of fe_user will be replaced, scheme is ###FEUSER_FIELDNAME###
995 foreach ($this->frontendController->fe_user->user as $field => $value) {
996 $marker['###FEUSER_' . strtoupper($field) . '###'] = $this->cObj->stdWrap($value, $this->conf['userfields.'][$field . '.']);
997 }
998 // Add ###USER### for compatibility
999 $marker['###USER###'] = $marker['###FEUSER_USERNAME###'];
1000 }
1001 return $marker;
1002 }
1003
1004 /**
1005 * Returns a valid and XSS cleaned url for redirect, checked against configuration "allowedRedirectHosts"
1006 *
1007 * @param string $url
1008 * @return string cleaned referer or empty string if not valid
1009 */
1010 protected function validateRedirectUrl($url)
1011 {
1012 $url = strval($url);
1013 if ($url === '') {
1014 return '';
1015 }
1016 // Validate the URL:
1017 if ($this->isRelativeUrl($url) || $this->isInCurrentDomain($url) || $this->isInLocalDomain($url)) {
1018 return $url;
1019 }
1020 // URL is not allowed
1021 $this->logger->warning('Url "' . $url . '" for redirect was not accepted!');
1022 return '';
1023 }
1024
1025 /**
1026 * Determines whether the URL is on the current host and belongs to the
1027 * current TYPO3 installation. The scheme part is ignored in the comparison.
1028 *
1029 * @param string $url URL to be checked
1030 * @return bool Whether the URL belongs to the current TYPO3 installation
1031 */
1032 protected function isInCurrentDomain($url)
1033 {
1034 $urlWithoutSchema = preg_replace('#^https?://#', '', $url);
1035 $siteUrlWithoutSchema = preg_replace('#^https?://#', '', GeneralUtility::getIndpEnv('TYPO3_SITE_URL'));
1036 return strpos($urlWithoutSchema . '/', GeneralUtility::getIndpEnv('HTTP_HOST') . '/') === 0
1037 && strpos($urlWithoutSchema, $siteUrlWithoutSchema) === 0;
1038 }
1039
1040 /**
1041 * Determines whether the URL matches a domain
1042 * in the sys_domain database table.
1043 *
1044 * @param string $url Absolute URL which needs to be checked
1045 * @return bool Whether the URL is considered to be local
1046 */
1047 protected function isInLocalDomain($url)
1048 {
1049 $result = false;
1050 if (GeneralUtility::isValidUrl($url)) {
1051 $parsedUrl = parse_url($url);
1052 if ($parsedUrl['scheme'] === 'http' || $parsedUrl['scheme'] === 'https') {
1053 $host = $parsedUrl['host'];
1054 // Removes the last path segment and slash sequences like /// (if given):
1055 $path = preg_replace('#/+[^/]*$#', '', $parsedUrl['path']);
1056
1057 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_domain');
1058 $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
1059 $localDomains = $queryBuilder->select('domainName')
1060 ->from('sys_domain')
1061 ->execute()
1062 ->fetchAll();
1063
1064 if (is_array($localDomains)) {
1065 foreach ($localDomains as $localDomain) {
1066 // strip trailing slashes (if given)
1067 $domainName = rtrim($localDomain['domainName'], '/');
1068 if (GeneralUtility::isFirstPartOfStr($host . $path . '/', $domainName . '/')) {
1069 $result = true;
1070 break;
1071 }
1072 }
1073 }
1074 }
1075 }
1076 return $result;
1077 }
1078
1079 /**
1080 * Determines whether the URL is relative to the
1081 * current TYPO3 installation.
1082 *
1083 * @param string $url URL which needs to be checked
1084 * @return bool Whether the URL is considered to be relative
1085 */
1086 protected function isRelativeUrl($url)
1087 {
1088 $url = GeneralUtility::sanitizeLocalUrl($url);
1089 if (!empty($url)) {
1090 $parsedUrl = @parse_url($url);
1091 if ($parsedUrl !== false && !isset($parsedUrl['scheme']) && !isset($parsedUrl['host'])) {
1092 // If the relative URL starts with a slash, we need to check if it's within the current site path
1093 return $parsedUrl['path'][0] !== '/' || GeneralUtility::isFirstPartOfStr($parsedUrl['path'], GeneralUtility::getIndpEnv('TYPO3_SITE_PATH'));
1094 }
1095 }
1096 return false;
1097 }
1098
1099 /**
1100 * Get TypoScriptFrontendController
1101 *
1102 * @return TypoScriptFrontendController
1103 */
1104 protected function getTypoScriptFrontendController()
1105 {
1106 return $GLOBALS['TSFE'];
1107 }
1108 }