Code

Adde timezone check
[gosa.git] / html / index.php
index 7977dfab03cb46087fa67931475669ce426df3d3..77c375bc909e773937b1a4bef44171ac5cfd5cf4 100644 (file)
@@ -27,7 +27,7 @@ header("Content-type: text/html; charset=UTF-8");
 function displayLogin()
 {
   global $smarty,$message,$config,$ssl,$error_collector;
-  error_reporting(E_ALL);
+  error_reporting(E_ALL | E_STRICT);
     /* Fill template with required values */
     $username = "";
     if(isset($_POST["username"])){
@@ -149,12 +149,7 @@ if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))){
 clean_smarty_compile_dir($smarty->compile_dir);
 
 /* Language setup */
-if ($config->data['MAIN']['LANG'] == ""){
-  $lang= get_browser_language();
-} else {
-  $lang= $config->data['MAIN']['LANG'];
-}
-$lang.=".UTF-8";
+$lang= get_browser_language();
 putenv("LANGUAGE=");
 putenv("LANG=$lang");
 setlocale(LC_ALL, $lang);
@@ -366,12 +361,20 @@ if (isset($_SESSION['errors'])){
   $smarty->assign("errors", $_SESSION['errors']);
 }
 if ($error_collector != ""){
-  $smarty->assign("php_errors", $error_collector."</div>");
+  $smarty->assign("php_errors", preg_replace("/%BUGBODY%/",$error_collector_mailto,$error_collector)."</div>");
 } else {
   $smarty->assign("php_errors", "");
 }
-displayLogin();
 
+/* Set focus to the error button if we've an error message */
+$focus= "";
+if (isset($_SESSION['errors']) && $_SESSION['errors'] != ""){
+  $focus= '<script language="JavaScript" type="text/javascript">';
+  $focus.= 'document.forms[0].error_accept.focus();';
+  $focus.= '</script>';
+}
+$smarty->assign("focus", $focus);
+displayLogin();
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>