04ee698a4f77bf87fd524367bd6398542f4aefd7
3 ** login.php -- simple login screen
5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
8 ** This a simple login screen. Some housekeeping is done to clean
9 ** cookies and find language.
14 include("../functions/strings.php");
15 include("../config/config.php");
16 include('../functions/i18n.php');
17 include("../functions/plugin.php");
19 // $squirrelmail_language is set by a cookie when the user selects
20 // language and logs out
21 set_up_language($squirrelmail_language, true);
23 // Need the base URI to set the cookies. (Same code as in webmail.php)
24 ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
27 setcookie("username", '', 0, $base_uri);
28 setcookie("key", '', 0, $base_uri);
29 setcookie("logged_in", 0, 0, $base_uri);
30 header ("Pragma: no-cache");
32 // In case the last session was not terminated properly, make sure
34 $cookie_params = session_get_cookie_params();
35 setcookie(session_name(),"",0,$cookie_params["domain"].$cookie_params["path"]);
37 do_hook('login_cookie');
40 echo $org_name . " - " . _("Login");
41 echo "</TITLE></HEAD>\n";
42 echo "<BODY TEXT=000000 BGCOLOR=#FFFFFF LINK=0000CC VLINK=0000CC ALINK=0000CC>\n";
43 echo "<FORM ACTION=\"redirect.php\" METHOD=\"POST\" NAME=f>\n";
45 $username_form_name = 'login_username';
46 $password_form_name = 'secretkey';
49 echo "<CENTER><IMG SRC=\"$org_logo\"></CENTER>\n";
50 echo "<CENTER><SMALL>";
51 printf (_("SquirrelMail version %s"), $version);
53 echo _("By the SquirrelMail Development Team");
54 echo "<BR></SMALL><CENTER>\n";
55 echo "<TABLE COLS=1 WIDTH=350>\n";
57 echo " <TD BGCOLOR=#DCDCDC>\n";
59 printf (_("%s Login"), $org_name);
60 echo "</CENTER></B>\n";
63 echo " <TD BGCOLOR=#FFFFFF>\n";
64 echo " <TABLE COLS=2 WIDTH=100%>\n";
66 echo " <TD WIDTH=30% ALIGN=right>\n";
68 echo " </TD><TD WIDTH=* ALIGN=left>\n";
69 echo " <INPUT TYPE=TEXT NAME=\"$username_form_name\"";
70 if (isset($loginname))
71 echo " value=\"" . htmlspecialchars($loginname) . "\"";
75 echo " <TD WIDTH=30% ALIGN=right>\n";
77 echo " </TD><TD WIDTH=* ALIGN=left>\n";
78 echo " <INPUT TYPE=PASSWORD NAME=\"$password_form_name\">\n";
80 if (isset($emailaddress)) {
81 if (stristr($emailaddress,"mailto:"))
82 $rcptaddress = substr ($emailaddress, 7,strlen($emailaddress)-7);
84 $rcptaddress = $emailaddress;
85 echo " <INPUT TYPE=HIDDEN NAME=\"rcptemail\" VALUE=\"".htmlspecialchars($rcptaddress)."\">\n";
91 echo " <CENTER><INPUT TYPE=SUBMIT VALUE=\"";
93 echo "\"></CENTER>\n";
97 echo "<input type=hidden name=just_logged_in value=1>\n";
98 do_hook('login_form');
100 do_hook("login_bottom");