* Made everything here global too to work with new include system
[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
d068c0ec 14 if (!isset($strings_php))
15 include("../functions/strings.php");
2b40637c 16 if (!isset($config_php))
17 include("../config/config.php");
d10eeaf8 18 if (!isset($i18n_php))
19 include("../functions/i18n.php");
d7d3c4d4 20 if (!isset($plugin_php))
21 include("../functions/plugin.php");
21c3249f 22
441f2d33 23 // $squirrelmail_language is set by a cookie when the user selects
24 // language and logs out
25 set_up_language($squirrelmail_language, true);
288491a4 26
c6d6fe73 27 // Need the base URI to set the cookies. (Same code as in webmail.php)
28 ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
29 $base_uri = $regs[1];
30
09bb89f7 31 setcookie("username", '', 0, $base_uri);
32 setcookie("key", '', 0, $base_uri);
c6d6fe73 33 setcookie("logged_in", 0, 0, $base_uri);
34
35 // In case the last session was not terminated properly, make sure
36 // we get a new one.
23a8095f 37 $cookie_params = session_get_cookie_params();
38 setcookie(session_name(),"",0,$cookie_params["domain"].$cookie_params["path"]);
c6d6fe73 39
288491a4 40 echo "<HTML>";
41 echo "<HEAD><TITLE>";
0e743004 42 echo $org_name . " - " . _("Login");
288491a4 43 echo "</TITLE></HEAD>\n";
175e7218 44 echo "<BODY TEXT=000000 BGCOLOR=#FFFFFF LINK=0000CC VLINK=0000CC ALINK=0000CC>\n";
f644ad10 45 echo "<FORM ACTION=\"redirect.php\" METHOD=\"POST\" NAME=f>\n";
1899535f 46
09bb89f7 47 $username_form_name = 'login_username';
1899535f 48 $password_form_name = 'secretkey';
49 do_hook('login_top');
50
d61936fe 51 echo "<CENTER><IMG SRC=\"$org_logo\"></CENTER>\n";
aae41ae9 52 echo "<CENTER><SMALL>";
d10eeaf8 53 printf (_("SquirrelMail version %s"), $version);
54 echo "<BR>\n";
55 echo _("By the SquirrelMail Development Team");
aae41ae9 56 echo "<BR></SMALL><CENTER>\n";
21c3249f 57 echo "<TABLE COLS=1 WIDTH=350>\n";
58 echo " <TR>\n";
175e7218 59 echo " <TD BGCOLOR=#DCDCDC>\n";
d10eeaf8 60 echo " <B><CENTER>";
61 printf (_("%s Login"), $org_name);
62 echo "</CENTER></B>\n";
21c3249f 63 echo " </TD>\n";
64 echo " </TR><TR>\n";
175e7218 65 echo " <TD BGCOLOR=#FFFFFF>\n";
21c3249f 66 echo " <TABLE COLS=2 WIDTH=100%>\n";
67 echo " <TR>\n";
68 echo " <TD WIDTH=30% ALIGN=right>\n";
67c62ef9 69 echo _("Name:");
21c3249f 70 echo " </TD><TD WIDTH=* ALIGN=left>\n";
1899535f 71 echo " <INPUT TYPE=TEXT NAME=\"$username_form_name\">\n";
21c3249f 72 echo " </TD>\n";
73 echo " </TR><TR>\n";
74 echo " <TD WIDTH=30% ALIGN=right>\n";
67c62ef9 75 echo _("Password:");
21c3249f 76 echo " </TD><TD WIDTH=* ALIGN=left>\n";
1899535f 77 echo " <INPUT TYPE=PASSWORD NAME=\"$password_form_name\">\n";
21c3249f 78 echo " </TD>\n";
79 echo " </TABLE>\n";
80 echo " </TD>\n";
81 echo " </TR><TR>\n";
82 echo " <TD>\n";
67c62ef9 83 echo " <CENTER><INPUT TYPE=SUBMIT VALUE=\"";
84 echo _("Login");
9ee3e401 85 echo "\"></CENTER>\n";
21c3249f 86 echo " </TD>\n";
87 echo " </TR>\n";
88 echo "</TABLE>\n";
a37f3771 89 echo "<input type=hidden name=just_logged_in value=1>\n";
21c3249f 90 echo "</FORM>\n";
06ad27a2 91 do_hook("login_bottom");
21c3249f 92?>
21c3249f 93</BODY>
94</HTML>
95