X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=html%2Fmain.php;h=be5e03e17217dd4e7c87fff3421b1b67ff1f065a;hb=4c7176eae519797d671a29a48cb7a13a9b5d8c09;hp=ba5668e115d1e8400a7b9e77f07b9c5f296b3ef2;hpb=9fb66349a9eca632b26842821e8606de50b816f7;p=gosa.git diff --git a/html/main.php b/html/main.php index ba5668e11..be5e03e17 100644 --- a/html/main.php +++ b/html/main.php @@ -60,7 +60,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST"){ /* 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; } @@ -73,7 +73,7 @@ $_SESSION['LastError'] = ""; /* 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; } @@ -99,7 +99,7 @@ if(empty($_SESSION['_LAST_PAGE_REQUEST'])){ */ 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; } @@ -144,6 +144,7 @@ if(!isset($_SESSION['CurrentMainBase'])){ } $lang.=".UTF-8"; + putenv("LANGUAGE="); putenv("LANG=$lang"); setlocale(LC_ALL, $lang); @@ -170,7 +171,7 @@ $plist= $_SESSION['plist']; /* 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 (); } @@ -186,7 +187,7 @@ if (isset($_GET['plug'])){ $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; } @@ -349,7 +350,7 @@ if((isset($config->data['MAIN']['ACCOUNT_EXPIRATION'])) && $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")); } } @@ -364,7 +365,6 @@ if (is_file("$plugin_dir/main.inc")){ /* Print_out last ErrorMessage repeated string. */ -print_red(NULL); $smarty->assign("contents", $display); @@ -373,10 +373,20 @@ if (isset($_SESSION['errors'])){ $smarty->assign("errors", $_SESSION['errors']); } if ($error_collector != ""){ - $smarty->assign("php_errors", $error_collector.""); + $smarty->assign("php_errors", preg_replace("/%BUGBODY%/",$error_collector_mailto,$error_collector).""); } 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= ''; +} +$smarty->assign("focus", $focus); + $display= $header.$smarty->fetch(get_template_path('framework.tpl')); /* Show page... */