diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php index 4f21551f..d036373d 100644 --- a/lam/templates/config/confmain.php +++ b/lam/templates/config/confmain.php @@ -50,7 +50,7 @@ if (isset($_POST['passwd'])) $passwd = $_POST['passwd']; // check if password was entered // if not: load login page -if (!isset($passwd) && !isset($_SESSION['conf_isAuthenticated'])) { +if (!isset($passwd) && !(isset($_SESSION['conf_isAuthenticated']) && isset($_SESSION['conf_config']))) { $_SESSION['conf_message'] = _("No password was entered!"); /** go back to login if password is empty */ metaRefresh('conflogin.php'); @@ -83,6 +83,10 @@ if (isset($_POST['cancelSettings'])) { } $errorsToDisplay = array(); +if (isset($_SESSION['conf_messages']) && is_array($_SESSION['conf_messages'])) { + $errorsToDisplay = array_merge($errorsToDisplay, $_SESSION['conf_messages']); + unset($_SESSION['conf_messages']); +} // check if button was pressed and if we have to save the settings or go to another tab if (isset($_POST['saveSettings']) || isset($_POST['editmodules']) @@ -156,7 +160,7 @@ foreach ($jsFiles as $jsEntry) { isWritable()) { - StatusMessage('WARN', 'The config file is not writable.', 'Your changes cannot be saved until you make the file writable for the webserver user.'); + StatusMessage('WARN', _('The config file is not writable.'), _('Your changes cannot be saved until you make the file writable for the webserver user.')); echo "
"; } diff --git a/lam/templates/config/confsave.php b/lam/templates/config/confsave.php index 29aacfa2..eb1ae7f1 100644 --- a/lam/templates/config/confsave.php +++ b/lam/templates/config/confsave.php @@ -85,10 +85,10 @@ for ($i = 0; $i < sizeof($sessionKeys); $i++) { } if ($result === LAMConfig::SAVE_OK) { - metaRefresh('../login.php?configSaveOk=1&configSaveFile=' . $conf->getPath()); + metaRefresh('../login.php?configSaveOk=1&configSaveFile=' . $conf->getName()); } else { - metaRefresh('../login.php?configSaveFailed=1&configSaveFile=' . $conf->getPath()); + metaRefresh('../login.php?configSaveFailed=1&configSaveFile=' . $conf->getName()); } ?> \ No newline at end of file diff --git a/lam/templates/config/profmanage.php b/lam/templates/config/profmanage.php index ece5df77..ef59fbd4 100644 --- a/lam/templates/config/profmanage.php +++ b/lam/templates/config/profmanage.php @@ -43,52 +43,6 @@ if (strtolower(session_module_name()) == 'files') { setlanguage(); -echo $_SESSION['header']; - -?> - - - <?php - echo _("Profile management"); - ?> - - read()) { - if (substr($cssEntry, strlen($cssEntry) - 4, 4) != '.css') continue; - echo "\n"; - } - ?> - - - - - - - - -
-  LDAP Account Manager  LDAP Account Manager - - configuration  -
-
- -read()) { - if (substr($jsEntry, strlen($jsEntry) - 3, 3) != '.js') continue; - $jsFiles[] = $jsEntry; -} -sort($jsFiles); -foreach ($jsFiles as $jsEntry) { - echo "\n"; -} $cfg = new LAMCfgMain(); // check if submit button was pressed @@ -116,7 +70,11 @@ if (isset($_POST['submit'])) { $conf = new LAMConfig($_POST['addprofile']); $conf->set_Passwd($_POST['addpassword']); $conf->save(); - $msg = _("Created new profile."); + $_SESSION['conf_isAuthenticated'] = $_POST['addprofile']; + $_SESSION['conf_config'] = $conf; + $_SESSION['conf_messages'][] = array('INFO', _("Created new profile."), $_POST['addprofile']); + metaRefresh('confmain.php'); + exit; } else { $error = _("Unable to create new profile!"); @@ -168,19 +126,66 @@ if (isset($_POST['submit'])) { $configMain = null; $msg = _("New default profile set successfully."); } - // print messages - if (isset($error) || isset($msg)) { - if (isset($error)) { - StatusMessage("ERROR", $error); - } - if (isset($msg)) { - StatusMessage("INFO", $msg); - } - } - else exit; } +echo $_SESSION['header']; + +?> + + + <?php + echo _("Profile management"); + ?> + + read()) { + if (substr($cssEntry, strlen($cssEntry) - 4, 4) != '.css') continue; + echo "\n"; + } + ?> + + + + + + + + +
+  LDAP Account Manager  LDAP Account Manager + + configuration  +
+
+ +read()) { + if (substr($jsEntry, strlen($jsEntry) - 3, 3) != '.js') continue; + $jsFiles[] = $jsEntry; +} +sort($jsFiles); +foreach ($jsFiles as $jsEntry) { + echo "\n"; +} + +// print messages +if (isset($error) || isset($msg)) { + if (isset($error)) { + StatusMessage("ERROR", $error); + } + if (isset($msg)) { + StatusMessage("INFO", $msg); + } +} + // check if config.cfg is valid if (!isset($cfg->default)) { StatusMessage("ERROR", _("Please set up your master configuration file (config/config.cfg) first!"), "");