header('location: /login/'); exit; } $v_username = $user; $v_min = escapeshellarg($_POST['v_min']); $v_hour = escapeshellarg($_POST['v_hour']); $v_day = escapeshellarg($_POST['v_day']); $v_month = escapeshellarg($_POST['v_month']); $v_wday = escapeshellarg($_POST['v_wday']); $v_cmd = escapeshellarg($_POST['v_cmd']); // Save changes exec(VESTA_CMD . "v-change-cron-job " . $v_username . " " . $v_job . " " . $v_min . " " . $v_hour . " " . $v_day . " " . $v_month . " " . $v_wday . " " . $v_cmd, $output, $return_var); check_return_code($return_var, $output); unset($output); $v_cmd = $_POST['v_cmd']; // Set success message if (empty($_SESSION['error_msg'])) { $_SESSION['ok_msg'] = __("Changes has been saved."); } } // Header include $_SERVER['DOCUMENT_ROOT'] . '/templates/header.html'; // Panel top_panel($user, $TAB); // Display body include $_SERVER['DOCUMENT_ROOT'] . '/templates/admin/edit_cron.html'; // Flush session messages unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); // Footer include $_SERVER['DOCUMENT_ROOT'] . '/templates/footer.html';
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Bibliothèque</title> <link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" type="text/css" href="css/component.css" /> </head> <body> <a href="index.php"><img class="image-header" src="image/header.jpg"/></a> <section> <div id="panel"> <?php top_panel(); ?> </div> <br> <?php if ($_SESSION['langue'] == 'ru') { echo '<h1 class="titre">мой счет</h1>'; } else { echo '<h1 class="titre">Mon Compte</h1>'; } ?> <div id="mid_emprunt"> <?php body_panel(); ?> </div>
function render_page($user, $TAB, $page) { $__template_dir = dirname(__DIR__) . '/templates/'; $__pages_js_dir = dirname(__DIR__) . '/js/pages/'; // Header include $__template_dir . 'header.html'; // Panel top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB); // Extarct global variables // I think those variables should be passed via arguments //* extract($GLOBALS, EXTR_SKIP); /*/ $variables = array_filter($GLOBALS, function($key){return preg_match('/^(v_|[a-z])[a-z\d]+$/', $key);}, ARRAY_FILTER_USE_KEY); extract($variables, EXTR_OVERWRITE); //*/ // Body if ($_SESSION['user'] !== 'admin' && @(include $__template_dir . "user/{$page}.html")) { // User page loaded } else { // Not admin or user page doesn't exist // Load admin page @(include $__template_dir . "admin/{$page}.html"); } // Including common js files @(include_once dirname(__DIR__) . '/templates/scripts.html'); // Including page specific js file if (file_exists($__pages_js_dir . $page . '.js')) { echo '<script type="text/javascript" src="/js/pages/' . $page . '.js?' . JS_LATEST_UPDATE . '"></script>'; } // Footer include $__template_dir . 'footer.html'; }
$v_ns3 = str_replace("'", "", $v_ns3); $v_ns4 = str_replace("'", "", $v_ns4); $v_ns5 = str_replace("'", "", $v_ns5); $v_ns6 = str_replace("'", "", $v_ns6); $v_ns7 = str_replace("'", "", $v_ns7); $v_ns8 = str_replace("'", "", $v_ns8); } // Set success message if (empty($_SESSION['error_msg'])) { $_SESSION['ok_msg'] = __('Changes has been saved.'); } } // Header include $_SERVER['DOCUMENT_ROOT'] . '/templates/header.html'; // Panel if (!empty($_SESSION['look'])) { top_panel($user, $TAB); } else { top_panel($_SESSION['user'], $TAB); } // Display body if ($_SESSION['user'] == 'admin') { include $_SERVER['DOCUMENT_ROOT'] . '/templates/admin/edit_user.html'; } else { include $_SERVER['DOCUMENT_ROOT'] . '/templates/user/edit_user.html'; } // Flush session messages unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); // Footer include $_SERVER['DOCUMENT_ROOT'] . '/templates/footer.html';