698262c3c459f6ebd3481b44aeda87bcb156769c
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.
14 require_once('../functions/strings.php');
15 require_once('../config/config.php');
16 require_once('../functions/i18n.php');
17 require_once('../functions/plugin.php');
18 require_once('../functions/constants.php');
19 require_once('../functions/page_header.php');
20 //require_once('../class/browser.class.php');
22 // initialize some vars
23 if(!isset($UA)) $UA = '';
24 if(!isset($cc)) $cc = '';
25 if(!isset($dl)) $dl = '';
26 if(!isset($am)) $am = '';
28 //$sniffer_settings = array('check_cookies'=>$cc,
29 // 'default_language'=>$dl,
30 // 'allow_masquerading'=>$am);
31 //$browser = new phpSniff($UA,$sniffer_settings);
34 * $squirrelmail_language is set by a cookie when the user selects
35 * language and logs out
37 set_up_language($squirrelmail_language, TRUE);
40 * Find out the base URI to set cookies.
42 if (!function_exists('sqm_baseuri')){
43 require_once('../functions/display_messages.php');
45 $base_uri = sqm_baseuri();
48 //session_register('browser');
50 * In case the last session was not terminated properly, make sure
53 $cookie_params = session_get_cookie_params();
54 setcookie(session_name(), '', 0, $cookie_params['path'],
55 $cookie_params['domain']);
56 setcookie('username', '', 0, $base_uri);
57 setcookie('key', '', 0, $base_uri);
58 header('Pragma: no-cache');
60 do_hook('login_cookie');
62 /* Output the javascript onload function. */
64 $header = "<SCRIPT LANGUAGE=\"JavaScript\" TYPE=\"text/javascript\">\n" .
66 " function squirrelmail_loginpage_onload() {\n".
67 " document.forms[0].js_autodetect_results.value = '" . SMPREF_JS_ON
. "';\n".
68 ' document.forms[0].elements[' . (isset($loginname) ?
1 : 0) . "].focus();\n".
73 displayHtmlHeader( "$org_name - " . _("Login"), $header, FALSE );
75 /* Set the title of this page. */
76 echo '<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000CC" VLINK="#0000CC" ALINK="#0000CC" onLoad="squirrelmail_loginpage_onload();">'.
77 "\n<FORM ACTION=\"redirect.php\" METHOD=\"POST\">\n";
79 $username_form_name = 'login_username';
80 $password_form_name = 'secretkey';
83 $loginname_value = (isset($loginname) ?
htmlspecialchars($loginname) : '');
85 /* Display width and height like good little people */
86 $width_and_height = '';
87 if (isset($org_logo_width) && is_int($org_logo_width) && $org_logo_width>0) {
88 $width_and_height = " WIDTH=\"$org_logo_width\"";
90 if (isset($org_logo_height) && is_int($org_logo_height) && $org_logo_height>0) {
91 $width_and_height .= " HEIGHT=\"$org_logo_height\"";
95 " <IMG SRC=\"$org_logo\" ALT=\"" . sprintf(_("%s Logo"), $org_name) .
96 "\"$width_and_height><BR>\n".
97 ( $hide_sm_attributions ?
'' :
98 '<SMALL>' . sprintf (_("SquirrelMail version %s"), $version) . "<BR>\n".
99 ' ' . _("By the SquirrelMail Development Team") . "<BR></SMALL>\n" ) .
103 "<TABLE COLS=\"1\" WIDTH=\"350\">\n".
104 " <TR><TD ALIGN=CENTER BGCOLOR=\"#DCDCDC\">\n".
105 ' <B>' . sprintf (_("%s Login"), $org_name) . "</B>\n".
107 " <TR><TD BGCOLOR=\"#FFFFFF\"><TABLE COLS=2 WIDTH=\"100%\">\n".
109 ' <TD WIDTH="30%" ALIGN=right>' . _("Name:") . "</TD>\n".
110 " <TD WIDTH=\"*\" ALIGN=left>\n".
111 " <INPUT TYPE=TEXT NAME=\"$username_form_name\" VALUE=\"$loginname_value\">\n".
115 ' <TD WIDTH="30%" ALIGN=right>' . _("Password:") . "</TD>\n".
116 " <TD WIDTH=\"*\" ALIGN=left>\n".
117 " <INPUT TYPE=PASSWORD NAME=\"$password_form_name\">\n".
118 " <INPUT TYPE=HIDDEN NAME=\"js_autodetect_results\" VALUE=\"" . SMPREF_JS_OFF
. "\">\n".
119 " <INPUT TYPE=HIDDEN NAME=\"just_logged_in\" value=1>\n".
122 " </TABLE></TD></TR>\n".
124 ' <CENTER><INPUT TYPE=SUBMIT VALUE="' . _("Login") . "\"></CENTER>\n".
129 do_hook('login_form');
132 do_hook('login_bottom');