Added comments to ChangeLog about fixed bugs #496752 and #496753.
[squirrelmail.git] / src / login.php
index c1b91df648440c68ba694008e305c48c64fbcf67..27e9bc18f43dc968b42668fa10249f6e56a8f78b 100644 (file)
@@ -1,18 +1,35 @@
 <?php
-    /**
-     * login.php -- simple login screen
-     * 
-     * Copyright (c) 1999-2001 The Squirrelmail Development Team
-     * Licensed under the GNU GPL. For full terms see the file COPYING.
-     *
-     * This a simple login screen. Some housekeeping is done to clean
-     * cookies and find language.
-     *
-     * $Id$
-     */
 
-    $rcptaddress = '';
-    if (isset($emailaddress)) {
+/**
+ * login.php -- simple login screen
+ *
+ * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * This a simple login screen. Some housekeeping is done to clean
+ * cookies and find language.
+ *
+ * $Id$
+ */
+
+/*****************************************************************/
+/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!!           ***/
+/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION.             ***/
+/***    + Base level indent should begin at left margin, as    ***/
+/***      the first two lines below look.                      ***/
+/***    + All identation should consist of four space blocks   ***/
+/***    + Tab characters are evil.                             ***/
+/***    + all comments should use "slash-star ... star-slash"  ***/
+/***      style -- no pound characters, no slash-slash style   ***/
+/***    + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD      ***/
+/***      ALWAYS USE { AND } CHARACTERS!!!                     ***/
+/***    + Please use ' instead of ", when possible. Note "     ***/
+/***      should always be used in _( ) function calls.        ***/
+/*** Thank you for your help making the SM code more readable. ***/
+/*****************************************************************/
+
+$rcptaddress = '';
+if (isset($emailaddress)) {
         if (stristr($emailaddress, 'mailto:')) {
             $rcptaddress = substr($emailaddress, 7);
         } else {
         $rcptaddress = urlencode($rcptaddress);
     }
 
+
+
     require_once('../functions/strings.php');
     require_once('../config/config.php');
     require_once('../functions/i18n.php');
     require_once('../functions/plugin.php');
     require_once('../functions/constants.php');
+    require_once('../functions/page_header.php');
 
     /*
      * $squirrelmail_language is set by a cookie when the user selects
      * In case the last session was not terminated properly, make sure
      * we get a new one.
      */
-    $cookie_params = session_get_cookie_params(); 
-    setcookie(session_name(),'',0,$cookie_params['path'].$cookie_params['domain']); 
+    $cookie_params = session_get_cookie_params();
+    setcookie(session_name(),'',0,$cookie_params['path'].$cookie_params['domain']);
     setcookie('username', '', 0, $base_uri);
     setcookie('key', '', 0, $base_uri);
     header ('Pragma: no-cache');
 
     do_hook('login_cookie');
 
-    echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' .
-         "\n\n" .
-         "<HTML>\n" .
-         "<HEAD>\n";
-
-    if ($theme_css != '') {
-        echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n";
-    }
-
     /* Output the javascript onload function. */
-    echo "<SCRIPT LANGUAGE=\"JavaScript\">\n" .
-         "<!--\n".
-         "  function squirrelmail_loginpage_onload() {\n".
-         "    document.forms[0].js_autodetect_results.value = '" . SMPREF_JS_ON . "';\n".
-         "    document.forms[0].elements[0].focus();\n".
-         "  }\n".
-         "// -->\n".
-         "</script>\n";
+    displayHtmlHeader( "$org_name - " . _("Login"),
+                 "<SCRIPT LANGUAGE=\"JavaScript\">\n" .
+                 "<!--\n".
+                 "  function squirrelmail_loginpage_onload() {\n".
+                 "    document.forms[0].js_autodetect_results.value = '" . SMPREF_JS_ON . "';\n".
+                 "    document.forms[0].elements[0].focus();\n".
+                 "  }\n".
+                 "// -->\n".
+                 "</script>\n", FALSE );
 
     /* Set the title of this page. */
-    echo "<TITLE>$org_name - " . _("Login") . "</TITLE></HEAD>\n".
-         "<BODY TEXT=#000000 BGCOLOR=#FFFFFF LINK=#0000CC VLINK=#0000CC ALINK=#0000CC onLoad='squirrelmail_loginpage_onload();'>\n".
+    echo "<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000CC\" VLINK=\"#0000CC\" ALINK=\"#0000CC\" onLoad='squirrelmail_loginpage_onload();'>\n".
          "<FORM ACTION=\"redirect.php\" METHOD=\"POST\" NAME=f>\n";
 
     $username_form_name = 'login_username';
 
          "<CENTER>\n".
          "<TABLE COLS=1 WIDTH=350>\n".
-         "   <TR><TD BGCOLOR=#DCDCDC>\n".
-         '      <B><CENTER>' . sprintf (_("%s Login"), $org_name) . "</CENTER></B>\n".
+         "   <TR><TD ALIGN=CENTER BGCOLOR=\"#DCDCDC\">\n".
+         '      <B>' . sprintf (_("%s Login"), $org_name) . "</B>\n".
          "   </TD></TR>".
          "   <TR><TD BGCOLOR=\"#FFFFFF\"><TABLE COLS=2 WIDTH=\"100%\">\n".
          "      <TR>\n".
-         '         <TD WIDTH=30% ALIGN=right>' . _("Name:") . "</TD>\n".
-         "         <TD WIDTH=* ALIGN=left>\n".
+         '         <TD WIDTH="30%" ALIGN=right>' . _("Name:") . "</TD>\n".
+         "         <TD WIDTH=\"*\" ALIGN=left>\n".
          "            <INPUT TYPE=TEXT NAME=\"$username_form_name\" VALUE=\"$loginname_value\">\n".
          "         </TD>\n".
          "      </TR>\n".