Code

Added DNS and DHCP enable disable options into setup step 2
[gosa.git] / html / index.php
index e911823c56da99f972e0503674f209e4ed44361e..b07da22c1a9e1d0b6eb6616e02fc6eab35f5e3ee 100644 (file)
@@ -154,7 +154,6 @@ if ($config->data['MAIN']['LANG'] == ""){
 } else {
   $lang= $config->data['MAIN']['LANG'];
 }
-$lang.=".UTF-8";
 putenv("LANGUAGE=");
 putenv("LANG=$lang");
 setlocale(LC_ALL, $lang);
@@ -262,7 +261,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){
 
     /* 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\"") ;
@@ -366,12 +365,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:
 ?>