save last selected server profile

This commit is contained in:
Roland Gruber 2008-05-25 16:25:09 +00:00
parent d38e91e9f1
commit fe3778a0ec
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,7 @@
August 2008 2.4.0
- save last selected server profile from login page
30.04.2008 2.3.0 30.04.2008 2.3.0
- added Polish translation - added Polish translation
- support phpGroupWare accounts - support phpGroupWare accounts

View File

@ -115,6 +115,11 @@ include_once("../lib/config.inc"); // Include config.inc which provides Config c
session_save_path("../sess"); // Set session save path session_save_path("../sess"); // Set session save path
session_start(); // Start LDAP Account Manager session session_start(); // Start LDAP Account Manager session
// save last selected login profile
if(isset($_POST['profile'])) {
setcookie("lam_default_profile", $_POST['profile'], time() + 365*60*60*24);
}
/** /**
* Displays the login window. * Displays the login window.
* *
@ -458,6 +463,9 @@ elseif(!empty($_POST['profileChange'])) {
else { else {
$default_Config = new LAMCfgMain(); $default_Config = new LAMCfgMain();
$default_Profile = $default_Config->default; $default_Profile = $default_Config->default;
if(isset($_COOKIE["lam_default_profile"])) {
$default_Profile = $_COOKIE["lam_default_profile"];
}
$_SESSION["config"] = new LAMConfig($default_Profile); // Create new Config object $_SESSION["config"] = new LAMConfig($default_Profile); // Create new Config object
$_SESSION["cfgMain"] = $default_Config; // Create new CfgMain object $_SESSION["cfgMain"] = $default_Config; // Create new CfgMain object