2 namespace TYPO3\CMS\Felogin\Controller;
116 $this->uploadDir =
'uploads/tx_felogin/';
120 $this->pi_loadLL(
'EXT:felogin/Resources/Private/Language/locallang.xlf');
125 if ($this->conf[
'storagePid']) {
126 if ((
int)$this->conf[
'recursive']) {
127 $this->spid = $this->
pi_getPidList($this->conf[
'storagePid'], (
int)$this->conf[
'recursive']);
129 $this->spid = $this->conf[
'storagePid'];
133 $pids = $this->frontendController->getStorageSiterootPids();
134 $this->spid = $pids[
'_STORAGE_PID'];
139 $this->noRedirect = $this->piVars[
'noredirect'] || $this->conf[
'redirectDisable'];
143 $this->redirectUrl = $returnUrl;
149 $templateFile = $this->conf[
'templateFile'] ?:
'EXT:felogin/Resources/Private/Templates/FrontendLogin.html';
150 $this->
template = $this->cObj->fileResource($templateFile);
152 $this->userIsLoggedIn = $this->frontendController->loginUser;
154 if ($this->conf[
'redirectMode'] && !$this->conf[
'redirectDisable'] && !$this->noRedirect && !$this->conf[
'showLogoutFormAfterLogin']) {
159 $this->redirectUrl =
'';
164 if ($this->piVars[
'forgot'] && $this->conf[
'showForgotPasswordLink']) {
166 }
elseif ($this->piVars[
'forgothash']) {
169 if ($this->userIsLoggedIn && !$this->logintype) {
176 if (($this->logintype ===
'login' || $this->logintype ===
'logout') && $this->redirectUrl && !$this->noRedirect) {
178 $content .= $this->cObj->stdWrap($this->
pi_getLL(
'cookie_warning',
'',
true), $this->conf[
'cookieWarning_stdWrap.']);
182 isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'beforeRedirect']) &&
183 is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'beforeRedirect'])
186 'loginType' => $this->logintype,
187 'redirectUrl' => &$this->redirectUrl
189 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'beforeRedirect'] as $_funcRef) {
195 \TYPO3\CMS\Core\Utility\HttpUtility::redirect($this->redirectUrl);
200 isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'postProcContent'])
201 && is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'postProcContent'])
204 'content' => $content
206 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'postProcContent'] as $_funcRef) {
210 return $this->conf[
'wrapContentInBaseClass'] ? $this->
pi_wrapInBaseClass($content) : $content;
220 $subpart = $this->cObj->getSubpart($this->
template,
'###TEMPLATE_FORGOT###');
221 $subpartArray = ($linkpartArray = array());
223 if ($postData[
'forgot_email']) {
225 $postedHash = $postData[
'forgot_hash'];
226 $hashData = $this->frontendController->fe_user->getKey(
'ses',
'forgot_hash');
227 if ($postedHash === $hashData[
'forgot_hash']) {
230 $data = $this->databaseConnection->fullQuoteStr($this->piVars[
'forgot_email'],
'fe_users');
231 $res = $this->databaseConnection->exec_SELECTquery(
232 'uid, username, password, email',
234 '(email=' . $data .
' OR username=' . $data .
') AND pid IN (' . $this->databaseConnection->cleanIntList($this->spid) .
') ' . $this->cObj->enableFields(
'fe_users')
236 if ($this->databaseConnection->sql_num_rows($res)) {
237 $row = $this->databaseConnection->sql_fetch_assoc($res);
243 }
elseif ($this->conf[
'exposeNonexistentUserInForgotPasswordDialog']) {
244 $error = $this->
pi_getLL(
'll_forgot_reset_message_error');
248 $markerArray[
'###STATUS_MESSAGE###'] = $this->cObj->stdWrap($error, $this->conf[
'forgotErrorMessage_stdWrap.']);
250 $markerArray[
'###STATUS_MESSAGE###'] = $this->cObj->stdWrap(
251 $this->
pi_getLL(
'll_forgot_reset_message_emailSent',
'',
true),
252 $this->conf[
'forgotResetMessageEmailSentMessage_stdWrap.']
255 $subpartArray[
'###FORGOT_FORM###'] =
'';
258 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'forgot_reset_message', $this->conf[
'forgotMessage_stdWrap.']);
259 $markerArray[
'###BACKLINK_LOGIN###'] =
'';
262 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'forgot_reset_message', $this->conf[
'forgotMessage_stdWrap.']);
263 $markerArray[
'###BACKLINK_LOGIN###'] =
'';
265 $markerArray[
'###BACKLINK_LOGIN###'] = $this->
getPageLink($this->
pi_getLL(
'll_forgot_header_backToLogin',
'',
true), array());
266 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'forgot_header', $this->conf[
'forgotHeader_stdWrap.']);
267 $markerArray[
'###LEGEND###'] = $this->
pi_getLL(
'legend', $this->
pi_getLL(
'reset_password',
'',
true),
true);
268 $markerArray[
'###ACTION_URI###'] = $this->
getPageLink(
'', array($this->prefixId .
'[forgot]' => 1),
true);
269 $markerArray[
'###EMAIL_LABEL###'] = $this->
pi_getLL(
'your_email',
'',
true);
270 $markerArray[
'###FORGOT_PASSWORD_ENTEREMAIL###'] = $this->
pi_getLL(
'forgot_password_enterEmail',
'',
true);
271 $markerArray[
'###FORGOT_EMAIL###'] = $this->prefixId .
'[forgot_email]';
272 $markerArray[
'###SEND_PASSWORD###'] = $this->
pi_getLL(
'reset_password',
'',
true);
273 $markerArray[
'###DATA_LABEL###'] = $this->
pi_getLL(
'll_enter_your_data',
'',
true);
277 $markerArray[
'###FORGOTHASH###'] = $hash;
279 $this->frontendController->fe_user->setKey(
'ses',
'forgot_hash', array(
'forgot_hash' => $hash));
280 return $this->cObj->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
291 $subpartArray = ($linkpartArray = array());
293 $minLength = (int)$this->conf[
'newPasswordMinLength'] ?: 6;
294 $subpart = $this->cObj->getSubpart($this->
template,
'###TEMPLATE_CHANGEPASSWORD###');
295 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'change_password_header', $this->conf[
'changePasswordHeader_stdWrap.']);
296 $markerArray[
'###STATUS_MESSAGE###'] = sprintf($this->
getDisplayText(
297 'change_password_message',
298 $this->conf[
'changePasswordMessage_stdWrap.']
301 $markerArray[
'###BACKLINK_LOGIN###'] =
'';
302 $uid = $this->piVars[
'user'];
303 $piHash = $this->piVars[
'forgothash'];
304 $hash = explode(
'|', $piHash);
305 if ((
int)$uid === 0) {
307 'change_password_notvalid_message',
308 $this->conf[
'changePasswordNotValidMessage_stdWrap.']
310 $subpartArray[
'###CHANGEPASSWORD_FORM###'] =
'';
313 $userHash = $user[
'felogin_forgotHash'];
314 $compareHash = explode(
'|', $userHash);
315 if (!$compareHash || !$compareHash[1] || $compareHash[0] < time() || $hash[0] != $compareHash[0] || md5($hash[1]) != $compareHash[1]) {
317 'change_password_notvalid_message',
318 $this->conf[
'changePasswordNotValidMessage_stdWrap.']
320 $subpartArray[
'###CHANGEPASSWORD_FORM###'] =
'';
324 if (isset($postData[
'changepasswordsubmit'])) {
325 if (strlen($postData[
'password1']) < $minLength) {
326 $markerArray[
'###STATUS_MESSAGE###'] = sprintf($this->
getDisplayText(
327 'change_password_tooshort_message',
328 $this->conf[
'changePasswordTooShortMessage_stdWrap.']),
331 }
elseif ($postData[
'password1'] != $postData[
'password2']) {
332 $markerArray[
'###STATUS_MESSAGE###'] = sprintf($this->
getDisplayText(
333 'change_password_notequal_message',
334 $this->conf[
'changePasswordNotEqualMessage_stdWrap.']),
338 $newPass = $postData[
'password1'];
339 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'password_changed']) {
342 'newPassword' => $newPass,
343 'newPasswordUnencrypted' => $newPass
345 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'password_changed'] as $_funcRef) {
350 $newPass = $_params[
'newPassword'];
353 $res = $this->databaseConnection->exec_UPDATEquery(
355 'uid=' . $user[
'uid'],
356 array(
'password' => $newPass,
'felogin_forgotHash' =>
'',
'tstamp' =>
$GLOBALS[
'EXEC_TIME'])
359 'change_password_done_message',
360 $this->conf[
'changePasswordDoneMessage_stdWrap.']
363 $subpartArray[
'###CHANGEPASSWORD_FORM###'] =
'';
364 $markerArray[
'###BACKLINK_LOGIN###'] = $this->
getPageLink(
365 $this->
pi_getLL(
'll_forgot_header_backToLogin',
'',
true),
366 array($this->prefixId .
'[redirectReferrer]' =>
'off')
372 $markerArray[
'###ACTION_URI###'] = $this->
getPageLink(
'', array(
373 $this->prefixId .
'[user]' => $user[
'uid'],
374 $this->prefixId .
'[forgothash]' => $piHash
376 $markerArray[
'###LEGEND###'] = $this->
pi_getLL(
'change_password',
'',
true);
377 $markerArray[
'###NEWPASSWORD1_LABEL###'] = $this->
pi_getLL(
'newpassword_label1',
'',
true);
378 $markerArray[
'###NEWPASSWORD2_LABEL###'] = $this->
pi_getLL(
'newpassword_label2',
'',
true);
379 $markerArray[
'###NEWPASSWORD1###'] = $this->prefixId .
'[password1]';
380 $markerArray[
'###NEWPASSWORD2###'] = $this->prefixId .
'[password2]';
382 $markerArray[
'###SEND_PASSWORD###'] = $this->
pi_getLL(
'change_password',
'',
true);
383 $markerArray[
'###FORGOTHASH###'] = $piHash;
387 return $this->cObj->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
398 $hours = (int)$this->conf[
'forgotLinkHashValidTime'] > 0 ? (
int)$this->conf[
'forgotLinkHashValidTime'] : 24;
399 $validEnd = time() + 3600 * $hours;
400 $validEndString = date($this->conf[
'dateFormat'], $validEnd);
402 $randHash = $validEnd .
'|' . $hash;
403 $randHashDB = $validEnd .
'|' . md5($hash);
405 $res = $this->databaseConnection->exec_UPDATEquery(
'fe_users',
'uid=' . $user[
'uid'], array(
'felogin_forgotHash' => $randHashDB));
407 $this->conf[
'linkPrefix'] = -1;
408 $isAbsRefPrefix = !empty($this->frontendController->absRefPrefix);
409 $isBaseURL = !empty($this->frontendController->baseUrl);
410 $isFeloginBaseURL = !empty($this->conf[
'feloginBaseURL']);
411 $link = $this->
pi_getPageLink($this->frontendController->id,
'', array(
412 rawurlencode($this->prefixId .
'[user]') => $user[
'uid'],
413 rawurlencode($this->prefixId .
'[forgothash]') => $randHash
416 if ($isFeloginBaseURL) {
419 if ($isAbsRefPrefix) {
420 $link = substr($link, strlen($this->frontendController->absRefPrefix));
422 $link = $this->conf[
'feloginBaseURL'] . $link;
423 }
elseif ($isAbsRefPrefix) {
430 $link = $this->frontendController->baseUrlWrap($link);
433 return $this->
pi_getLL(
'll_change_password_nolinkprefix_message');
435 $msg = sprintf($this->
pi_getLL(
'll_forgot_validate_reset_password'), $user[
'username'], $link, $validEndString);
438 isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'forgotPasswordMail'])
439 && is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'forgotPasswordMail'])
445 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'forgotPasswordMail'] as $reference) {
451 if ($user[
'email']) {
452 $this->cObj->sendNotifyEmail($msg, $user[
'email'],
'', $this->conf[
'email_from'], $this->conf[
'email_fromName'], $this->conf[
'replyTo']);
465 $subpart = $this->cObj->getSubpart($this->
template,
'###TEMPLATE_LOGOUT###');
466 $subpartArray = ($linkpartArray = array());
467 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'status_header', $this->conf[
'logoutHeader_stdWrap.']);
468 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'status_message', $this->conf[
'logoutMessage_stdWrap.']);
469 $this->cObj->stdWrap($this->
flexFormValue(
'message',
's_status'), $this->conf[
'logoutMessage_stdWrap.']);
470 $markerArray[
'###LEGEND###'] = $this->
pi_getLL(
'logout',
'',
true);
471 $markerArray[
'###ACTION_URI###'] = $this->
getPageLink(
'', array(),
true);
472 $markerArray[
'###LOGOUT_LABEL###'] = $this->
pi_getLL(
'logout',
'',
true);
473 $markerArray[
'###NAME###'] = htmlspecialchars($this->frontendController->fe_user->user[
'name']);
475 $markerArray[
'###USERNAME###'] = htmlspecialchars($this->frontendController->fe_user->user[
'username']);
476 $markerArray[
'###USERNAME_LABEL###'] = $this->
pi_getLL(
'username',
'',
true);
477 $markerArray[
'###NOREDIRECT###'] = $this->noRedirect ?
'1' :
'0';
480 if ($this->redirectUrl) {
482 $markerArray[
'###ACTION_URI###'] = htmlspecialchars($this->redirectUrl);
483 $this->redirectUrl =
'';
485 return $this->cObj->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
495 $subpart = $this->cObj->getSubpart($this->
template,
'###TEMPLATE_LOGIN###');
496 $subpartArray = ($linkpartArray = ($markerArray = array()));
498 $markerArray[
'###LEGEND###'] = $this->
pi_getLL(
'oLabel_header_welcome',
'',
true);
499 if ($this->logintype ===
'login') {
500 if ($this->userIsLoggedIn) {
502 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'success_header', $this->conf[
'successHeader_stdWrap.']);
503 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'success_message', $this->conf[
'successMessage_stdWrap.']);
505 $subpartArray[
'###LOGIN_FORM###'] =
'';
507 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'login_confirmed']) {
509 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'login_confirmed'] as $_funcRef) {
516 if ($this->conf[
'showLogoutFormAfterLogin']) {
517 $this->redirectUrl =
'';
523 isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'login_error'])
524 && is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'login_error'])
527 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'login_error'] as $funcRef) {
534 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'error_header', $this->conf[
'errorHeader_stdWrap.']);
535 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'error_message', $this->conf[
'errorMessage_stdWrap.']);
539 if ($this->logintype ===
'logout') {
541 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'logout_header', $this->conf[
'logoutHeader_stdWrap.']);
542 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'logout_message', $this->conf[
'logoutMessage_stdWrap.']);
545 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'welcome_header', $this->conf[
'welcomeHeader_stdWrap.']);
546 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'welcome_message', $this->conf[
'welcomeMessage_stdWrap.']);
554 $onSubmitAr = array();
555 $extraHiddenAr = array();
560 $extraHiddenAr[] =
'<input type="hidden" name="referer" value="' . htmlspecialchars(
$referer) .
'" />';
561 if ($this->piVars[
'redirectReferrer'] ===
'off') {
562 $extraHiddenAr[] =
'<input type="hidden" name="' . $this->prefixId .
'[redirectReferrer]" value="off" />';
566 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'loginFormOnSubmitFuncs'])) {
568 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'loginFormOnSubmitFuncs'] as $funcRef) {
570 $onSubmitAr[] = $onSub;
571 $extraHiddenAr[] = $hid;
574 if (!empty($onSubmitAr)) {
575 $onSubmit = implode(
'; ', $onSubmitAr) .
'; return true;';
577 if (!empty($extraHiddenAr)) {
578 $extraHidden = implode(LF, $extraHiddenAr);
580 if (!$gpRedirectUrl && $this->redirectUrl) {
584 $markerArray[
'###ACTION_URI###'] = $this->
getPageLink(
'', array(),
true);
586 $markerArray[
'###EXTRA_HIDDEN###'] = $extraHidden;
587 $markerArray[
'###LEGEND###'] = $this->
pi_getLL(
'login',
'',
true);
588 $markerArray[
'###LOGIN_LABEL###'] = $this->
pi_getLL(
'login',
'',
true);
590 $markerArray[
'###ON_SUBMIT###'] = $onSubmit;
591 $markerArray[
'###PASSWORD_LABEL###'] = $this->
pi_getLL(
'password',
'',
true);
593 $markerArray[
'###USERNAME_LABEL###'] = $this->
pi_getLL(
'username',
'',
true);
594 $markerArray[
'###REDIRECT_URL###'] = htmlspecialchars($gpRedirectUrl);
595 $markerArray[
'###NOREDIRECT###'] = $this->noRedirect ?
'1' :
'0';
598 if ($this->conf[
'showForgotPasswordLink']) {
599 $linkpartArray[
'###FORGOT_PASSWORD_LINK###'] = explode(
'|', $this->
getPageLink(
'|', array($this->prefixId .
'[forgot]' => 1)));
600 $markerArray[
'###FORGOT_PASSWORD###'] = $this->
pi_getLL(
'll_forgot_header',
'',
true);
602 $subpartArray[
'###FORGOTP_VALID###'] =
'';
607 $this->conf[
'showPermaLogin']
609 &&
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'lifetime'] > 0
611 $markerArray[
'###PERMALOGIN###'] = $this->
pi_getLL(
'permalogin',
'',
true);
612 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'permalogin'] == 1) {
613 $markerArray[
'###PERMALOGIN_HIDDENFIELD_ATTRIBUTES###'] =
'disabled="disabled"';
614 $markerArray[
'###PERMALOGIN_CHECKBOX_ATTRIBUTES###'] =
'checked="checked"';
616 $markerArray[
'###PERMALOGIN_HIDDENFIELD_ATTRIBUTES###'] =
'';
617 $markerArray[
'###PERMALOGIN_CHECKBOX_ATTRIBUTES###'] =
'';
620 $subpartArray[
'###PERMALOGIN_VALID###'] =
'';
622 return $this->cObj->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
632 $redirect_url = array();
633 if ($this->conf[
'redirectMode']) {
635 foreach ($redirectMethods as $redirMethod) {
636 if ($this->frontendController->loginUser && $this->logintype ===
'login') {
638 switch ($redirMethod) {
641 $groupData = $this->frontendController->fe_user->groupData;
642 $res = $this->databaseConnection->exec_SELECTquery(
643 'felogin_redirectPid',
644 $this->frontendController->fe_user->usergroup_table,
645 'felogin_redirectPid<>\'\' AND uid IN (' . implode(
',', $groupData[
'uid']) .
')'
647 if ($row = $this->databaseConnection->sql_fetch_row($res)) {
653 $res = $this->databaseConnection->exec_SELECTquery(
654 'felogin_redirectPid',
655 $this->frontendController->fe_user->user_table,
656 $this->frontendController->fe_user->userid_column .
'=' . $this->frontendController->fe_user->user[
'uid'] .
' AND felogin_redirectPid<>\'\''
658 if ($row = $this->databaseConnection->sql_fetch_row($res)) {
663 if ($this->conf[
'redirectPageLogin']) {
664 $redirect_url[] = $this->
pi_getPageLink((
int)$this->conf[
'redirectPageLogin']);
672 if ($this->piVars[
'redirectReferrer'] !==
'off') {
674 $redirect_url[] = preg_replace(
'/[&?]logintype=[a-z]+/',
'', $this->referer);
677 case 'refererDomains':
683 if ($this->conf[
'domains'] && $this->piVars[
'redirectReferrer'] !==
'off') {
687 if (preg_match(
'#^http://([[:alnum:]._-]+)/#',
$url, $match)) {
688 $redirect_domain = $match[1];
691 if (preg_match(
'/(?:^|\\.)' . $d .
'$/', $redirect_domain)) {
702 $redirect_url[] = preg_replace(
'/[&?]logintype=[a-z]+/',
'',
$url);
707 }
elseif ($this->logintype ===
'login') {
709 switch ($redirMethod) {
711 if ($this->conf[
'redirectPageLoginError']) {
712 $redirect_url[] = $this->
pi_getPageLink((
int)$this->conf[
'redirectPageLoginError']);
716 }
elseif ($this->logintype ==
'' && $redirMethod ==
'login' && $this->conf[
'redirectPageLogin']) {
718 $this->cObj->typoLink(
'', array(
719 'parameter' => $this->conf[
'redirectPageLogin'],
720 'linkAccessRestrictedPages' =>
true
722 $redirect_url[] = $this->cObj->lastTypoLinkUrl;
723 }
elseif ($this->logintype ==
'' && $redirMethod ==
'logout' && $this->conf[
'redirectPageLogout'] && $this->frontendController->loginUser) {
725 $redirect_url[] = $this->
pi_getPageLink((
int)$this->conf[
'redirectPageLogout']);
726 }
elseif ($this->logintype ===
'logout') {
729 if ($this->logintype ===
'logout' &&
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'logout_confirmed']) {
731 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'logout_confirmed'] as $_funcRef) {
737 switch ($redirMethod) {
739 if ($this->conf[
'redirectPageLogout']) {
740 $redirect_url[] = $this->
pi_getPageLink((
int)$this->conf[
'redirectPageLogout']);
747 switch ($redirMethod) {
757 if (!empty($redirect_url)) {
772 $flex[
'showForgotPasswordLink'] = $this->
flexFormValue(
'showForgotPassword',
'sDEF');
775 $flex[
'showPermaLogin'] = $this->
flexFormValue(
'showPermaLogin',
'sDEF');
777 if ($this->
flexFormValue(
'showLogoutFormAfterLogin',
'sDEF')) {
778 $flex[
'showLogoutFormAfterLogin'] = $this->
flexFormValue(
'showLogoutFormAfterLogin',
'sDEF');
784 $flex[
'recursive'] = $this->
flexFormValue(
'recursive',
'sDEF');
787 $flex[
'templateFile'] = $this->uploadDir . $this->
flexFormValue(
'templateFile',
'sDEF');
790 $flex[
'redirectMode'] = $this->
flexFormValue(
'redirectMode',
's_redirect');
792 if ($this->
flexFormValue(
'redirectFirstMethod',
's_redirect')) {
793 $flex[
'redirectFirstMethod'] = $this->
flexFormValue(
'redirectFirstMethod',
's_redirect');
796 $flex[
'redirectDisable'] = $this->
flexFormValue(
'redirectDisable',
's_redirect');
798 if ($this->
flexFormValue(
'redirectPageLogin',
's_redirect')) {
799 $flex[
'redirectPageLogin'] = $this->
flexFormValue(
'redirectPageLogin',
's_redirect');
801 if ($this->
flexFormValue(
'redirectPageLoginError',
's_redirect')) {
802 $flex[
'redirectPageLoginError'] = $this->
flexFormValue(
'redirectPageLoginError',
's_redirect');
804 if ($this->
flexFormValue(
'redirectPageLogout',
's_redirect')) {
805 $flex[
'redirectPageLogout'] = $this->
flexFormValue(
'redirectPageLogout',
's_redirect');
807 $pid = $flex[
'pages'] ? $this->
pi_getPidList($flex[
'pages'], $flex[
'recursive']) : 0;
809 $flex[
'storagePid'] = $pid;
811 $this->conf = array_merge($this->conf, $flex);
823 return $this->
pi_getFFvalue($this->cObj->data[
'pi_flexform'], $var, $sheet);
836 $additionalParams =
'';
838 foreach (
$piVars as $key => $val) {
839 $additionalParams .=
'&' . $key .
'=' . $val;
843 if ($this->conf[
'preserveGETvars']) {
846 $this->conf[
'linkConfig.'][
'parameter'] = $this->frontendController->id;
847 if ($additionalParams) {
848 $this->conf[
'linkConfig.'][
'additionalParams'] = $additionalParams;
851 return htmlspecialchars($this->cObj->typoLink_URL($this->conf[
'linkConfig.']));
853 return $this->cObj->typoLink($label, $this->conf[
'linkConfig.']);
870 $getVars[
'no_cache'],
871 $getVars[
'logintype'],
872 $getVars[
'redirect_url'],
874 $getVars[$this->prefixId]
876 if ($this->conf[
'preserveGETvars'] ===
'all') {
877 $preserveQueryParts = $getVars;
881 $preserveQueryParts = \TYPO3\CMS\Core\Utility\ArrayUtility::intersectRecursive($getVars, $preserveQueryParts);
900 $pass .= chr($char - 10 + 97);
915 $text = $this->
flexFormValue($label,
's_messages') ? $this->cObj->stdWrap($this->
flexFormValue($label,
's_messages'), $stdWrapArray) : $this->cObj->stdWrap($this->
pi_getLL(
'll_' . $label,
'',
true), $stdWrapArray);
917 return strtr($text, $replace);
929 if ($this->frontendController->fe_user->user) {
931 foreach ($this->frontendController->fe_user->user as $field => $value) {
932 $marker[
'###FEUSER_' .
GeneralUtility::strtoupper($field) .
'###'] = $this->cObj->stdWrap($value, $this->conf[
'userfields.'][$field .
'.']);
935 $marker[
'###USER###'] = $marker[
'###FEUSER_USERNAME###'];
952 $decodedUrl = rawurldecode(
$url);
954 if ($decodedUrl !== $sanitizedUrl || preg_match(
'#["<>\\\\]+#',
$url)) {
976 $urlWithoutSchema = preg_replace(
'#^https?://#',
'',
$url);
993 $parsedUrl = parse_url(
$url);
994 if ($parsedUrl[
'scheme'] ===
'http' || $parsedUrl[
'scheme'] ===
'https') {
995 $host = $parsedUrl[
'host'];
997 $path = preg_replace(
'#/+[^/]*$#',
'', $parsedUrl[
'path']);
998 $localDomains = $this->databaseConnection->exec_SELECTgetRows(
'domainName',
'sys_domain',
'1=1' . $this->cObj->enableFields(
'sys_domain'));
999 if (is_array($localDomains)) {
1000 foreach ($localDomains as $localDomain) {
1002 $domainName = rtrim($localDomain[
'domainName'],
'/');
1023 $parsedUrl = @parse_url(
$url);
1024 if ($parsedUrl !==
false && !isset($parsedUrl[
'scheme']) && !isset($parsedUrl[
'host'])) {