X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Flogin.php;h=974d6a30ce4950a4cbd2120f7f1c912f475ccf97;hb=beebd508e91d2929a68929840ccad722f4af48bb;hp=15f365cfee5bc9319d68e5fd9daa60cc15ae1773;hpb=c0c5cf6acfaf81c8649d79fa917b1bfb47928ecb;p=squirrelmail.git diff --git a/src/login.php b/src/login.php index 15f365cf..974d6a30 100644 --- a/src/login.php +++ b/src/login.php @@ -3,12 +3,11 @@ /** * login.php -- simple login screen * - * Copyright (c) 1999-2005 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * * This a simple login screen. Some housekeeping is done to clean * cookies and find language. * + * @copyright © 1999-2006 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail */ @@ -51,7 +50,13 @@ $base_uri = sqm_baseuri(); */ sqsession_destroy(); - +/** + * PHP bug. http://bugs.php.net/11643 (warning, spammed bug tracker) and + * http://bugs.php.net/13834 + * SID constant is not destroyed in PHP 4.1.2, 4.2.3 and maybe other + * versions. Produces warning on login page. Bug should be fixed only in 4.3.0 + */ +@sqsession_start(); header('Pragma: no-cache'); /** @@ -61,7 +66,7 @@ header('Pragma: no-cache'); */ if($imap_auth_mech == 'login') { /** - * detect disabled login, only when imapServerAddress contains + * detect disabled login, only when imapServerAddress contains * server address and not mapping. See sqimap_get_user_server() */ if (substr($imapServerAddress, 0, 4) != "map:") { @@ -81,11 +86,32 @@ if($imap_auth_mech == 'login') { } } +/* + * Initialize the template object and custom error handler object + */ +include_once(SM_PATH . 'class/template/template.class.php'); +include_once(SM_PATH . 'class/error.class.php'); + +/* + * $sTplDir is not initialized when a user is not logged in, so we will use + * the config file defaults here. If the neccesary variables are net set, + * force a default value. + */ +$aTemplateSet = ( !isset($aTemplateSet) ? array() : $aTemplateSet ); +$templateset_default = ( !isset($templateset_default) ? 0 : $templateset_default ); +$sTplDir = ( !isset($aTemplateSet[$templateset_default]['PATH']) ? + SM_PATH . 'templates/default/' : + $aTemplateSet[$templateset_default]['PATH'] ); + +$oTemplate = new Template($sTplDir); +$oErrorHandler = new ErrorHandler($oTemplate,'error_message.tpl'); + do_hook('login_cookie'); -/* Output the javascript onload function. */ +$loginname_value = (sqGetGlobalVar('loginname', $loginname) ? htmlspecialchars($loginname) : ''); -$header = "