* More minor changes
[squirrelmail.git] / src / login.php
CommitLineData
59177427 1<?php
21c3249f 2 /**
c6d6fe73 3 ** login.php -- simple login screen
4 **
5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
21c3249f 7 **
c6d6fe73 8 ** This a simple login screen. Some housekeeping is done to clean
9 ** cookies and find language.
21c3249f 10 **
2b40637c 11 ** $Id$
21c3249f 12 **/
13
d4e84069 14 $rcptaddress = '';
15 if (isset($emailaddress)) {
16 if (stristr($emailaddress, 'mailto:'))
17 $rcptaddress = substr($emailaddress, 7);
18 else
19 $rcptaddress = $emailaddress;
20 }
21
f740c049 22 include("../functions/strings.php");
23 include("../config/config.php");
4f0780d0 24 include('../functions/i18n.php');
f740c049 25 include("../functions/plugin.php");
21c3249f 26
441f2d33 27 // $squirrelmail_language is set by a cookie when the user selects
28 // language and logs out
29 set_up_language($squirrelmail_language, true);
288491a4 30
c6d6fe73 31 // Need the base URI to set the cookies. (Same code as in webmail.php)
32 ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
33 $base_uri = $regs[1];
34
09bb89f7 35 setcookie("username", '', 0, $base_uri);
36 setcookie("key", '', 0, $base_uri);
f64a4dca 37 header ("Pragma: no-cache");
c6d6fe73 38
39 // In case the last session was not terminated properly, make sure
40 // we get a new one.
23a8095f 41 $cookie_params = session_get_cookie_params();
42 setcookie(session_name(),"",0,$cookie_params["domain"].$cookie_params["path"]);
c6d6fe73 43
901d125e 44 do_hook('login_cookie');
288491a4 45 echo "<HTML>";
46 echo "<HEAD><TITLE>";
0e743004 47 echo $org_name . " - " . _("Login");
288491a4 48 echo "</TITLE></HEAD>\n";
175e7218 49 echo "<BODY TEXT=000000 BGCOLOR=#FFFFFF LINK=0000CC VLINK=0000CC ALINK=0000CC>\n";
f644ad10 50 echo "<FORM ACTION=\"redirect.php\" METHOD=\"POST\" NAME=f>\n";
1899535f 51
09bb89f7 52 $username_form_name = 'login_username';
1899535f 53 $password_form_name = 'secretkey';
54 do_hook('login_top');
55
d61936fe 56 echo "<CENTER><IMG SRC=\"$org_logo\"></CENTER>\n";
aae41ae9 57 echo "<CENTER><SMALL>";
d10eeaf8 58 printf (_("SquirrelMail version %s"), $version);
59 echo "<BR>\n";
60 echo _("By the SquirrelMail Development Team");
aae41ae9 61 echo "<BR></SMALL><CENTER>\n";
21c3249f 62 echo "<TABLE COLS=1 WIDTH=350>\n";
63 echo " <TR>\n";
175e7218 64 echo " <TD BGCOLOR=#DCDCDC>\n";
d10eeaf8 65 echo " <B><CENTER>";
66 printf (_("%s Login"), $org_name);
67 echo "</CENTER></B>\n";
21c3249f 68 echo " </TD>\n";
69 echo " </TR><TR>\n";
175e7218 70 echo " <TD BGCOLOR=#FFFFFF>\n";
21c3249f 71 echo " <TABLE COLS=2 WIDTH=100%>\n";
72 echo " <TR>\n";
73 echo " <TD WIDTH=30% ALIGN=right>\n";
67c62ef9 74 echo _("Name:");
21c3249f 75 echo " </TD><TD WIDTH=* ALIGN=left>\n";
e1f548e8 76 echo " <INPUT TYPE=TEXT NAME=\"$username_form_name\"";
77 if (isset($loginname))
78 echo " value=\"" . htmlspecialchars($loginname) . "\"";
79 echo ">\n";
21c3249f 80 echo " </TD>\n";
81 echo " </TR><TR>\n";
82 echo " <TD WIDTH=30% ALIGN=right>\n";
67c62ef9 83 echo _("Password:");
21c3249f 84 echo " </TD><TD WIDTH=* ALIGN=left>\n";
1899535f 85 echo " <INPUT TYPE=PASSWORD NAME=\"$password_form_name\">\n";
6978d355 86 echo " </TD>\n";
d4e84069 87 if ($rcptaddress != '') {
6978d355 88 echo " <INPUT TYPE=HIDDEN NAME=\"rcptemail\" VALUE=\"".htmlspecialchars($rcptaddress)."\">\n";
89 }
21c3249f 90 echo " </TABLE>\n";
91 echo " </TD>\n";
92 echo " </TR><TR>\n";
93 echo " <TD>\n";
67c62ef9 94 echo " <CENTER><INPUT TYPE=SUBMIT VALUE=\"";
95 echo _("Login");
9ee3e401 96 echo "\"></CENTER>\n";
21c3249f 97 echo " </TD>\n";
98 echo " </TR>\n";
99 echo "</TABLE>\n";
a37f3771 100 echo "<input type=hidden name=just_logged_in value=1>\n";
901d125e 101 do_hook('login_form');
21c3249f 102 echo "</FORM>\n";
06ad27a2 103 do_hook("login_bottom");
21c3249f 104?>
21c3249f 105</BODY>
106</HTML>
107