163 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'loginSecurityLevel']) {
164 $this->loginSecurityLevel =
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'loginSecurityLevel'];
170 if ($preferredBrowserLanguage !==
'default' && empty(
$GLOBALS[
'BE_USER']->user[
'uid'])) {
171 $GLOBALS[
'LANG']->init($preferredBrowserLanguage);
173 $GLOBALS[
'LANG']->includeLLFile(
'EXT:lang/locallang_login.xlf');
175 $this->redirectToURL = $this->redirect_url ?:
'backend.php';
177 if ($this->L ==
'OUT' && is_object(
$GLOBALS[
'BE_USER'])) {
179 if ($this->redirect_url) {
192 public function main() {
194 $GLOBALS[
'TBE_TEMPLATE']->bodyTagAdditions =
' onload="startUp();"';
195 $GLOBALS[
'TBE_TEMPLATE']->moduleTemplate =
$GLOBALS[
'TBE_TEMPLATE']->getHtmlTemplate(
'EXT:backend/Resources/Private/Templates/login.html');
197 $pageRenderer =
$GLOBALS[
'TBE_TEMPLATE']->getPageRenderer();
198 $pageRenderer->loadExtJS();
199 $pageRenderer->loadPrototype();
200 $pageRenderer->loadScriptaculous();
205 $this->checkRedirect();
209 if (empty(
$GLOBALS[
'BE_USER']->user[
'uid'])) {
214 <form action="index.php" method="post" name="loginform"> 215 <input type="hidden" name="login_status" value="logout" /> 220 $this->content .=
$GLOBALS[
'TBE_TEMPLATE']->startPage(
'TYPO3 CMS Login: ' .
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'sitename'], FALSE);
222 $this->content .= $this->wrapLoginForm($loginForm);
223 $this->content .=
$GLOBALS[
'TBE_TEMPLATE']->endPage();
251 'VALUE_USERNAME' => htmlspecialchars($this->u),
252 'VALUE_PASSWORD' => htmlspecialchars($this->p),
253 'VALUE_OPENID_URL' => htmlspecialchars($this->openIdUrl),
254 'VALUE_SUBMIT' =>
$GLOBALS[
'LANG']->getLL(
'labels.submitLogin', TRUE)
260 $markers[
'ERROR_MESSAGE'] =
$GLOBALS[
'LANG']->getLL(
'error.login', TRUE);
261 $markers[
'ERROR_LOGIN_TITLE'] =
$GLOBALS[
'LANG']->getLL(
'error.login.title', TRUE);
262 $markers[
'ERROR_LOGIN_DESCRIPTION'] =
$GLOBALS[
'LANG']->getLL(
'error.login.description', TRUE);
265 if (!($this->interfaceSelector && !$this->loginRefresh)) {
268 $markers[
'LABEL_INTERFACE'] =
$GLOBALS[
'LANG']->getLL(
'labels.interface', TRUE);
284 'LABEL_USERNAME' =>
$GLOBALS[
'LANG']->getLL(
'labels.username', TRUE),
285 'VALUE_USERNAME' => htmlspecialchars(
$GLOBALS[
'BE_USER']->user[
'username']),
286 'VALUE_SUBMIT' =>
$GLOBALS[
'LANG']->getLL(
'labels.submitLogout', TRUE)
289 if (!$this->interfaceSelector_jump) {
292 $markers[
'LABEL_INTERFACE'] =
$GLOBALS[
'LANG']->getLL(
'labels.interface', TRUE);
305 public function wrapLoginForm(
$content) {
307 if (
$GLOBALS[
'TBE_STYLES'][
'logo_login']) {
308 $logo =
'<img src="' . htmlspecialchars((
$GLOBALS[
'BACK_PATH'] .
$GLOBALS[
'TBE_STYLES'][
'logo_login'])) .
'" alt="" class="t3-login-logo" />';
310 $logo =
'<img' .
IconUtility::skinImg(
$GLOBALS[
'BACK_PATH'],
'gfx/typo3logo.gif',
'width="123" height="34"') .
' alt="" class="t3-login-logo" />';
314 $browserWarning = $browserWarning->render();
315 $additionalCssClasses = array();
317 $additionalCssClasses[] =
'error';
319 if ($this->loginRefresh) {
320 $additionalCssClasses[] =
'refresh';
326 'NEWS' => $this->makeLoginNews(),
328 'CSS_CLASSES' => !empty($additionalCssClasses) ?
'class="' . implode(
' ', $additionalCssClasses) .
'"' :
'',
332 'HEADLINE' =>
$GLOBALS[
'LANG']->getLL(
'headline', TRUE),
333 'INFO_ABOUT' =>
$GLOBALS[
'LANG']->getLL(
'info.about', TRUE),
334 'INFO_RELOAD' =>
$GLOBALS[
'LANG']->getLL(
'info.reset', TRUE),
335 'INFO' =>
$GLOBALS[
'LANG']->getLL(
'info.cookies_and_js', TRUE),
336 'WARNING_BROWSER_INCOMPATIBLE' => $browserWarning,
337 'ERROR_JAVASCRIPT' =>
$GLOBALS[
'LANG']->getLL(
'error.javascript', TRUE),
338 'ERROR_COOKIES' =>
$GLOBALS[
'LANG']->getLL(
'error.cookies', TRUE),
339 'ERROR_COOKIES_IGNORE' =>
$GLOBALS[
'LANG']->getLL(
'error.cookies_ignore', TRUE),
340 'ERROR_CAPSLOCK' =>
$GLOBALS[
'LANG']->getLL(
'error.capslock', TRUE),
341 'ERROR_FURTHERHELP' =>
$GLOBALS[
'LANG']->getLL(
'error.furtherInformation', TRUE),
342 'LABEL_DONATELINK' =>
$GLOBALS[
'LANG']->getLL(
'labels.donate', TRUE),
343 'LABEL_USERNAME' =>
$GLOBALS[
'LANG']->getLL(
'labels.username', TRUE),
344 'LABEL_OPENID' =>
$GLOBALS[
'LANG']->getLL(
'labels.openId', TRUE),
345 'LABEL_PASSWORD' =>
$GLOBALS[
'LANG']->getLL(
'labels.password', TRUE),
346 'LABEL_WHATISOPENID' =>
$GLOBALS[
'LANG']->getLL(
'labels.whatIsOpenId', TRUE),
347 'LABEL_SWITCHOPENID' =>
$GLOBALS[
'LANG']->getLL(
'labels.switchToOpenId', TRUE),
348 'LABEL_SWITCHDEFAULT' =>
$GLOBALS[
'LANG']->getLL(
'labels.switchToDefault', TRUE),
349 'CLEAR' =>
$GLOBALS[
'LANG']->getLL(
'clear', TRUE),
350 'LOGIN_PROCESS' =>
$GLOBALS[
'LANG']->getLL(
'login_process', TRUE),
351 'SITELINK' =>
'<a href="/">###SITENAME###</a>',
353 'SITENAME' => htmlspecialchars(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'sitename'])
365 public function checkRedirect() {
368 if (!empty(
$GLOBALS[
'BE_USER']->user[
'uid']) && ($this->
isLoginInProgress() || $this->loginRefresh || !$this->interfaceSelector)) {
370 if (!$_COOKIE[\
TYPO3\CMS\Core\Authentication\BackendUserAuthentication::getCookieName()]) {
371 if ($this->commandLI ==
'setCookie') {
374 throw new \RuntimeException(
'Login-error: Yeah, that\'s a classic. No cookies, no TYPO3.<br /><br />Please accept cookies from TYPO3 - otherwise you\'ll not be able to use the system.', 1294586846);
377 $this->redirectToURL =
'index.php?commandLI=setCookie';
382 $this->GPinterface =
'';
388 switch ($this->GPinterface) {
392 $this->redirectToURL =
'backend.php';
395 $this->redirectToURL =
'../';
401 if (!$this->loginRefresh) {
402 $formProtection->storeSessionTokenInRegistry();
405 $formProtection->setSessionTokenFromRegistry();
406 $formProtection->persistSessionToken();
407 $GLOBALS[
'TBE_TEMPLATE']->JScode .=
$GLOBALS[
'TBE_TEMPLATE']->wrapScriptTags(
' 408 if (parent.opener && (parent.opener.busy || parent.opener.TYPO3.loginRefresh)) { 409 if (parent.opener.TYPO3.loginRefresh) { 410 parent.opener.TYPO3.loginRefresh.startTimer(); 412 parent.opener.busy.loginRefreshed(); 429 $this->interfaceSelector =
'';
430 $this->interfaceSelector_hidden =
'';
431 $this->interfaceSelector_jump =
'';
436 if (count($parts) > 1) {
439 $labels[
'backend'] =
$GLOBALS[
'LANG']->getLL(
'interface.backend');
440 $labels[
'backend_old'] =
$GLOBALS[
'LANG']->getLL(
'interface.backend_old');
441 $labels[
'frontend'] =
$GLOBALS[
'LANG']->getLL(
'interface.frontend');
442 $jumpScript = array();
443 $jumpScript[
'backend'] =
'backend.php';
444 $jumpScript[
'backend_old'] =
'backend.php';
445 $jumpScript[
'frontend'] =
'../';
447 foreach ($parts as $valueStr) {
448 $this->interfaceSelector .=
' 449 <option value="' . htmlspecialchars($valueStr) .
'"' . (
GeneralUtility::_GP(
'interface') == htmlspecialchars($valueStr) ?
' selected="selected"' :
'') .
'>' . htmlspecialchars($labels[$valueStr]) .
'</option>';
450 $this->interfaceSelector_jump .=
' 451 <option value="' . htmlspecialchars($jumpScript[$valueStr]) .
'">' . htmlspecialchars($labels[$valueStr]) .
'</option>';
453 $this->interfaceSelector =
' 454 <select id="t3-interfaceselector" name="interface" class="c-interfaceselector" tabindex="3">' . $this->interfaceSelector .
' 456 $this->interfaceSelector_jump =
' 457 <select id="t3-interfaceselector" name="interface" class="c-interfaceselector" tabindex="3" onchange="window.location.href=this.options[this.selectedIndex].value;">' . $this->interfaceSelector_jump .
' 459 } elseif (!$this->redirect_url) {
461 $this->interfaceSelector_hidden =
'<input type="hidden" name="interface" value="' . trim(
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'interfaces']) .
'" />';
475 if (
$GLOBALS[
'TBE_STYLES'][
'loginBoxImage_rotationFolder']) {
479 if ($dir && @is_dir($dir)) {
483 $randImg = array_rand($files, 1);
485 $imgSize = @getimagesize(($dir . $files[$randImg]));
486 $imgAuthor = is_array($GLOBALS[
'TBE_STYLES'][
'loginBoxImage_author']) && $GLOBALS[
'TBE_STYLES'][
'loginBoxImage_author'][$files[$randImg]] ? htmlspecialchars($GLOBALS[
'TBE_STYLES'][
'loginBoxImage_author'][$files[$randImg]]) :
'';
488 if (is_array($imgSize)) {
489 $loginboxImage =
'<img src="' . htmlspecialchars(($GLOBALS[
'TBE_STYLES'][
'loginBoxImage_rotationFolder'] . $files[$randImg])) .
'" ' . $imgSize[3] .
' id="loginbox-image" alt="' . $imgAuthor .
'" title="' . $imgAuthor .
'" />';
495 if (strstr(TYPO3_version,
'-dev')) {
496 $loginImage =
'loginbox_image_dev.png';
497 $imagecopy =
'You are running a development version of TYPO3 ' . TYPO3_branch;
499 $loginImage =
'loginbox_image.jpg';
500 $imagecopy =
'Photo by J.C. Franca (www.digitalphoto.com.br)';
502 $loginboxImage =
'<img' .
IconUtility::skinImg(
$GLOBALS[
'BACK_PATH'], (
'gfx/' . $loginImage),
'width="200" height="133"') .
' id="loginbox-image" alt="' . $imagecopy .
'" title="' . $imagecopy .
'" />';
505 return $loginboxImage;
516 public function makeLoginNews() {
523 $htmlParser->procOptions[
'dontHSC_rte'] = TRUE;
530 foreach ($systemNews as $newsItemData) {
531 $additionalClass =
'';
533 $additionalClass =
' first-item';
534 } elseif ($count == count($systemNews)) {
535 $additionalClass =
' last-item';
537 $newsItemContent = $htmlParser->TS_transform_rte($htmlParser->TS_links_rte($newsItemData[
'content']));
538 $newsItemMarker = array(
539 '###HEADER###' => htmlspecialchars($newsItemData[
'header']),
540 '###DATE###' => htmlspecialchars($newsItemData[
'date']),
541 '###CONTENT###' => $newsItemContent,
542 '###CLASS###' => $additionalClass
547 $title =
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'loginNewsTitle'] ?
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'loginNewsTitle'] :
$GLOBALS[
'LANG']->getLL(
'newsheadline');
561 $systemNewsTable =
'sys_news';
562 $systemNews = array();
564 foreach ($systemNewsRecords as $systemNewsRecord) {
565 $systemNews[] = array(
566 'date' => date(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'ddmmyy'], $systemNewsRecord[
'crdate']),
567 'header' => $systemNewsRecord[
'title'],
568 'content' => $systemNewsRecord[
'content']
585 $form =
'<form action="index.php" method="post" name="loginform" ' .
'onsubmit="alert(\'No authentication methods available. Please, ' .
'contact your TYPO3 administrator.\');return false">';
587 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/index.php'][
'loginFormHook'])) {
588 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/index.php'][
'loginFormHook'] as $function) {
597 $output .= $form .
'<input type="hidden" name="login_status" value="login" />' .
'<input type="hidden" name="userident" value="" />' .
'<input type="hidden" name="redirect_url" value="' . htmlspecialchars($this->redirectToURL) .
'" />' .
'<input type="hidden" name="loginRefresh" value="' . htmlspecialchars($this->loginRefresh) .
'" />' . $this->interfaceSelector_hidden .
$this->addFields_hidden;
609 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/index.php'][
'loginScriptHook'])) {
610 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/index.php'][
'loginScriptHook'] as $function) {
618 $JSCode .=
$GLOBALS[
'TBE_TEMPLATE']->wrapScriptTags(
' 620 // If the login screen is shown in the login_frameset window for re-login, then try to get the username of the current/former login from opening windows main frame: 622 if (parent.opener && parent.opener.TS && parent.opener.TS.username && document.loginform && document.loginform.username) { 623 document.loginform.username.value = parent.opener.TS.username; 630 // Wait a few millisecons before calling checkFocus(). This might be necessary because some browsers need some time to auto-fill in the form fields 631 window.setTimeout("checkFocus()", 50); 634 // This moves focus to the right input field: 635 function checkFocus() { 636 // If for some reason there already is a username in the username form field, move focus to the password field: 637 if (document.loginform.username && document.loginform.username.value == "") { 638 document.loginform.username.focus(); 639 } else if (document.loginform.p_field && document.loginform.p_field.type!="hidden") { 640 document.loginform.p_field.focus(); 644 // This function shows a warning, if user has capslock enabled 645 // parameter showWarning: shows warning if TRUE and capslock active, otherwise only hides warning, if capslock gets inactive 646 function checkCapslock(e, showWarning) { 647 if (!isCapslock(e)) { 648 document.getElementById(\'t3-capslock\').style.display = \'none\'; 649 } else if (showWarning) { 650 document.getElementById(\'t3-capslock\').style.display = \'block\'; 654 // Checks weather capslock is enabled (returns TRUE if enabled, false otherwise) 655 // thanks to http://24ways.org/2007/capturing-caps-lock 657 function isCapslock(e) { 658 var ev = e ? e : window.event; 662 var targ = ev.target ? ev.target : ev.srcElement; 667 } else if (ev.keyCode) { 671 var shift_status = false; 673 shift_status = ev.shiftKey; 674 } else if (ev.modifiers) { 675 shift_status = !!(ev.modifiers & 4); 677 return (((which >= 65 && which <= 90) && !shift_status) || 678 ((which >= 97 && which <= 122) && shift_status)); 681 // prevent opening the login form in the backend frameset 682 if (top.location.href != self.location.href) { 683 top.location.href = self.location.href; 697 return !(empty($username) && empty($this->commandLI));
707 $signalArguments = $this->
getSignalSlotDispatcher()->dispatch(
'TYPO3\\CMS\\Backend\\Controller\\LoginController', self::SIGNAL_RenderLoginForm, array($this, $markers));
708 return $signalArguments[1];
717 if (!isset($this->signalSlotDispatcher)) {
718 $this->signalSlotDispatcher = $this->
getObjectManager()->get(
'TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
const SIGNAL_RenderLoginForm
makeInterfaceSelectorBox()
$interfaceSelector_hidden
static getIndpEnv($getEnvName)
static makeInstance($className)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
getSignalSlotDispatcher()
static substituteMarker($content, $marker, $markContent)
static isLoaded($key, $exitOnError=FALSE)
static getSubpart($content, $marker)
static substituteMarkerArray($content, $markContentArray, $wrap='', $uppercase=FALSE, $deleteUnused=FALSE)
static substituteSubpart($content, $marker, $subpartContent, $recursive=TRUE, $keepMarker=FALSE)
emitRenderLoginFormSignal(array $markers)
static getFilesInDir($path, $extensionList='', $prependPath=FALSE, $order='', $excludePattern='')
static redirect($url, $httpStatus=self::HTTP_STATUS_303)
static sanitizeLocalUrl($url='')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static getFileAbsFileName($filename, $onlyRelative=TRUE, $relToTYPO3_mainDir=FALSE)
static resolveBackPath($pathStr)
static BEenableFields($table, $inv=0)
static deleteClause($table, $tableAlias='')
static TYPO3_copyRightNotice($showVersionNumber=TRUE)