$set->setSessionTimeout($_POST["session_timeout"]); $_POST["session_timeout"] = $set->getSessionTimeout(); $set->setItemsPerPage($_POST["items_per_page"]); $_POST["items_per_page"] = $set->getItemsPerPage(); if (!$set->validateData()) { $formError["session_timeout"] = $set->getSessionTimeoutError(); $formError["items_per_page"] = $set->getItemsPerPageError(); Form::setSession($_POST, $formError); header("Location: ../admin/setting_edit_form.php"); exit; } /** * Destroy form values and errors */ Form::unsetSession(); /** * Update app settings */ $setQ = new Query_Setting(); $setQ->update($set); if (isset($_POST["id_theme"])) { $setQ->updateTheme($_POST["id_theme"]); } $setQ->close(); unset($setQ); unset($set); /** * Redirect to destiny to avoid reload problem */ FlashMsg::add(_("Data has been updated.")); header("Location: ../admin/setting_edit_form.php");
/** * Checking for post vars. Go back to $returnLocation if none found. */ if (count($_POST) == 0) { header("Location: " . $returnLocation); exit; } /** * Checking permissions */ require_once "../auth/login_check.php"; loginCheck(OPEN_PROFILE_ADMINISTRATOR); require_once "../lib/Form.php"; /** * Destroy form values and errors */ Form::unsetSession(); /** * Update theme in use */ $idTheme = intval($_POST["id_theme"]); require_once "../model/Query/Setting.php"; $setQ = new Query_Setting(); $setQ->updateTheme($idTheme); $setQ->close(); unset($setQ); /** * Redirect to $returnLocation to avoid reload problem */ FlashMsg::add(_("Default theme has been changed.")); header("Location: " . $returnLocation);