Added detection of password fields in generic checkForm javascript function
[squirrelmail.git] / functions / page_header.php
index a658c6e5122ab28effa0c5a86abfaa21a90735ad..bf731b50f10be978eb8d89c9110bc1c0a7e9c197 100644 (file)
@@ -18,6 +18,7 @@ require_once(SM_PATH . 'functions/global.php');
 
 /* Always set up the language before calling these functions */
 function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) {
+    global $squirrelmail_language;
 
     if ( !sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) {
         global $base_uri;
@@ -36,6 +37,11 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE
              $base_uri . 'themes/css/'.$custom_css.'" />';
     }
     
+    if ($squirrelmail_language == 'ja_JP') {
+        echo "<!-- \xfd\xfe -->\n";
+        echo '<meta http-equuiv="Content-type" content="text/html; charset=euc-jp">' . "\n";
+    }
+    
     if ($do_hook) {
         do_hook('generic_header');
     }
@@ -167,7 +173,8 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
                     "var e = document.forms[i].elements.length;\n".
                     "var j = 0;\n".
                     "while( pos == -1 && j < e ) {\n".
-                        "if ( document.forms[i].elements[j].type == 'text' ) {\n".
+                        "if ( document.forms[i].elements[j].type == 'text' " .
+                        "|| document.forms[i].elements[j].type == 'password' ) {\n".
                             "pos = j;\n".
                         "}\n".
                         "j++;\n".
@@ -315,4 +322,5 @@ function compose_Header($color, $mailbox) {
 
     echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\" $onload>\n\n";
 }
-?>
+
+?>
\ No newline at end of file