Example #1
0
* @brief
*/
include '../inc/includes.php';
Session::checkRight("config", READ);
$config = new Config();
$_POST['id'] = 1;
if (!empty($_POST["update_auth"])) {
    $config->update($_POST);
    Html::back();
}
if (!empty($_POST["update"])) {
    $config->update($_POST);
    Html::redirect(Toolbox::getItemTypeFormURL('Config'));
}
if (!empty($_GET['reset_opcache'])) {
    $config->checkGlobal(UPDATE);
    if (opcache_reset()) {
        Session::addMessageAfterRedirect(__('Cache reset successful'));
    }
    Html::redirect(Toolbox::getItemTypeFormURL('Config'));
}
if (!empty($_GET['reset_apcu'])) {
    $config->checkGlobal(UPDATE);
    if (apc_clear_cache('user')) {
        Session::addMessageAfterRedirect(__('Cache reset successful'));
    }
    Html::redirect(Toolbox::getItemTypeFormURL('Config'));
}
Html::header(Config::getTypeName(1), $_SERVER['PHP_SELF'], "config", "config");
$config->display(array('id' => 1));
Html::footer();