Documentation TYPO3 par Ameos

index.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
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 
00087 class SC_index {
00088 
00089                 // Internal, GPvars:
00090         var $redirect_url;                      // GPvar: redirect_url; The URL to redirect to after login.
00091         var $GPinterface;                       // GPvar: Defines which interface to load (from interface selector)
00092         var $u;                                 // GPvar: preset username
00093         var $p;                                 // GPvar: preset password
00094         var $L;                                 // GPvar: If "L" is "OUT", then any logged in used is logged out. If redirect_url is given, we redirect to it
00095         var $loginRefresh;                      // Login-refresh boolean; The backend will call this script with this value set when the login is close to being expired and the form needs to be redrawn.
00096         var $commandLI;                         // Value of forms submit button for login.
00097 
00098                 // Internal, static:
00099         var $redirectToURL;                     // Set to the redirect URL of the form (may be redirect_url or "alt_main.php")
00100         var $L_vars;                            // Set to the labels used for the login screen.
00101 
00102                 // Internal, dynamic:
00103         var $content;                           // Content accumulation
00104 
00105         var $interfaceSelector;                 // A selector box for selecting value for "interface" may be rendered into this variable
00106         var $interfaceSelector_jump;    // A selector box for selecting value for "interface" may be rendered into this variable - this will have an onchange action which will redirect the user to the selected interface right away
00107         var $interfaceSelector_hidden;  // A hidden field, if the interface is not set.
00108 
00109                 // sets the level of security. *'normal' = clear-text. 'challenged' = hashed password/username from form in $formfield_uident. 'superchallenged' = hashed password hashed again with username.
00110         var $loginSecurityLevel = 'superchallenged';
00111 
00112 
00113 
00114 
00120         function init() {
00121                 global $BE_USER,$TYPO3_CONF_VARS;
00122 
00123                         // GPvars:
00124                 $this->redirect_url = t3lib_div::_GP('redirect_url');
00125                 $this->GPinterface = t3lib_div::_GP('interface');
00126 
00127                 if(t3lib_div::getIndpEnv('TYPO3_SSL'))  {       // For security reasons this feature only works if SSL is used
00128                         $this->u = t3lib_div::_GP('u');         // preset username
00129                         $this->p = t3lib_div::_GP('p');         // preset password
00130                 }
00131                 $this->L = t3lib_div::_GP('L');                         // If "L" is "OUT", then any logged in used is logged out. If redirect_url is given, we redirect to it
00132                 $this->loginRefresh = t3lib_div::_GP('loginRefresh');   // Login
00133                 $this->commandLI = t3lib_div::_GP('commandLI');         // Value of "Login" button. If set, the login button was pressed.
00134 
00135                         // sets the level of security from conf vars
00136                 if ($TYPO3_CONF_VARS['BE']['loginSecurityLevel']) {
00137                         $this->loginSecurityLevel = $TYPO3_CONF_VARS['BE']['loginSecurityLevel'];
00138                 }
00139 
00140                         // Getting login labels:
00141                 $this->L_vars = explode('|',$TYPO3_CONF_VARS['BE']['loginLabels']);
00142 
00143                         // Setting the redirect URL to "alt_main.php" if no alternative input is given:
00144                 $this->redirectToURL = $this->redirect_url ? $this->redirect_url : 'alt_main.php';
00145 
00146                         // Logout?
00147                 if ($this->L=='OUT' && is_object($BE_USER))     {
00148                         $BE_USER->logoff();
00149                         if ($this->redirect_url)        header('Location: '.t3lib_div::locationHeaderUrl($this->redirect_url));
00150                         exit;
00151                 }
00152         }
00153 
00159         function main() {
00160                 global $TBE_TEMPLATE, $TYPO3_CONF_VARS, $BE_USER;
00161 
00162                         // Initialize template object:
00163                 $TBE_TEMPLATE->docType='xhtml_trans';
00164 
00165                         // Set JavaScript for creating a MD5 hash of the password:
00166                 $TBE_TEMPLATE->JScode.='
00167                         <script type="text/javascript" src="md5.js"></script>
00168                         '.$TBE_TEMPLATE->wrapScriptTags('
00169                                 function doChallengeResponse(superchallenged) { //
00170                                         password = document.loginform.p_field.value;
00171                                         if (password)   {
00172                                                 if (superchallenged)    {
00173                                                         password = MD5(password);       // this makes it superchallenged!!
00174                                                 }
00175                                                 str = document.loginform.username.value+":"+password+":"+document.loginform.challenge.value;
00176                                                 document.loginform.userident.value = MD5(str);
00177                                                 document.loginform.p_field.value = "";
00178                                                 return true;
00179                                         }
00180                                 }
00181                         ');
00182 
00183 
00184                         // Checking, if we should make a redirect.
00185                         // Might set JavaScript in the header to close window.
00186                 $this->checkRedirect();
00187 
00188                         // Initialize interface selectors:
00189                 $this->makeInterfaceSelectorBox();
00190 
00191                         // Replace an optional marker in the "Administration Login" label
00192                 $this->L_vars[6] = str_replace("###SITENAME###",$TYPO3_CONF_VARS['SYS']['sitename'],$this->L_vars[6]);
00193 
00194                         // Creating form based on whether there is a login or not:
00195                 if (!$BE_USER->user['uid'])     {
00196 
00197                         if ($this->loginSecurityLevel == 'challenged') {
00198                                 $TBE_TEMPLATE->form = '
00199                                         <form action="index.php" method="post" name="loginform" onsubmit="doChallengeResponse(0);">
00200                                         ';
00201                         } elseif ($this->loginSecurityLevel == 'normal') {
00202                                 $TBE_TEMPLATE->form = '
00203                                         <form action="index.php" method="post" name="loginform" onsubmit="document.loginform.userident.value=document.loginform.p_field.value;document.loginform.p_field.value=\'\';document.loginform.challenge.value=\'\';return true;">
00204                                         ';
00205                         } else { // if ($this->loginSecurityLevel == 'superchallenged') {
00206                                 $TBE_TEMPLATE->form = '
00207                                         <form action="index.php" method="post" name="loginform" onsubmit="doChallengeResponse(1);">
00208                                         ';
00209                         }
00210 
00211                         $TBE_TEMPLATE->form.= '
00212                                         <input type="hidden" name="login_status" value="login" />
00213                                 ';
00214                         $loginForm = $this->makeLoginForm();
00215                 } else {
00216                         $TBE_TEMPLATE->form = '
00217                                 <form action="index.php" method="post" name="loginform">
00218                                 <input type="hidden" name="login_status" value="logout" />
00219                                 ';
00220                         $loginForm = $this->makeLogoutForm();
00221                 }
00222 
00223 
00224                         // Starting page:
00225                 $this->content.=$TBE_TEMPLATE->startPage('TYPO3 Login: '.$TYPO3_CONF_VARS['SYS']['sitename']);
00226 
00227                         // Add login form:
00228                 $this->content.=$this->wrapLoginForm($loginForm);
00229 
00230                         // Ending form:
00231                 $this->content.= '
00232                         <input type="hidden" name="userident" value="" />
00233                         <input type="hidden" name="challenge" value="'.($challenge = md5(uniqid('').getmypid())).'" />
00234                         <input type="hidden" name="redirect_url" value="'.htmlspecialchars($this->redirectToURL).'" />
00235                         <input type="hidden" name="loginRefresh" value="'.htmlspecialchars($this->loginRefresh).'" />
00236                         '.$this->interfaceSelector_hidden.'
00237                         ';
00238 
00239                         // Save challenge value in session data (thanks to Bernhard Kraft for providing code):
00240                 session_start();
00241                 $_SESSION['login_challenge'] = $challenge;
00242 
00243                         // This moves focus to the right input field:
00244                 $this->content.=$TBE_TEMPLATE->wrapScriptTags('
00245 
00246                                 // 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:
00247                         if (parent.opener && parent.opener.TS && parent.opener.TS.username && document.loginform && document.loginform.username)        {
00248                                 document.loginform.username.value = parent.opener.TS.username;
00249                         }
00250 
00251                                 // If for some reason there already is a username in the username for field, move focus to the password field:
00252                         if (document.loginform.username && document.loginform.username.value == "") {
00253                                 document.loginform.username.focus();
00254                         } else if (document.loginform.p_field && document.loginform.p_field.type!="hidden") {
00255                                 document.loginform.p_field.focus();
00256                         }
00257                 ');
00258 
00259                         // End page:
00260                 $this->content.=$TBE_TEMPLATE->endPage();
00261         }
00262 
00268         function printContent() {
00269 
00270                 echo $this->content;
00271         }
00272 
00273 
00274 
00275 
00276 
00277 
00278 
00279 
00280         /*****************************
00281          *
00282          * Various functions
00283          *
00284          ******************************/
00285 
00292         function makeLoginForm()        {
00293 
00294                 $content.='
00295 
00296                                                         <!--
00297                                                                 Login form:
00298                                                         -->
00299                                                         <table cellspacing="0" cellpadding="0" border="0" id="logintable">
00300                                                                         <tr>
00301                                                                                 <td colspan="2"><h2>'.htmlspecialchars($this->L_vars[6]).'</h2></td>
00302                                                                         </tr>'.($this->commandLI ? '
00303                                                                         <tr class="c-wrong">
00304                                                                                 <td colspan="2"><p class="c-wrong">'.htmlspecialchars($this->L_vars[9]).'</p></td>
00305                                                                         </tr>' : '').'
00306                                                                         <tr class="c-username">
00307                                                                                 <td><p class="c-username">'.htmlspecialchars($this->L_vars[0]).':</p></td>
00308                                                                                 <td><input type="text" name="username" value="'.htmlspecialchars($this->u).'" class="c-username" /></td>
00309                                                                         </tr>
00310                                                                         <tr class="c-password">
00311                                                                                 <td><p class="c-password">'.htmlspecialchars($this->L_vars[1]).':</p></td>
00312                                                                                 <td><input type="password" name="p_field" value="'.htmlspecialchars($this->p).'" class="c-password" /></td>
00313                                                                         </tr>'.($this->interfaceSelector && !$this->loginRefresh ? '
00314                                                                         <tr class="c-interfaceselector">
00315                                                                                 <td><p class="c-interfaceselector">'.htmlspecialchars($this->L_vars[2]).':</p></td>
00316                                                                                 <td>'.$this->interfaceSelector.'</td>
00317                                                                         </tr>' : '' ).'
00318                                                                         <tr class="c-submit">
00319                                                                                 <td></td>
00320                                                                                 <td><input type="submit" name="commandLI" value="'.htmlspecialchars($this->L_vars[3]).'" class="c-submit" /></td>
00321                                                                         </tr>
00322                                                                         <tr class="c-info">
00323                                                                                 <td colspan="2"><p class="c-info">'.htmlspecialchars($this->L_vars[7]).'</p></td>
00324                                                                         </tr>
00325                                                                 </table>';
00326 
00327                         // Return content:
00328                 return $content;
00329         }
00330 
00337         function makeLogoutForm()       {
00338                 global $BE_USER;
00339 
00340 
00341                 $content.='
00342 
00343                                                         <!--
00344                                                                 Login form:
00345                                                         -->
00346                                                         <table cellspacing="0" cellpadding="0" border="0" id="logintable">
00347                                                                         <tr>
00348                                                                                 <td></td>
00349                                                                                 <td><h2>'.htmlspecialchars($this->L_vars[6]).'</h2></td>
00350                                                                         </tr>
00351                                                                         <tr class="c-username">
00352                                                                                 <td><p class="c-username">'.htmlspecialchars($this->L_vars[0]).':</p></td>
00353                                                                                 <td><p class="c-username-current">'.htmlspecialchars($BE_USER->user['username']).'</p></td>
00354                                                                         </tr>'.($this->interfaceSelector_jump ? '
00355                                                                         <tr class="c-interfaceselector">
00356                                                                                 <td><p class="c-interfaceselector">'.htmlspecialchars($this->L_vars[2]).':</p></td>
00357                                                                                 <td>'.$this->interfaceSelector_jump.'</td>
00358                                                                         </tr>' : '' ).'
00359                                                                         <tr class="c-submit">
00360                                                                                 <td><input type="hidden" name="p_field" value="" /></td>
00361                                                                                 <td><input type="submit" name="commandLO" value="'.htmlspecialchars($this->L_vars[4]).'" class="c-submit" /></td>
00362                                                                         </tr>
00363                                                                         <tr class="c-info">
00364                                                                                 <td></td>
00365                                                                                 <td><p class="c-info">'.htmlspecialchars($this->L_vars[7]).'</p></td>
00366                                                                         </tr>
00367                                                                 </table>';
00368 
00369                         // Return content:
00370                 return $content;
00371         }
00372 
00379         function wrapLoginForm($content)        {
00380 
00381                         // Logo:
00382                 $logo = $GLOBALS['TBE_STYLES']['logo_login'] ?
00383                                         '<img src="'.htmlspecialchars($GLOBALS['BACK_PATH'].$GLOBALS['TBE_STYLES']['logo_login']).'" alt="" />' :
00384                                         '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/typo3logo.gif','width="333" height="43"').' alt="" />';
00385 
00386                         // Login box image:
00387                 $loginboxImage = $this->makeLoginBoxImage();
00388 
00389                         // Compile the page content:
00390                 $content='
00391 
00392                 <!--
00393                         Wrapper table for the login form:
00394                 -->
00395                 <table cellspacing="0" cellpadding="0" border="0" id="wrapper">
00396                         <tr>
00397                                 <td class="c-wrappercell" align="center">
00398 
00399                                         <!--
00400                                                 Login form image:
00401                                         -->
00402                                         <div id="loginimage">
00403                                                                                         '.$logo.'
00404                                         </div>
00405 
00406                                         <!--
00407                                                 Login form wrapper:
00408                                         -->
00409                                         <table cellspacing="0" cellpadding="0" border="0" id="loginwrapper">
00410                                                 <tr>
00411                                                         <td>'.$loginboxImage.'</td>
00412                                                         <td>
00413                                                                 '.$content.'
00414                                                         </td>
00415                                                 </tr>
00416                                         </table>
00417 
00418                                         <!--
00419                                                 Copyright notice:
00420                                         -->
00421                                         <div id="copyrightnotice">
00422                                                 '.$this->makeCopyrightNotice().'
00423                                         </div>
00424 
00425                                         '.$this->makeLoginNews().'
00426                                 </td>
00427                         </tr>
00428                 </table>';
00429 
00430                         // Return content:
00431                 return $content;
00432         }
00433 
00439         function checkRedirect()        {
00440                 global $BE_USER,$TBE_TEMPLATE;
00441 
00442                         // Do redirect:
00443                         // If a user is logged in AND a) if either the login is just done (commandLI) or b) a loginRefresh is done or c) the interface-selector is NOT enabled (If it is on the other hand, it should not just load an interface, because people has to choose then...)
00444                 if ($BE_USER->user['uid'] && ($this->commandLI || $this->loginRefresh || !$this->interfaceSelector))    {
00445 
00446                                 // If no cookie has been set previously we tell people that this is a problem. This assumes that a cookie-setting script (like this one) has been hit at least once prior to this instance.
00447                         if (!$_COOKIE[$BE_USER->name])  {
00448                                 if ($this->commandLI=='setCookie') {
00449                                                 // we tried it a second time but still no cookie
00450                                                 // 26/4 2005: This does not work anymore, because the saving of challenge values in $_SESSION means the system will act as if the password was wrong.
00451                                         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);
00452                                         exit;
00453                                 } else {
00454                                                 // try it once again - that might be needed for auto login
00455                                         $this->redirectToURL = 'index.php?commandLI=setCookie';
00456                                 }
00457                         }
00458 
00459                         if($redirectToURL = (string)$BE_USER->getTSConfigVal('auth.BE.redirectToURL')) {
00460                                 $this->redirectToURL = $redirectToURL;
00461                                 $this->GPinterface = '';
00462                         }
00463 
00464                                 // Based on specific setting of interface we set the redirect script:
00465                         switch ($this->GPinterface)     {
00466                                 case 'backend':
00467                                         $this->redirectToURL = 'alt_main.php';
00468                                 break;
00469                                 case 'frontend':
00470                                         $this->redirectToURL = '../';
00471                                 break;
00472                         }
00473 
00474                                 // If there is a redirect URL AND if loginRefresh is not set...
00475                         if (!$this->loginRefresh)       {
00476                                 header('Location: '.t3lib_div::locationHeaderUrl($this->redirectToURL));
00477                                 exit;
00478                         } else {
00479                                 $TBE_TEMPLATE->JScode.=$TBE_TEMPLATE->wrapScriptTags('
00480                                         if (parent.opener && parent.opener.busy)        {
00481                                                 parent.opener.busy.loginRefreshed();
00482                                                 parent.close();
00483                                         }
00484                                 ');
00485                         }
00486                 } elseif(!$BE_USER->user['uid'] && $this->commandLI) {
00487                         sleep(5);
00488                 }
00489         }
00490 
00496         function makeInterfaceSelectorBox()     {
00497                 global $TYPO3_CONF_VARS;
00498 
00499                         // Reset variables:
00500                 $this->interfaceSelector = '';
00501                 $this->interfaceSelector_hidden='';
00502                 $this->interfaceSelector_jump = '';
00503 
00504                         // If interfaces are defined AND no input redirect URL in GET vars:
00505                 if ($TYPO3_CONF_VARS['BE']['interfaces'] && !$this->redirect_url)       {
00506                         $parts = t3lib_div::trimExplode(',',$TYPO3_CONF_VARS['BE']['interfaces']);
00507                         if (count($parts)>1)    {       // Only if more than one interface is defined will we show the selector:
00508 
00509                                         // Initialize:
00510                                 $tempLabels=explode(',',$this->L_vars[5]);
00511                                 $labels=array();
00512                                 $labels['backend']=$tempLabels[0];
00513                                 $labels['frontend']=$tempLabels[1];
00514 
00515                                 $jumpScript=array();
00516                                 $jumpScript['backend']='alt_main.php';
00517                                 $jumpScript['frontend']='../';
00518 
00519                                         // Traverse the interface keys:
00520                                 foreach($parts as $valueStr)    {
00521                                         $this->interfaceSelector.='
00522                                                         <option value="'.htmlspecialchars($valueStr).'">'.htmlspecialchars($labels[$valueStr]).'</option>';
00523                                         $this->interfaceSelector_jump.='
00524                                                         <option value="'.htmlspecialchars($jumpScript[$valueStr]).'">'.htmlspecialchars($labels[$valueStr]).'</option>';
00525                                 }
00526                                 $this->interfaceSelector='
00527                                                 <select name="interface" class="c-interfaceselector">'.$this->interfaceSelector.'
00528                                                 </select>';
00529                                 $this->interfaceSelector_jump='
00530                                                 <select name="interface" class="c-interfaceselector" onchange="document.location=this.options[this.selectedIndex].value;">'.$this->interfaceSelector_jump.'
00531                                                 </select>';
00532 
00533                         } else {        // If there is only ONE interface value set:
00534 
00535                                 $this->interfaceSelector_hidden='<input type="hidden" name="interface" value="'.trim($TYPO3_CONF_VARS['BE']['interfaces']).'" />';
00536                         }
00537                 }
00538         }
00539 
00550         function makeCopyrightNotice()  {
00551 
00552                         // Get values from TYPO3_CONF_VARS:
00553                 $loginCopyrightWarrantyProvider = strip_tags(trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightWarrantyProvider']));
00554                 $loginCopyrightWarrantyURL = strip_tags(trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightWarrantyURL']));
00555 
00556                         // Make warranty note:
00557                 if (strlen($loginCopyrightWarrantyProvider)>=2 && strlen($loginCopyrightWarrantyURL)>=10)       {
00558                         $warrantyNote='Warranty is supplied by '.htmlspecialchars($loginCopyrightWarrantyProvider).'; <a href="'.htmlspecialchars($loginCopyrightWarrantyURL).'" target="_blank">click for details.</a>';
00559                 } else {
00560                         $warrantyNote='TYPO3 comes with ABSOLUTELY NO WARRANTY; <a href="http://typo3.com/1316.0.html" target="_blank">click for details.</a>';
00561                 }
00562 
00563                         // Compile full copyright notice:
00564                 $copyrightNotice = '<a href="http://typo3.com/" target="_blank">'.
00565                                         '<img src="gfx/loginlogo_transp.gif" width="75" height="19" alt="TYPO3 logo" align="left" />'.
00566                                         'TYPO3 CMS'.($GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightShowVersion']?' ver. '.htmlspecialchars($GLOBALS['TYPO_VERSION']):'').
00567                                         '</a>. '.
00568                                         'Copyright &copy; 1998-2005 Kasper Sk&#229;rh&#248;j. Extensions are copyright of their respective owners. '.
00569                                         'Go to <a href="http://typo3.com/" target="_blank">http://typo3.com/</a> for details. '.
00570                                         $warrantyNote.' '.
00571                                         'This is free software, and you are welcome to redistribute it under certain conditions; <a href="http://typo3.com/1316.0.html" target="_blank">click for details</a>. '.
00572                                         'Obstructing the appearance of this notice is prohibited by law.';
00573 
00574                         // Return notice:
00575                 return $copyrightNotice;
00576         }
00577 
00583         function makeLoginBoxImage()    {
00584                 $loginboxImage = '';
00585                 if ($GLOBALS['TBE_STYLES']['loginBoxImage_rotationFolder'])     {               // Look for rotation image folder:
00586                         $absPath = t3lib_div::resolveBackPath(PATH_typo3.$GLOBALS['TBE_STYLES']['loginBoxImage_rotationFolder']);
00587 
00588                                 // Get rotation folder:
00589                         $dir = t3lib_div::getFileAbsFileName($absPath);
00590                         if ($dir && @is_dir($dir))      {
00591 
00592                                         // Get files for rotation into array:
00593                                 $files = t3lib_div::getFilesInDir($dir,'png,jpg,gif');
00594 
00595                                         // Pick random file:
00596                                 srand((float) microtime() * 10000000);
00597                                 $randImg = array_rand($files, 1);
00598 
00599                                         // Get size of random file:
00600                                 $imgSize = @getimagesize($dir.$files[$randImg]);
00601 
00602                                         // Create image tag:
00603                                 if (is_array($imgSize)) {
00604                                         $loginboxImage = '<img src="'.htmlspecialchars($GLOBALS['TBE_STYLES']['loginBoxImage_rotationFolder'].$files[$randImg]).'" '.$imgSize[3].' id="loginbox-image" alt="" />';
00605                                 }
00606                         }
00607                 } else {        // If no rotation folder configured, print default image:
00608                         $loginImage = 'loginimage-3.8.0.jpg';
00609                         $imagecopy = $loginImage=='loginbox_image_dev.png' ? 'You are running the CVS version of TYPO3 '.$GLOBALS['TYPO_VERSION'] : 'Photo: &copy; 2005 Kasper Sk&#229;rh&#248;j';      // Directly outputted in image attributes...
00610                         $loginboxImage = '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/'.$loginImage,'width="200" height="133"').' id="loginbox-image" alt="'.$imagecopy.'" title="'.$imagecopy.'" />';
00611                 }
00612 
00613                         // Return image tag:
00614                 return $loginboxImage;
00615         }
00616 
00623         function makeLoginNews()        {
00624 
00625                         // Reset output variable:
00626                 $newsContent= '';
00627 
00628                         // Traverse news array IF there are records in it:
00629                 if (is_array($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews']) && count($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews']))  {
00630                         foreach($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'] as $newsItem)    {
00631                                 $newsContent.='
00632                                                 <tr>
00633                                                         <td class="c-date">'.htmlspecialchars($newsItem['date']).'</td>
00634                                                         <td class="c-header">'.htmlspecialchars($newsItem['header']).'</td>
00635                                                 </tr>
00636                                                 <tr>
00637                                                         <td></td>
00638                                                         <td class="c-content">'.trim($newsItem['content']).'</td>
00639                                                 </tr>
00640                                                 <tr class="c-spacer">
00641                                                         <td colspan="2"></td>
00642                                                 </tr>
00643                                 ';
00644                         }
00645 
00646                                 // Wrap in a table:
00647                         $newsContent= '
00648 
00649                                         <!--
00650                                                 Login screen news:
00651                                         -->
00652                                         <div id="loginNews">
00653                                         <h2>'.htmlspecialchars($this->L_vars[8]).'</h2>
00654                                         <table border="0" cellpadding="0" cellspacing="0">
00655                                                 '.$newsContent.'
00656                                         </table>
00657                                         </div>
00658                         ';
00659                 }
00660 
00661                         // Return content:
00662                 return $newsContent;
00663         }
00664 }
00665 
00666 // Include extension?
00667 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/index.php']) {
00668         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/index.php']);
00669 }
00670 
00671 
00672 
00673 
00674 
00675 
00676 
00677 
00678 
00679 
00680 // Make instance:
00681 $SOBE = t3lib_div::makeInstance('SC_index');
00682 $SOBE->init();
00683 $SOBE->main();
00684 $SOBE->printContent();
00685 ?>


Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6