110 $this->uploadDir =
'uploads/tx_felogin/';
119 if ($this->conf[
'storagePid']) {
120 if ((
int)$this->conf[
'recursive']) {
121 $this->spid = $this->
pi_getPidList($this->conf[
'storagePid'], (
int)$this->conf[
'recursive']);
123 $this->spid = $this->conf[
'storagePid'];
126 $pids =
$GLOBALS[
'TSFE']->getStorageSiterootPids();
127 $this->spid = $pids[
'_STORAGE_PID'];
132 $this->noRedirect = $this->piVars[
'noredirect'] || $this->conf[
'redirectDisable'];
136 $this->redirectUrl = $returnUrl;
142 $templateFile = $this->conf[
'templateFile'] ?:
'EXT:felogin/template.html';
143 $this->
template = $this->cObj->fileResource($templateFile);
145 $this->userIsLoggedIn =
$GLOBALS[
'TSFE']->loginUser;
147 if ($this->conf[
'redirectMode'] && !$this->conf[
'redirectDisable'] && !$this->noRedirect) {
152 $this->redirectUrl =
'';
157 if ($this->piVars[
'forgot'] && $this->conf[
'showForgotPasswordLink']) {
159 } elseif ($this->piVars[
'forgothash']) {
162 if ($this->userIsLoggedIn && !$this->logintype) {
169 if (($this->logintype ===
'login' || $this->logintype ===
'logout') && $this->redirectUrl && !$this->noRedirect) {
171 $content .= $this->cObj->stdWrap($this->
pi_getLL(
'cookie_warning'), $this->conf[
'cookieWarning_stdWrap.']);
175 isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'beforeRedirect']) &&
176 is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'beforeRedirect'])
179 'loginType' => $this->logintype,
180 'redirectUrl' => &$this->redirectUrl
182 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'beforeRedirect'] as $_funcRef) {
193 isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'postProcContent'])
194 && is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'postProcContent'])
197 'content' => $content
199 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'postProcContent'] as $_funcRef) {
203 return $this->conf[
'wrapContentInBaseClass'] ? $this->
pi_wrapInBaseClass($content) : $content;
212 $subpart = $this->cObj->getSubpart($this->
template,
'###TEMPLATE_FORGOT###');
213 $subpartArray = ($linkpartArray = array());
215 if ($postData[
'forgot_email']) {
217 $postedHash = $postData[
'forgot_hash'];
218 $hashData =
$GLOBALS[
'TSFE']->fe_user->getKey(
'ses',
'forgot_hash');
219 if ($postedHash === $hashData[
'forgot_hash']) {
222 $data =
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($this->piVars[
'forgot_email'],
'fe_users');
223 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
224 'uid, username, password, email',
226 '(email=' . $data .
' OR username=' . $data .
') AND pid IN (' .
$GLOBALS[
'TYPO3_DB']->cleanIntList($this->spid) .
') ' . $this->cObj->enableFields(
'fe_users')
228 if (
$GLOBALS[
'TYPO3_DB']->sql_num_rows($res)) {
229 $row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
235 } elseif ($this->conf[
'exposeNonexistentUserInForgotPasswordDialog']) {
236 $error = $this->
pi_getLL(
'll_forgot_reset_message_error');
240 $markerArray[
'###STATUS_MESSAGE###'] = $this->cObj->stdWrap($error, $this->conf[
'forgotErrorMessage_stdWrap.']);
242 $markerArray[
'###STATUS_MESSAGE###'] = $this->cObj->stdWrap(
243 $this->
pi_getLL(
'll_forgot_reset_message_emailSent'),
244 $this->conf[
'forgotResetMessageEmailSentMessage_stdWrap.']
247 $subpartArray[
'###FORGOT_FORM###'] =
'';
250 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'forgot_reset_message', $this->conf[
'forgotMessage_stdWrap.']);
251 $markerArray[
'###BACKLINK_LOGIN###'] =
'';
254 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'forgot_reset_message', $this->conf[
'forgotMessage_stdWrap.']);
255 $markerArray[
'###BACKLINK_LOGIN###'] =
'';
257 $markerArray[
'###BACKLINK_LOGIN###'] = $this->
getPageLink($this->
pi_getLL(
'll_forgot_header_backToLogin',
'', TRUE), array());
258 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'forgot_header', $this->conf[
'forgotHeader_stdWrap.']);
259 $markerArray[
'###LEGEND###'] = $this->
pi_getLL(
'legend', $this->
pi_getLL(
'reset_password'), TRUE);
260 $markerArray[
'###ACTION_URI###'] = $this->
getPageLink(
'', array($this->prefixId .
'[forgot]' => 1), TRUE);
261 $markerArray[
'###EMAIL_LABEL###'] = $this->
pi_getLL(
'your_email',
'', TRUE);
262 $markerArray[
'###FORGOT_PASSWORD_ENTEREMAIL###'] = $this->
pi_getLL(
'forgot_password_enterEmail',
'', TRUE);
263 $markerArray[
'###FORGOT_EMAIL###'] = $this->prefixId .
'[forgot_email]';
264 $markerArray[
'###SEND_PASSWORD###'] = $this->
pi_getLL(
'reset_password',
'', TRUE);
265 $markerArray[
'###DATA_LABEL###'] = $this->
pi_getLL(
'll_enter_your_data',
'', TRUE);
269 $markerArray[
'###FORGOTHASH###'] = $hash;
271 $GLOBALS[
'TSFE']->fe_user->setKey(
'ses',
'forgot_hash', array(
'forgot_hash' => $hash));
272 return $this->cObj->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
282 $subpartArray = ($linkpartArray = array());
284 $minLength = (int)$this->conf[
'newPasswordMinLength'] ?: 6;
285 $subpart = $this->cObj->getSubpart($this->
template,
'###TEMPLATE_CHANGEPASSWORD###');
286 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'change_password_header', $this->conf[
'changePasswordHeader_stdWrap.']);
287 $markerArray[
'###STATUS_MESSAGE###'] = sprintf($this->
getDisplayText(
288 'change_password_message',
289 $this->conf[
'changePasswordMessage_stdWrap.']
292 $markerArray[
'###BACKLINK_LOGIN###'] =
'';
293 $uid = $this->piVars[
'user'];
294 $piHash = $this->piVars[
'forgothash'];
295 $hash = explode(
'|', $piHash);
296 if ((
int)
$uid === 0) {
298 'change_password_notvalid_message',
299 $this->conf[
'changePasswordNotValidMessage_stdWrap.']
301 $subpartArray[
'###CHANGEPASSWORD_FORM###'] =
'';
304 $userHash = $user[
'felogin_forgotHash'];
305 $compareHash = explode(
'|', $userHash);
306 if (!$compareHash || !$compareHash[1] || $compareHash[0] < time() || $hash[0] != $compareHash[0] || md5($hash[1]) != $compareHash[1]) {
308 'change_password_notvalid_message',
309 $this->conf[
'changePasswordNotValidMessage_stdWrap.']
311 $subpartArray[
'###CHANGEPASSWORD_FORM###'] =
'';
315 if (isset($postData[
'changepasswordsubmit'])) {
316 if (strlen($postData[
'password1']) < $minLength) {
317 $markerArray[
'###STATUS_MESSAGE###'] = sprintf($this->
getDisplayText(
318 'change_password_tooshort_message',
319 $this->conf[
'changePasswordTooShortMessage_stdWrap.']),
322 } elseif ($postData[
'password1'] != $postData[
'password2']) {
323 $markerArray[
'###STATUS_MESSAGE###'] = sprintf($this->
getDisplayText(
324 'change_password_notequal_message',
325 $this->conf[
'changePasswordNotEqualMessage_stdWrap.']),
329 $newPass = $postData[
'password1'];
330 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'password_changed']) {
333 'newPassword' => $newPass
335 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'password_changed'] as $_funcRef) {
340 $newPass = $_params[
'newPassword'];
343 $res =
$GLOBALS[
'TYPO3_DB']->exec_UPDATEquery(
345 'uid=' . $user[
'uid'],
346 array(
'password' => $newPass,
'felogin_forgotHash' =>
'',
'tstamp' =>
$GLOBALS[
'EXEC_TIME'])
349 'change_password_done_message',
350 $this->conf[
'changePasswordDoneMessage_stdWrap.']
353 $subpartArray[
'###CHANGEPASSWORD_FORM###'] =
'';
354 $markerArray[
'###BACKLINK_LOGIN###'] = $this->
getPageLink(
355 $this->
pi_getLL(
'll_forgot_header_backToLogin',
'', TRUE),
356 array($this->prefixId .
'[redirectReferrer]' =>
'off')
362 $markerArray[
'###ACTION_URI###'] = $this->
getPageLink(
'', array(
363 $this->prefixId .
'[user]' => $user[
'uid'],
364 $this->prefixId .
'[forgothash]' => $piHash
366 $markerArray[
'###LEGEND###'] = $this->
pi_getLL(
'change_password',
'', TRUE);
367 $markerArray[
'###NEWPASSWORD1_LABEL###'] = $this->
pi_getLL(
'newpassword_label1',
'', TRUE);
368 $markerArray[
'###NEWPASSWORD2_LABEL###'] = $this->
pi_getLL(
'newpassword_label2',
'', TRUE);
369 $markerArray[
'###NEWPASSWORD1###'] = $this->prefixId .
'[password1]';
370 $markerArray[
'###NEWPASSWORD2###'] = $this->prefixId .
'[password2]';
371 $markerArray[
'###STORAGE_PID###'] = $this->spid;
372 $markerArray[
'###SEND_PASSWORD###'] = $this->
pi_getLL(
'change_password',
'', TRUE);
373 $markerArray[
'###FORGOTHASH###'] = $piHash;
377 return $this->cObj->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
387 $hours = (int)$this->conf[
'forgotLinkHashValidTime'] > 0 ? (
int)$this->conf[
'forgotLinkHashValidTime'] : 24;
388 $validEnd = time() + 3600 * $hours;
389 $validEndString = date($this->conf[
'dateFormat'], $validEnd);
391 $randHash = $validEnd .
'|' . $hash;
392 $randHashDB = $validEnd .
'|' . md5($hash);
394 $res =
$GLOBALS[
'TYPO3_DB']->exec_UPDATEquery(
'fe_users',
'uid=' . $user[
'uid'], array(
'felogin_forgotHash' => $randHashDB));
396 $this->conf[
'linkPrefix'] = -1;
397 $isAbsRelPrefix = !empty(
$GLOBALS[
'TSFE']->absRefPrefix);
398 $isBaseURL = !empty(
$GLOBALS[
'TSFE']->baseUrl);
399 $isFeloginBaseURL = !empty($this->conf[
'feloginBaseURL']);
401 rawurlencode($this->prefixId .
'[user]') => $user[
'uid'],
402 rawurlencode($this->prefixId .
'[forgothash]') => $randHash
405 if ($isFeloginBaseURL) {
408 if (!empty(
$GLOBALS[
'TSFE']->absRefPrefix)) {
409 $link = substr($link, strlen(
$GLOBALS[
'TSFE']->absRefPrefix));
411 $link = $this->conf[
'feloginBaseURL'] . $link;
412 } elseif ($isAbsRelPrefix) {
416 } elseif ($isBaseURL) {
419 $link =
$GLOBALS[
'TSFE']->baseUrlWrap($link);
422 return $this->
pi_getLL(
'll_change_password_nolinkprefix_message');
424 $msg = sprintf($this->
pi_getLL(
'll_forgot_validate_reset_password'), $user[
'username'], $link, $validEndString);
427 isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'forgotPasswordMail'])
428 && is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'forgotPasswordMail'])
434 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'forgotPasswordMail'] as $reference) {
441 $oldSetting =
$GLOBALS[
'TSFE']->config[
'config'][
'notification_email_urlmode'];
442 $GLOBALS[
'TSFE']->config[
'config'][
'notification_email_urlmode'] = 0;
444 $this->cObj->sendNotifyEmail($msg, $user[
'email'],
'', $this->conf[
'email_from'], $this->conf[
'email_fromName'], $this->conf[
'replyTo']);
446 $GLOBALS[
'TSFE']->config[
'config'][
'notification_email_urlmode'] = $oldSetting;
456 $subpart = $this->cObj->getSubpart($this->
template,
'###TEMPLATE_LOGOUT###');
457 $subpartArray = ($linkpartArray = array());
458 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'status_header', $this->conf[
'logoutHeader_stdWrap.']);
459 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'status_message', $this->conf[
'logoutMessage_stdWrap.']);
460 $this->cObj->stdWrap($this->
flexFormValue(
'message',
's_status'), $this->conf[
'logoutMessage_stdWrap.']);
461 $markerArray[
'###LEGEND###'] = $this->
pi_getLL(
'logout',
'', TRUE);
462 $markerArray[
'###ACTION_URI###'] = $this->
getPageLink(
'', array(), TRUE);
463 $markerArray[
'###LOGOUT_LABEL###'] = $this->
pi_getLL(
'logout',
'', TRUE);
464 $markerArray[
'###NAME###'] = htmlspecialchars(
$GLOBALS[
'TSFE']->fe_user->user[
'name']);
465 $markerArray[
'###STORAGE_PID###'] = $this->spid;
466 $markerArray[
'###USERNAME###'] = htmlspecialchars(
$GLOBALS[
'TSFE']->fe_user->user[
'username']);
467 $markerArray[
'###USERNAME_LABEL###'] = $this->
pi_getLL(
'username',
'', TRUE);
468 $markerArray[
'###NOREDIRECT###'] = $this->noRedirect ?
'1' :
'0';
471 if ($this->redirectUrl) {
473 $markerArray[
'###ACTION_URI###'] = htmlspecialchars($this->redirectUrl);
474 $this->redirectUrl =
'';
476 return $this->cObj->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
485 $subpart = $this->cObj->getSubpart($this->
template,
'###TEMPLATE_LOGIN###');
486 $subpartArray = ($linkpartArray = ($markerArray = array()));
488 $markerArray[
'###LEGEND###'] = $this->
pi_getLL(
'oLabel_header_welcome',
'', TRUE);
489 if ($this->logintype ===
'login') {
490 if ($this->userIsLoggedIn) {
492 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'success_header', $this->conf[
'successHeader_stdWrap.']);
493 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'success_message', $this->conf[
'successMessage_stdWrap.']);
495 $subpartArray[
'###LOGIN_FORM###'] =
'';
497 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'login_confirmed']) {
499 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'login_confirmed'] as $_funcRef) {
506 if ($this->conf[
'showLogoutFormAfterLogin']) {
507 $this->redirectUrl =
'';
513 isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'login_error'])
514 && is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'login_error'])
517 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'login_error'] as $funcRef) {
524 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'error_header', $this->conf[
'errorHeader_stdWrap.']);
525 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'error_message', $this->conf[
'errorMessage_stdWrap.']);
529 if ($this->logintype ===
'logout') {
531 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'logout_header', $this->conf[
'logoutHeader_stdWrap.']);
532 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'logout_message', $this->conf[
'logoutMessage_stdWrap.']);
535 $markerArray[
'###STATUS_HEADER###'] = $this->
getDisplayText(
'welcome_header', $this->conf[
'welcomeHeader_stdWrap.']);
536 $markerArray[
'###STATUS_MESSAGE###'] = $this->
getDisplayText(
'welcome_message', $this->conf[
'welcomeMessage_stdWrap.']);
544 $onSubmitAr = array();
545 $extraHiddenAr = array();
550 $extraHiddenAr[] =
'<input type="hidden" name="referer" value="' . htmlspecialchars($referer) .
'" />';
551 if ($this->piVars[
'redirectReferrer'] ===
'off') {
552 $extraHiddenAr[] =
'<input type="hidden" name="' . $this->prefixId .
'[redirectReferrer]" value="off" />';
556 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'loginFormOnSubmitFuncs'])) {
558 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'loginFormOnSubmitFuncs'] as $funcRef) {
560 $onSubmitAr[] = $onSub;
561 $extraHiddenAr[] = $hid;
564 if (count($onSubmitAr)) {
565 $onSubmit = implode(
'; ', $onSubmitAr) .
'; return true;';
567 if (count($extraHiddenAr)) {
568 $extraHidden = implode(LF, $extraHiddenAr);
570 if (!$gpRedirectUrl && $this->redirectUrl) {
574 $markerArray[
'###ACTION_URI###'] = $this->
getPageLink(
'', array(), TRUE);
576 $markerArray[
'###EXTRA_HIDDEN###'] = $extraHidden;
577 $markerArray[
'###LEGEND###'] = $this->
pi_getLL(
'login',
'', TRUE);
578 $markerArray[
'###LOGIN_LABEL###'] = $this->
pi_getLL(
'login',
'', TRUE);
580 $markerArray[
'###ON_SUBMIT###'] = $onSubmit;
581 $markerArray[
'###PASSWORD_LABEL###'] = $this->
pi_getLL(
'password',
'', TRUE);
582 $markerArray[
'###STORAGE_PID###'] = $this->spid;
583 $markerArray[
'###USERNAME_LABEL###'] = $this->
pi_getLL(
'username',
'', TRUE);
584 $markerArray[
'###REDIRECT_URL###'] = htmlspecialchars($gpRedirectUrl);
585 $markerArray[
'###NOREDIRECT###'] = $this->noRedirect ?
'1' :
'0';
588 if ($this->conf[
'showForgotPasswordLink']) {
589 $linkpartArray[
'###FORGOT_PASSWORD_LINK###'] = explode(
'|', $this->
getPageLink(
'|', array($this->prefixId .
'[forgot]' => 1)));
590 $markerArray[
'###FORGOT_PASSWORD###'] = $this->
pi_getLL(
'll_forgot_header',
'', TRUE);
592 $subpartArray[
'###FORGOTP_VALID###'] =
'';
597 $this->conf[
'showPermaLogin']
599 &&
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'lifetime'] > 0
601 $markerArray[
'###PERMALOGIN###'] = $this->
pi_getLL(
'permalogin',
'', TRUE);
602 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'permalogin'] == 1) {
603 $markerArray[
'###PERMALOGIN_HIDDENFIELD_ATTRIBUTES###'] =
'disabled="disabled"';
604 $markerArray[
'###PERMALOGIN_CHECKBOX_ATTRIBUTES###'] =
'checked="checked"';
606 $markerArray[
'###PERMALOGIN_HIDDENFIELD_ATTRIBUTES###'] =
'';
607 $markerArray[
'###PERMALOGIN_CHECKBOX_ATTRIBUTES###'] =
'';
610 $subpartArray[
'###PERMALOGIN_VALID###'] =
'';
612 return $this->cObj->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
621 $redirect_url = array();
622 if ($this->conf[
'redirectMode']) {
624 foreach ($redirectMethods as $redirMethod) {
625 if (
$GLOBALS[
'TSFE']->loginUser && $this->logintype ===
'login') {
627 switch ($redirMethod) {
630 $groupData =
$GLOBALS[
'TSFE']->fe_user->groupData;
631 if (!empty($groupData[
'uid'])) {
633 $row =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
634 'felogin_redirectPid',
635 $GLOBALS[
'TSFE']->fe_user->usergroup_table,
636 'felogin_redirectPid<>\'\' AND uid IN (' . implode(
',', $groupData[
'uid']) .
')' 639 $redirect_url[] = $this->
pi_getPageLink($row[
'felogin_redirectPid']);
644 $row =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
645 'felogin_redirectPid',
646 $GLOBALS[
'TSFE']->fe_user->user_table,
647 $GLOBALS[
'TSFE']->fe_user->userid_column .
'=' .
$GLOBALS[
'TSFE']->fe_user->user[
'uid'] .
' AND felogin_redirectPid<>\'\'' 650 $redirect_url[] = $this->
pi_getPageLink($row[
'felogin_redirectPid']);
654 if ($this->conf[
'redirectPageLogin']) {
655 $redirect_url[] = $this->
pi_getPageLink((
int)$this->conf[
'redirectPageLogin']);
663 if ($this->piVars[
'redirectReferrer'] !==
'off') {
665 $redirect_url[] = preg_replace(
'/[&?]logintype=[a-z]+/',
'', $this->referer);
668 case 'refererDomains':
674 if ($this->conf[
'domains'] && $this->piVars[
'redirectReferrer'] !==
'off') {
675 $url = $this->referer;
678 if (preg_match(
'#^http://([[:alnum:]._-]+)/#', $url, $match)) {
679 $redirect_domain = $match[1];
682 if (preg_match(
'/(?:^|\\.)' . $d .
'$/', $redirect_domain)) {
693 $redirect_url[] = preg_replace(
'/[&?]logintype=[a-z]+/',
'', $url);
698 } elseif ($this->logintype ===
'login') {
700 switch ($redirMethod) {
702 if ($this->conf[
'redirectPageLoginError']) {
703 $redirect_url[] = $this->
pi_getPageLink((
int)$this->conf[
'redirectPageLoginError']);
707 } elseif ($this->logintype ==
'' && $redirMethod ==
'login' && $this->conf[
'redirectPageLogin']) {
709 $this->cObj->typolink(
'', array(
710 'parameter' => $this->conf[
'redirectPageLogin'],
711 'linkAccessRestrictedPages' => TRUE
713 $redirect_url[] = $this->cObj->lastTypoLinkUrl;
714 } elseif ($this->logintype ==
'' && $redirMethod ==
'logout' && $this->conf[
'redirectPageLogout'] &&
$GLOBALS[
'TSFE']->loginUser) {
716 $redirect_url[] = $this->
pi_getPageLink((
int)$this->conf[
'redirectPageLogout']);
717 } elseif ($this->logintype ===
'logout') {
720 if ($this->logintype ===
'logout' &&
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'logout_confirmed']) {
722 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'felogin'][
'logout_confirmed'] as $_funcRef) {
728 switch ($redirMethod) {
730 if ($this->conf[
'redirectPageLogout']) {
731 $redirect_url[] = $this->
pi_getPageLink((
int)$this->conf[
'redirectPageLogout']);
738 switch ($redirMethod) {
748 if (count($redirect_url)) {
763 $flex[
'showForgotPasswordLink'] = $this->
flexFormValue(
'showForgotPassword',
'sDEF');
766 $flex[
'showPermaLogin'] = $this->
flexFormValue(
'showPermaLogin',
'sDEF');
768 if ($this->
flexFormValue(
'showLogoutFormAfterLogin',
'sDEF')) {
769 $flex[
'showLogoutFormAfterLogin'] = $this->
flexFormValue(
'showLogoutFormAfterLogin',
'sDEF');
775 $flex[
'recursive'] = $this->
flexFormValue(
'recursive',
'sDEF');
778 $flex[
'templateFile'] = $this->uploadDir . $this->
flexFormValue(
'templateFile',
'sDEF');
781 $flex[
'redirectMode'] = $this->
flexFormValue(
'redirectMode',
's_redirect');
783 if ($this->
flexFormValue(
'redirectFirstMethod',
's_redirect')) {
784 $flex[
'redirectFirstMethod'] = $this->
flexFormValue(
'redirectFirstMethod',
's_redirect');
787 $flex[
'redirectDisable'] = $this->
flexFormValue(
'redirectDisable',
's_redirect');
789 if ($this->
flexFormValue(
'redirectPageLogin',
's_redirect')) {
790 $flex[
'redirectPageLogin'] = $this->
flexFormValue(
'redirectPageLogin',
's_redirect');
792 if ($this->
flexFormValue(
'redirectPageLoginError',
's_redirect')) {
793 $flex[
'redirectPageLoginError'] = $this->
flexFormValue(
'redirectPageLoginError',
's_redirect');
795 if ($this->
flexFormValue(
'redirectPageLogout',
's_redirect')) {
796 $flex[
'redirectPageLogout'] = $this->
flexFormValue(
'redirectPageLogout',
's_redirect');
798 $pid = $flex[
'pages'] ? $this->
pi_getPidList($flex[
'pages'], $flex[
'recursive']) : 0;
800 $flex[
'storagePid'] = $pid;
802 $this->conf = array_merge($this->conf, $flex);
813 return $this->
pi_getFFvalue($this->cObj->data[
'pi_flexform'], $var, $sheet);
825 $additionalParams =
'';
827 foreach (
$piVars as $key => $val) {
828 $additionalParams .=
'&' . $key .
'=' . $val;
832 if ($this->conf[
'preserveGETvars']) {
835 $this->conf[
'linkConfig.'][
'parameter'] =
$GLOBALS[
'TSFE']->id;
836 if ($additionalParams) {
837 $this->conf[
'linkConfig.'][
'additionalParams'] = $additionalParams;
840 return htmlspecialchars($this->cObj->typolink_url($this->conf[
'linkConfig.']));
842 return $this->cObj->typolink($label, $this->conf[
'linkConfig.']);
858 $getVars[
'no_cache'],
859 $getVars[
'logintype'],
860 $getVars[
'redirect_url'],
862 $getVars[$this->prefixId]
864 if ($this->conf[
'preserveGETvars'] ===
'all') {
865 $preserveQueryParts = $getVars;
889 $pass .= chr($char - 10 + 97);
903 $text = $this->
flexFormValue($label,
's_messages') ? $this->cObj->stdWrap($this->
flexFormValue($label,
's_messages'), $stdWrapArray) : $this->cObj->stdWrap($this->
pi_getLL(
'll_' . $label), $stdWrapArray);
905 return strtr($text, $replace);
916 if (
$GLOBALS[
'TSFE']->fe_user->user) {
918 foreach (
$GLOBALS[
'TSFE']->fe_user->user as $field => $value) {
919 $marker[
'###FEUSER_' .
GeneralUtility::strtoupper($field) .
'###'] = $this->cObj->stdWrap($value, $this->conf[
'userfields.'][$field .
'.']);
922 $marker[
'###USER###'] = $marker[
'###FEUSER_USERNAME###'];
938 $decodedUrl = rawurldecode($url);
940 if ($decodedUrl !== $sanitizedUrl || preg_match(
'#["<>\\\\]+#', $url)) {
961 $urlWithoutSchema = preg_replace(
'#^https?://#',
'', $url);
977 $parsedUrl = parse_url($url);
978 if ($parsedUrl[
'scheme'] ===
'http' || $parsedUrl[
'scheme'] ===
'https') {
979 $host = $parsedUrl[
'host'];
981 $path = preg_replace(
'#/+[^/]*$#',
'', $parsedUrl[
'path']);
982 $localDomains =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'domainName',
'sys_domain',
'1=1' . $this->cObj->enableFields(
'sys_domain'));
983 if (is_array($localDomains)) {
984 foreach ($localDomains as $localDomain) {
986 $domainName = rtrim($localDomain[
'domainName'],
'/');
1006 $parsedUrl = @parse_url($url);
1007 if ($parsedUrl !== FALSE && !isset($parsedUrl[
'scheme']) && !isset($parsedUrl[
'host'])) {
getDisplayText($label, $stdWrapArray=array())
pi_getFFvalue($T3FlexForm_array, $fieldName, $sheet='sDEF', $lang='lDEF', $value='vDEF')
static explodeUrl2Array($string, $multidim=FALSE)
validateRedirectUrl($url)
pi_initPIflexForm($field='pi_flexform')
flexFormValue($var, $sheet)
static isFirstPartOfStr($str, $partStr)
pi_getRecord($table, $uid, $checkPage=0)
static getIndpEnv($getEnvName)
getPageLink($label, $piVars, $returnUrl=FALSE)
generateAndSendHash($user)
static generateRandomBytes($bytesToReturn)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
static removeXSS($string)
const SYSLOG_SEVERITY_WARNING
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
mergeflexFormValuesIntoConf()
pi_getPidList($pid_list, $recursive=0)
static locationHeaderUrl($path)
pi_getLL($key, $alternativeLabel='', $hsc=FALSE)
pi_getPageLink($id, $target='', $urlParameters=array())
static intersectRecursive(array $source, array $mask=array())
static implodeArrayForUrl($name, array $theArray, $str='', $skipBlank=FALSE, $rawurlencodeParamName=FALSE)
static redirect($url, $httpStatus=self::HTTP_STATUS_303)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static inList($list, $item)