diff --git a/html/index.php b/html/index.php
index 7977dfab03cb46087fa67931475669ce426df3d3..77c375bc909e773937b1a4bef44171ac5cfd5cf4 100644 (file)
--- a/html/index.php
+++ b/html/index.php
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"])){
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);
$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:
?>