diff --git a/html/main.php b/html/main.php
index ba5668e115d1e8400a7b9e77f07b9c5f296b3ef2..be5e03e17217dd4e7c87fff3421b1b67ff1f065a 100644 (file)
--- a/html/main.php
+++ b/html/main.php
/* Logged in? Simple security check */
if (!isset($_SESSION['config'])){
- gosa_log ("main.php called without session - logging out");
+ new log("security","login","",array(),"main.php called without session - logging out") ;
header ("Location: logout.php");
exit;
}
/* Check for uniqe ip address */
$ui= $_SESSION["ui"];
if ($_SERVER['REMOTE_ADDR'] != $ui->ip){
- gosa_log ("main.php called with session which has a changed IP address.", 3);
+ new log("security","login","",array(),"main.php called with session which has a changed IP address.") ;
header ("Location: logout.php");
exit;
}
*/
if($request_time > $max_life){
session_unset();
- gosa_log ("main.php called without session - logging out");
+ new log("security","login","",array(),"main.php called without session - logging out") ;
header ("Location: logout.php");
exit;
}
}
$lang.=".UTF-8";
+
putenv("LANGUAGE=");
putenv("LANG=$lang");
setlocale(LC_ALL, $lang);
/* Check for register globals */
if (isset($global_check) && $config->data['MAIN']['FORCEGLOBALS'] == 'true'){
echo _("FATAL: Register globals is on. GOsa will refuse to login unless this is fixed by an administrator.");
- gosa_log ("Register globals is on. For security reasons, this should be turned off.");
+ new log("security","login","",array(),"Register globals is on. For security reasons, this should be turned off.") ;
session_destroy ();
exit ();
}
$plugin_dir= $plist->get_path($plug);
$_SESSION['plugin_dir']= $plugin_dir;
if ($plugin_dir == ""){
- gosa_log ("main.php called with invalid plug parameter \"$plug\"", 3);
+ new log("security","gosa","",array(),"main.php called with invalid plug parameter \"$plug\"") ;
header ("Location: logout.php");
exit;
}
$expired= ldap_expired_account($config, $ui->dn, $ui->username);
if ($expired == 2){
- gosa_log ("password for user \"$ui->username\" is about to expire");
+ new log("security","gosa","",array(),"password for user \"$ui->username\" is about to expire") ;
print_red(_("Your password is about to expire, please change your password"));
}
}
/* Print_out last ErrorMessage repeated string. */
-print_red(NULL);
$smarty->assign("contents", $display);
$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", "");
}
+
+/* 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);
+
$display= $header.$smarty->fetch(get_template_path('framework.tpl'));
/* Show page... */