4 * login.php -- simple login screen
6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * This a simple login screen. Some housekeeping is done to clean
10 * cookies and find language.
15 /* Path for SquirrelMail required files. */
16 define('SM_PATH','../');
18 /* SquirrelMail required files. */
19 require_once(SM_PATH
. 'functions/strings.php');
20 require_once(SM_PATH
. 'config/config.php');
21 require_once(SM_PATH
. 'functions/i18n.php');
22 require_once(SM_PATH
. 'functions/plugin.php');
23 require_once(SM_PATH
. 'functions/constants.php');
24 require_once(SM_PATH
. 'functions/page_header.php');
25 require_once(SM_PATH
. 'functions/html.php');
26 require_once(SM_PATH
. 'functions/global.php');
29 * $squirrelmail_language is set by a cookie when the user selects
30 * language and logs out
32 set_up_language($squirrelmail_language, TRUE);
35 * Find out the base URI to set cookies.
37 if (!function_exists('sqm_baseuri')){
38 require_once(SM_PATH
. 'functions/display_messages.php');
40 $base_uri = sqm_baseuri();
43 * In case the last session was not terminated properly, make sure
49 header('Pragma: no-cache');
51 do_hook('login_cookie');
53 /* Output the javascript onload function. */
55 $header = "<SCRIPT LANGUAGE=\"JavaScript\" type=\"text/javascript\">\n" .
57 " function squirrelmail_loginpage_onload() {\n".
58 " document.forms[0].js_autodetect_results.value = '" . SMPREF_JS_ON
. "';\n".
59 ' document.forms[0].elements[' . (isset($loginname) ?
1 : 0) . "].focus();\n".
64 displayHtmlHeader( "$org_name - " . _("Login"), $header, FALSE );
66 /* Set the title of this page. */
67 echo '<body text="#000000" bgcolor="#FFFFFF" link="#0000CC" vlink="#0000CC" alink="#0000CC" onLoad="squirrelmail_loginpage_onload();">';
69 $username_form_name = 'login_username';
70 $password_form_name = 'secretkey';
73 $loginname_value = (isset($loginname) ?
htmlspecialchars($loginname) : '');
75 /* Display width and height like good little people */
76 $width_and_height = '';
77 if (isset($org_logo_width) && is_numeric($org_logo_width) && $org_logo_width>0) {
78 $width_and_height = " width=\"$org_logo_width\"";
80 if (isset($org_logo_height) && is_numeric($org_logo_height) && $org_logo_height>0) {
81 $width_and_height .= " height=\"$org_logo_height\"";
84 echo "\n" . '<form action="redirect.php" method="post">' . "\n" .
89 '<img src="' . $org_logo . '" alt="' . sprintf(_("%s Logo"), $org_name) .'"' .
90 $width_and_height .'><br>' . "\n".
91 ( $hide_sm_attributions ?
'' :
92 '<small>' . sprintf (_("SquirrelMail version %s"), $version) . '<br>' ."\n".
93 ' ' . _("By the SquirrelMail Development Team") . '<br></small>' . "\n" ) .
97 '<b>' . sprintf (_("%s Login"), $org_name) . "</b>\n",
101 html_tag( 'td', "\n" .
106 'right', '', 'width="30%"' ) .
108 '<input type="text" name="' . $username_form_name .'" value="' . $loginname_value .'">' ,
109 'left', '', 'width="*"' )
114 'right', '', 'width="30%"' ) .
116 '<input type="password" name="' . $password_form_name . '">' . "\n" .
117 '<input type=hidden name="js_autodetect_results" value="SMPREF_JS_OFF">' . "\n" .
118 '<input type=hidden name="just_logged_in" value=1>' . "\n",
119 'left', '', 'width="*"' )
121 'center', '#ffffff', 'border="0" width="100%"' ) ,
126 '<center><input type="submit" value="' . _("Login") . '"></center>',
129 '', '#ffffff', 'border="0" width="350"' ) . '</center>',
132 '', '#ffffff', 'border="0" cellspacing="0" cellpadding="0" width="100%"' ) .
135 do_hook('login_form');
137 do_hook('login_bottom');