fixed renaming of default profile (3183920)
This commit is contained in:
parent
60aa501a75
commit
d630e1f9b0
|
@ -3,6 +3,8 @@ April 2011 3.4.0
|
|||
- LAM Pro:
|
||||
-> support automount entries
|
||||
-> Zarafa groups: allow combination with group of names
|
||||
- fixed bugs:
|
||||
-> renaming of default profile (3183920)
|
||||
|
||||
|
||||
12.02.2011 3.3.0
|
||||
|
|
|
@ -129,12 +129,16 @@ if (isset($_POST['submit'])) {
|
|||
}
|
||||
// rename profile
|
||||
elseif ($_POST['action'] == "rename") {
|
||||
if (preg_match("/^[a-z0-9_-]+$/i", $_POST['renfilename']) && !in_array($_POST['renfilename'], getConfigProfiles())) {
|
||||
if (rename("../../config/" . $_POST['oldfilename'] . ".conf",
|
||||
"../../config/" . $_POST['renfilename'] . ".conf")) {
|
||||
if (preg_match("/^[a-z0-9_-]+$/i", $_POST['oldfilename']) && preg_match("/^[a-z0-9_-]+$/i", $_POST['renfilename']) && !in_array($_POST['renfilename'], getConfigProfiles())) {
|
||||
if (rename("../../config/" . $_POST['oldfilename'] . ".conf", "../../config/" . $_POST['renfilename'] . ".conf")) {
|
||||
$msg = _("Renamed profile.");
|
||||
}
|
||||
else $error = _("Could not rename file!");
|
||||
// update default profile setting if needed
|
||||
if ($cfg->default == $_POST['oldfilename']) {
|
||||
$cfg->default = $_POST['renfilename'];
|
||||
$cfg->save();
|
||||
}
|
||||
}
|
||||
else $error = _("Profile name is invalid!");
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ if(isset($_GET['useProfile'])) {
|
|||
$default_Config = new LAMCfgMain();
|
||||
$_SESSION["cfgMain"] = $default_Config;
|
||||
$default_Profile = $default_Config->default;
|
||||
if(isset($_COOKIE["lam_default_profile"])) {
|
||||
if(isset($_COOKIE["lam_default_profile"]) && in_array($_COOKIE["lam_default_profile"], getConfigProfiles())) {
|
||||
$default_Profile = $_COOKIE["lam_default_profile"];
|
||||
}
|
||||
// Reload loginpage after a profile change
|
||||
|
|
Loading…
Reference in New Issue