diff --git a/html/index.php b/html/index.php
index e911823c56da99f972e0503674f209e4ed44361e..b07da22c1a9e1d0b6eb6616e02fc6eab35f5e3ee 100644 (file)
--- a/html/index.php
+++ b/html/index.php
} else {
$lang= $config->data['MAIN']['LANG'];
}
-$lang.=".UTF-8";
putenv("LANGUAGE=");
putenv("LANG=$lang");
setlocale(LC_ALL, $lang);
/* Login as user, initialize user ACL's */
$ui= ldap_login_user($username, $_POST["password"]);
- if ($ui === NULL || $ui == 0){
+ if ($ui === NULL || !$ui){
$message= _("Please check the username/password combination.");
$smarty->assign ('nextfield', 'password');
new log("security","login","",array(),"Authentication failed for user \"$username\"") ;
$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:
?>