00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 define('TYPO3_PROCEED_IF_NO_USER', 1);
00063 require('init.php');
00064 require('template.php');
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 class SC_index {
00088
00089
00090 var $redirect_url;
00091 var $GPinterface;
00092 var $u;
00093 var $p;
00094 var $L;
00095 var $loginRefresh;
00096 var $commandLI;
00097
00098
00099 var $redirectToURL;
00100
00101
00102 var $content;
00103
00104 var $interfaceSelector;
00105 var $interfaceSelector_jump;
00106 var $interfaceSelector_hidden;
00107 var $addFields_hidden = '';
00108
00109
00110 var $loginSecurityLevel = 'superchallenged';
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 function init() {
00121
00122 session_start();
00123
00124 $this->redirect_url = t3lib_div::_GP('redirect_url');
00125 $this->GPinterface = t3lib_div::_GP('interface');
00126
00127
00128 if (t3lib_div::getIndpEnv('TYPO3_SSL')) {
00129 $this->u = t3lib_div::_GP('u');
00130 $this->p = t3lib_div::_GP('p');
00131 }
00132
00133
00134 $this->L = t3lib_div::_GP('L');
00135
00136
00137 $this->loginRefresh = t3lib_div::_GP('loginRefresh');
00138
00139
00140 $this->commandLI = t3lib_div::_GP('commandLI');
00141
00142
00143 if ($GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel']) {
00144 $this->loginSecurityLevel = $GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel'];
00145 }
00146
00147
00148 $preferredBrowserLanguage = $GLOBALS['LANG']->csConvObj->getPreferredClientLanguage(t3lib_div::getIndpEnv('HTTP_ACCEPT_LANGUAGE'));
00149
00150
00151 if ($preferredBrowserLanguage != 'default' && !$GLOBALS['BE_USER']->user['uid']) {
00152 $GLOBALS['LANG']->init($preferredBrowserLanguage);
00153 }
00154 $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_login.xml');
00155
00156
00157
00158 $this->mergeOldLoginLabels();
00159
00160
00161 $this->redirectToURL = ($this->redirect_url ? $this->redirect_url : 'backend.php');
00162
00163
00164
00165 if ($this->L == 'OUT' && is_object($GLOBALS['BE_USER'])) {
00166 $GLOBALS['BE_USER']->logoff();
00167 if ($this->redirect_url) {
00168 t3lib_utility_Http::redirect($this->redirect_url);
00169 }
00170 exit;
00171 }
00172 }
00173
00174
00175
00176
00177
00178
00179
00180 function main() {
00181 global $TBE_TEMPLATE, $TYPO3_CONF_VARS, $BE_USER;
00182
00183
00184 $TBE_TEMPLATE->bodyTagAdditions = ' onload="startUp();"';
00185 $TBE_TEMPLATE->moduleTemplate = $TBE_TEMPLATE->getHtmlTemplate('templates/login.html');
00186
00187 $TBE_TEMPLATE->getPageRenderer()->loadExtJS();
00188 $TBE_TEMPLATE->getPageRenderer()->loadPrototype();
00189 $TBE_TEMPLATE->getPageRenderer()->loadScriptaculous();
00190
00191
00192 $TBE_TEMPLATE->JScode.= $this->getJScode();
00193
00194
00195
00196 $this->checkRedirect();
00197
00198
00199 $this->makeInterfaceSelectorBox();
00200
00201
00202 if (!$BE_USER->user['uid']) {
00203 $TBE_TEMPLATE->form = $this->startForm();
00204 $loginForm = $this->makeLoginForm();
00205 } else {
00206 $TBE_TEMPLATE->form = '
00207 <form action="index.php" method="post" name="loginform">
00208 <input type="hidden" name="login_status" value="logout" />
00209 ';
00210 $loginForm = $this->makeLogoutForm();
00211 }
00212
00213
00214 $this->content.=$TBE_TEMPLATE->startPage('TYPO3 Login: '.$TYPO3_CONF_VARS['SYS']['sitename']);
00215
00216
00217 $this->content.=$this->wrapLoginForm($loginForm);
00218
00219 $this->content.= $TBE_TEMPLATE->endPage();
00220 }
00221
00222
00223
00224
00225
00226
00227 function printContent() {
00228 echo $this->content;
00229 }
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243 function makeLoginForm() {
00244 $content = t3lib_parsehtml::getSubpart($GLOBALS['TBE_TEMPLATE']->moduleTemplate, '###LOGIN_FORM###');
00245 $markers = array(
00246 'VALUE_USERNAME' => htmlspecialchars($this->u),
00247 'VALUE_PASSWORD' => htmlspecialchars($this->p),
00248 'VALUE_SUBMIT' => $GLOBALS['LANG']->getLL('labels.submitLogin', true),
00249 );
00250
00251
00252 if (!$this->commandLI) {
00253 $content = t3lib_parsehtml::substituteSubpart($content, '###LOGIN_ERROR###', '');
00254 } else {
00255 $markers['ERROR_MESSAGE'] = $GLOBALS['LANG']->getLL('error.login', true);
00256 $markers['ERROR_LOGIN_TITLE'] = $GLOBALS['LANG']->getLL('error.login.title', true);
00257 $markers['ERROR_LOGIN_DESCRIPTION'] = $GLOBALS['LANG']->getLL('error.login.description', true);
00258 }
00259
00260
00261
00262 if (!($this->interfaceSelector && !$this->loginRefresh)) {
00263 $content = t3lib_parsehtml::substituteSubpart($content, '###INTERFACE_SELECTOR###', '');
00264 } else {
00265 $markers['LABEL_INTERFACE'] = $GLOBALS['LANG']->getLL('labels.interface', true);
00266 $markers['VALUE_INTERFACE'] = $this->interfaceSelector;
00267 }
00268
00269 return t3lib_parsehtml::substituteMarkerArray($content, $markers, '###|###');
00270 }
00271
00272
00273
00274
00275
00276
00277
00278
00279 function makeLogoutForm() {
00280 $content = t3lib_parsehtml::getSubpart($GLOBALS['TBE_TEMPLATE']->moduleTemplate, '###LOGOUT_FORM###');
00281 $markers = array(
00282 'LABEL_USERNAME' => $GLOBALS['LANG']->getLL('labels.username', true),
00283 'VALUE_USERNAME' => htmlspecialchars($GLOBALS['BE_USER']->user['username']),
00284 'VALUE_SUBMIT' => $GLOBALS['LANG']->getLL('labels.submitLogout', true),
00285 );
00286
00287
00288 if (!$this->interfaceSelector_jump) {
00289 $content = t3lib_parsehtml::substituteSubpart($content, '###INTERFACE_SELECTOR###', '');
00290 } else {
00291 $markers['LABEL_INTERFACE'] = $GLOBALS['LANG']->getLL('labels.interface', true);
00292 $markers['VALUE_INTERFACE'] = $this->interfaceSelector_jump;
00293 }
00294
00295 return t3lib_parsehtml::substituteMarkerArray($content, $markers, '###|###');
00296 }
00297
00298
00299
00300
00301
00302
00303
00304
00305 function wrapLoginForm($content) {
00306 $mainContent = t3lib_parsehtml::getSubpart($GLOBALS['TBE_TEMPLATE']->moduleTemplate, '###PAGE###');
00307
00308 if ($GLOBALS['TBE_STYLES']['logo_login']) {
00309 $logo = '<img src="'.htmlspecialchars($GLOBALS['BACK_PATH'] . $GLOBALS['TBE_STYLES']['logo_login']) . '" alt="" />';
00310 } else {
00311 $logo = '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/typo3logo.gif','width="123" height="34"').' alt="" />';
00312 }
00313
00314 $markers = array(
00315 'LOGO' => $logo,
00316 'LOGINBOX_IMAGE' => $this->makeLoginBoxImage(),
00317 'FORM' => $content,
00318 'NEWS' => $this->makeLoginNews(),
00319 'COPYRIGHT' => $this->makeCopyrightNotice(),
00320 'CSS_ERRORCLASS' => ($this->commandLI ? ' class="error"' : ''),
00321 'CSS_OPENIDCLASS' => 't3-login-openid-' . (t3lib_extMgm::isLoaded('openid') ? 'enabled' : 'disabled'),
00322
00323
00324
00325 'HEADLINE' => $GLOBALS['LANG']->getLL('headline', true),
00326 'INFO_ABOUT' => $GLOBALS['LANG']->getLL('info.about', true),
00327 'INFO_RELOAD' => $GLOBALS['LANG']->getLL('info.reset', true),
00328 'INFO' => $GLOBALS['LANG']->getLL('info.cookies_and_js', true),
00329 'ERROR_JAVASCRIPT' => $GLOBALS['LANG']->getLL('error.javascript', true),
00330 'ERROR_COOKIES' => $GLOBALS['LANG']->getLL('error.cookies', true),
00331 'ERROR_COOKIES_IGNORE' => $GLOBALS['LANG']->getLL('error.cookies_ignore', true),
00332 'ERROR_CAPSLOCK' => $GLOBALS['LANG']->getLL('error.capslock', true),
00333 'ERROR_FURTHERHELP' => $GLOBALS['LANG']->getLL('error.furtherInformation', true),
00334 'LABEL_DONATELINK' => $GLOBALS['LANG']->getLL('labels.donate', true),
00335 'LABEL_USERNAME' => $GLOBALS['LANG']->getLL('labels.username', true),
00336 'LABEL_OPENID' => $GLOBALS['LANG']->getLL('labels.openId', true),
00337 'LABEL_PASSWORD' => $GLOBALS['LANG']->getLL('labels.password', true),
00338 'LABEL_WHATISOPENID' => $GLOBALS['LANG']->getLL('labels.whatIsOpenId', true),
00339 'LABEL_SWITCHOPENID' => $GLOBALS['LANG']->getLL('labels.switchToOpenId', true),
00340 'LABEL_SWITCHDEFAULT' => $GLOBALS['LANG']->getLL('labels.switchToDefault', true),
00341 'CLEAR' => $GLOBALS['LANG']->getLL('clear', true),
00342 'LOGIN_PROCESS' => $GLOBALS['LANG']->getLL('login_process', true),
00343 'SITELINK' => '<a href="/">###SITENAME###</a>',
00344
00345
00346 'SITENAME' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']
00347 );
00348 return t3lib_parsehtml::substituteMarkerArray($mainContent, $markers, '###|###');
00349 }
00350
00351
00352
00353
00354
00355
00356
00357 function checkRedirect() {
00358 global $BE_USER,$TBE_TEMPLATE;
00359
00360
00361
00362 if ($BE_USER->user['uid'] && ($this->commandLI || $this->loginRefresh || !$this->interfaceSelector)) {
00363
00364
00365 if (!$_COOKIE[$BE_USER->name]) {
00366 if ($this->commandLI=='setCookie') {
00367
00368
00369 t3lib_BEfunc::typo3PrintError ('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.",0);
00370 exit;
00371 } else {
00372
00373 $this->redirectToURL = 'index.php?commandLI=setCookie';
00374 }
00375 }
00376
00377 if (($redirectToURL = (string)$BE_USER->getTSConfigVal('auth.BE.redirectToURL'))) {
00378 $this->redirectToURL = $redirectToURL;
00379 $this->GPinterface = '';
00380 }
00381
00382
00383 $BE_USER->uc['interfaceSetup'] = $this->GPinterface;
00384 $BE_USER->writeUC();
00385
00386
00387 switch ($this->GPinterface) {
00388 case 'backend':
00389 case 'backend_old':
00390 $this->redirectToURL = 'backend.php';
00391 break;
00392 case 'frontend':
00393 $this->redirectToURL = '../';
00394 break;
00395 }
00396
00397
00398 if (!$this->loginRefresh) {
00399 t3lib_utility_Http::redirect($this->redirectToURL);
00400 } else {
00401 $TBE_TEMPLATE->JScode.=$TBE_TEMPLATE->wrapScriptTags('
00402 if (parent.opener && (parent.opener.busy || parent.opener.TYPO3.loginRefresh)) {
00403 if (parent.opener.TYPO3.loginRefresh) {
00404 parent.opener.TYPO3.loginRefresh.startTimer();
00405 } else {
00406 parent.opener.busy.loginRefreshed();
00407 }
00408 parent.close();
00409 }
00410 ');
00411 }
00412 } elseif (!$BE_USER->user['uid'] && $this->commandLI) {
00413 sleep(5);
00414 }
00415 }
00416
00417
00418
00419
00420
00421
00422 function makeInterfaceSelectorBox() {
00423 global $TYPO3_CONF_VARS;
00424
00425
00426 $this->interfaceSelector = '';
00427 $this->interfaceSelector_hidden='';
00428 $this->interfaceSelector_jump = '';
00429
00430
00431 if ($TYPO3_CONF_VARS['BE']['interfaces'] && ($this->commandLI || !$this->redirect_url)) {
00432 $parts = t3lib_div::trimExplode(',',$TYPO3_CONF_VARS['BE']['interfaces']);
00433 if (count($parts)>1) {
00434
00435
00436 $labels=array();
00437
00438 $labels['backend'] = $GLOBALS['LANG']->getLL('interface.backend');
00439 $labels['backend_old'] = $GLOBALS['LANG']->getLL('interface.backend_old');
00440 $labels['frontend'] = $GLOBALS['LANG']->getLL('interface.frontend');
00441
00442 $jumpScript=array();
00443 $jumpScript['backend'] = 'backend.php';
00444 $jumpScript['backend_old'] = 'backend.php';
00445 $jumpScript['frontend'] = '../';
00446
00447
00448 foreach($parts as $valueStr) {
00449 $this->interfaceSelector.='
00450 <option value="'.htmlspecialchars($valueStr).'"'.(t3lib_div::_GP('interface')==htmlspecialchars($valueStr) ? ' selected="selected"' : '').'>'.htmlspecialchars($labels[$valueStr]).'</option>';
00451 $this->interfaceSelector_jump.='
00452 <option value="'.htmlspecialchars($jumpScript[$valueStr]).'">'.htmlspecialchars($labels[$valueStr]).'</option>';
00453 }
00454 $this->interfaceSelector='
00455 <select id="t3-interfaceselector" name="interface" class="c-interfaceselector" tabindex="3">'.$this->interfaceSelector.'
00456 </select>';
00457 $this->interfaceSelector_jump='
00458 <select id="t3-interfaceselector" name="interface" class="c-interfaceselector" tabindex="3" onchange="window.location.href=this.options[this.selectedIndex].value;">'.$this->interfaceSelector_jump.'
00459 </select>';
00460
00461 } else {
00462
00463 $this->interfaceSelector_hidden='<input type="hidden" name="interface" value="'.trim($TYPO3_CONF_VARS['BE']['interfaces']).'" />';
00464 }
00465 }
00466 }
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478 function makeCopyrightNotice() {
00479
00480
00481 $loginCopyrightWarrantyProvider = strip_tags(trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightWarrantyProvider']));
00482 $loginCopyrightWarrantyURL = strip_tags(trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightWarrantyURL']));
00483 $loginImageSmall = (trim($GLOBALS['TBE_STYLES']['loginBoxImageSmall'])) ? trim($GLOBALS['TBE_STYLES']['loginBoxImageSmall']) : 'gfx/loginlogo_transp.gif';
00484
00485
00486 if (strlen($loginCopyrightWarrantyProvider)>=2 && strlen($loginCopyrightWarrantyURL)>=10) {
00487 $warrantyNote = sprintf($GLOBALS['LANG']->getLL('warranty.by'), htmlspecialchars($loginCopyrightWarrantyProvider), '<a href="' . htmlspecialchars($loginCopyrightWarrantyURL) . '" target="_blank">', '</a>');
00488 } else {
00489 $warrantyNote = sprintf($GLOBALS['LANG']->getLL('no.warranty'), '<a href="http://typo3.com/1316.0.html" target="_blank">', '</a>');
00490 }
00491
00492
00493 $copyrightNotice = '<a href="http://typo3.com/" target="_blank">'.
00494 '<img src="' . $loginImageSmall . '" alt="' . $GLOBALS['LANG']->getLL('typo3.logo') . '" align="left" />' .
00495 $GLOBALS['LANG']->getLL('typo3.cms') . ($GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightShowVersion']?' ' . $GLOBALS['LANG']->getLL('version.short') . ' ' . htmlspecialchars($GLOBALS['TYPO_VERSION']):'') .
00496 '</a>. ' .
00497 $GLOBALS['LANG']->getLL('copyright') . ' © ' . TYPO3_copyright_year . ' Kasper Skårhøj. ' . $GLOBALS['LANG']->getLL('extension.copyright') . ' ' .
00498 sprintf($GLOBALS['LANG']->getLL('details.link'), '<a href="http://typo3.com/" target="_blank">http:
00499 $warrantyNote . ' ' .
00500 sprintf($GLOBALS['LANG']->getLL('free.software'), '<a href="http://typo3.com/1316.0.html" target="_blank">', '</a> ') .
00501 $GLOBALS['LANG']->getLL('keep.notice');
00502
00503
00504 return $copyrightNotice;
00505 }
00506
00507
00508
00509
00510
00511
00512 function makeLoginBoxImage() {
00513 $loginboxImage = '';
00514 if ($GLOBALS['TBE_STYLES']['loginBoxImage_rotationFolder']) {
00515 $absPath = t3lib_div::resolveBackPath(PATH_typo3.$GLOBALS['TBE_STYLES']['loginBoxImage_rotationFolder']);
00516
00517
00518 $dir = t3lib_div::getFileAbsFileName($absPath);
00519 if ($dir && @is_dir($dir)) {
00520
00521
00522 $files = t3lib_div::getFilesInDir($dir,'png,jpg,gif');
00523
00524
00525 $randImg = array_rand($files, 1);
00526
00527
00528 $imgSize = @getimagesize($dir.$files[$randImg]);
00529
00530 $imgAuthor = is_array($GLOBALS['TBE_STYLES']['loginBoxImage_author'])&&$GLOBALS['TBE_STYLES']['loginBoxImage_author'][$files[$randImg]] ? htmlspecialchars($GLOBALS['TBE_STYLES']['loginBoxImage_author'][$files[$randImg]]) : '';
00531
00532
00533 if (is_array($imgSize)) {
00534 $loginboxImage = '<img src="'.htmlspecialchars($GLOBALS['TBE_STYLES']['loginBoxImage_rotationFolder'].$files[$randImg]).'" '.$imgSize[3].' id="loginbox-image" alt="'.$imgAuthor.'" title="'.$imgAuthor.'" />';
00535 }
00536 }
00537 } else {
00538
00539 if (strstr(TYPO3_version,'-dev')) {
00540 $loginImage = 'loginbox_image_dev.png';
00541 $imagecopy = 'You are running a development version of TYPO3 '.TYPO3_branch;
00542 } else {
00543 $loginImage = 'loginbox_image.jpg';
00544 $imagecopy = 'Photo by J.C. Franca (www.digitalphoto.com.br)';
00545 }
00546 $loginboxImage = '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/'.$loginImage,'width="200" height="133"').' id="loginbox-image" alt="'.$imagecopy.'" title="'.$imagecopy.'" />';
00547 }
00548
00549
00550 return $loginboxImage;
00551 }
00552
00553
00554
00555
00556
00557
00558
00559
00560 function makeLoginNews() {
00561 $newsContent = '';
00562
00563
00564 if (is_array($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews']) && count($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews']) && !t3lib_div::_GP('loginRefresh')) {
00565
00566
00567 $newsContent = t3lib_parsehtml::getSubpart($GLOBALS['TBE_TEMPLATE']->moduleTemplate, '###LOGIN_NEWS###');
00568 $newsItemTemplate = t3lib_parsehtml::getSubpart($newsContent, '###NEWS_ITEM###');
00569
00570 $newsItemContent = '';
00571 $count = 1;
00572 foreach ($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'] as $newsItem) {
00573 $additionalClass = '';
00574 if ($count == 1) {
00575 $additionalClass = ' first-item';
00576 } elseif($count == count($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'])) {
00577 $additionalClass = ' last-item';
00578 }
00579 $newsItemMarker = array(
00580 '###HEADER###' => htmlspecialchars($newsItem['header']),
00581 '###DATE###' => htmlspecialchars($newsItem['date']),
00582 '###CONTENT###' => trim($newsItem['content']),
00583 '###CLASS###' => $additionalClass
00584 );
00585
00586 $count++;
00587 $newsItemContent .= t3lib_parsehtml::substituteMarkerArray($newsItemTemplate, $newsItemMarker);
00588 }
00589
00590 $title = ($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNewsTitle'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['loginNewsTitle'] : $GLOBALS['LANG']->getLL('newsheadline'));
00591
00592 $newsContent = t3lib_parsehtml::substituteMarker($newsContent, '###NEWS_HEADLINE###', htmlspecialchars($title));
00593 $newsContent = t3lib_parsehtml::substituteSubpart($newsContent, '###NEWS_ITEM###', $newsItemContent);
00594 }
00595
00596 return $newsContent;
00597 }
00598
00599
00600
00601
00602
00603
00604 function startForm() {
00605 $output = '';
00606
00607
00608
00609
00610 $form = '<form action="index.php" method="post" name="loginform" ' .
00611 'onsubmit="alert(\'No authentication methods available. Please, ' .
00612 'contact your TYPO3 administrator.\');return false">';
00613
00614
00615 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/index.php']['loginFormHook'])) {
00616 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/index.php']['loginFormHook'] as $function) {
00617 $params = array();
00618 $formCode = t3lib_div::callUserFunction($function, $params, $this);
00619 if ($formCode) {
00620 $form = $formCode;
00621 break;
00622 }
00623 }
00624 }
00625
00626 $output .= $form .
00627 '<input type="hidden" name="login_status" value="login" />' .
00628 '<input type="hidden" name="userident" value="" />' .
00629 '<input type="hidden" name="redirect_url" value="'.htmlspecialchars($this->redirectToURL).'" />' .
00630 '<input type="hidden" name="loginRefresh" value="'.htmlspecialchars($this->loginRefresh).'" />' .
00631 $this->interfaceSelector_hidden . $this->addFields_hidden;
00632
00633 return $output;
00634 }
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644 function getHiddenFields($unused = '') {
00645 t3lib_div::logDeprecatedFunction();
00646 return '';
00647 }
00648
00649
00650
00651
00652
00653
00654 function getJScode() {
00655 $JSCode = '';
00656 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/index.php']['loginScriptHook'])) {
00657 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/index.php']['loginScriptHook'] as $function) {
00658 $params = array();
00659 $JSCode = t3lib_div::callUserFunction($function, $params, $this);
00660 if ($JSCode) {
00661 break;
00662 }
00663 }
00664 }
00665 $JSCode .= $GLOBALS['TBE_TEMPLATE']->wrapScriptTags('
00666 function startUp() {
00667
00668 try {
00669 if (parent.opener && parent.opener.TS && parent.opener.TS.username && document.loginform && document.loginform.username) {
00670 document.loginform.username.value = parent.opener.TS.username;
00671 }
00672 }
00673 catch(error) {
00674
00675 }
00676
00677
00678 window.setTimeout("checkFocus()", 50);
00679 }
00680
00681
00682 function checkFocus() {
00683
00684 if (document.loginform.username && document.loginform.username.value == "") {
00685 document.loginform.username.focus();
00686 } else if (document.loginform.p_field && document.loginform.p_field.type!="hidden") {
00687 document.loginform.p_field.focus();
00688 }
00689 }
00690
00691
00692
00693 function checkCapslock(e, showWarning) {
00694 if (!isCapslock(e)) {
00695 document.getElementById(\'t3-capslock\').style.display = \'none\';
00696 } else if (showWarning) {
00697 document.getElementById(\'t3-capslock\').style.display = \'block\';
00698 }
00699 }
00700
00701
00702
00703
00704 function isCapslock(e) {
00705 var ev = e ? e : window.event;
00706 if (!ev) {
00707 return;
00708 }
00709 var targ = ev.target ? ev.target : ev.srcElement;
00710
00711 var which = -1;
00712 if (ev.which) {
00713 which = ev.which;
00714 } else if (ev.keyCode) {
00715 which = ev.keyCode;
00716 }
00717
00718 var shift_status = false;
00719 if (ev.shiftKey) {
00720 shift_status = ev.shiftKey;
00721 } else if (ev.modifiers) {
00722 shift_status = !!(ev.modifiers & 4);
00723 }
00724 return (((which >= 65 && which <= 90) && !shift_status) ||
00725 ((which >= 97 && which <= 122) && shift_status));
00726 }
00727
00728
00729 if (top.location.href != self.location.href) {
00730 top.location.href = self.location.href;
00731 }
00732
00733 ');
00734
00735 return $JSCode;
00736 }
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748 protected function mergeOldLoginLabels() {
00749
00750 $oldLoginLabels = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['loginLabels']);
00751 if ($oldLoginLabels != '') {
00752
00753 $defaultOldLoginLabelsHash = 'bcf0d32e58c6454ea50c6c956f1f18f0';
00754
00755 if (md5($oldLoginLabels) != $defaultOldLoginLabelsHash) {
00756 $lang = $GLOBALS['LANG']->lang;
00757 $oldLoginLabelArray = explode('|',$oldLoginLabels);
00758 $overrideLabelKeys = array(
00759 'labels.username' => $oldLoginLabelArray[0],
00760 'labels.password' => $oldLoginLabelArray[1],
00761 'labels.interface' => $oldLoginLabelArray[2],
00762 'labels.submitLogin' => $oldLoginLabelArray[3],
00763 'labels.submitLogout' => $oldLoginLabelArray[4],
00764 'availableInterfaces' => $oldLoginLabelArray[5],
00765 'headline' => $oldLoginLabelArray[6],
00766 'info.jscookies' => $oldLoginLabelArray[7],
00767 'newsheadline' => $oldLoginLabelArray[8],
00768 'error.login' => $oldLoginLabelArray[9],
00769 );
00770 if (!is_array($GLOBALS['LOCAL_LANG'][$lang])) {
00771 $GLOBALS['LOCAL_LANG'][$lang] = array();
00772 }
00773
00774 foreach ($overrideLabelKeys as $labelKey => $label) {
00775 $GLOBALS['LOCAL_LANG'][$lang][$labelKey] = $GLOBALS['LOCAL_LANG']['default'][$labelKey] = $label;
00776 }
00777 }
00778 }
00779 }
00780 }
00781
00782
00783 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/index.php']) {
00784 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/index.php']);
00785 }
00786
00787
00788
00789
00790 $SOBE = t3lib_div::makeInstance('SC_index');
00791 $SOBE->init();
00792 $SOBE->main();
00793 $SOBE->printContent();
00794
00795 ?>