allow_php_tag = true; ## Fonction de sécurité (normalement inutile si le htaccess est activé) if (!securite()) { echo ''; die(ERROR_SITE_SECURITE); } ## Connexion à la base de données $sql = new Sql($rowConfig['mysql_hote'], $rowConfig['mysql_user'], $rowConfig['mysql_pass'], $rowConfig['mysql_base']); ## Parametres theme $themeSite = $sql->query("SELECT * FROM fw_themes WHERE th_etat = '1' ORDER BY th_id LIMIT 0,1"); $themeSite = $themeSite->fetch_array(); $smarty->template_dir = $_SERVER["DOCUMENT_ROOT"].'/templates/'.$themeSite['th_dossier'].'/'; $smarty->compile_dir = $_SERVER["DOCUMENT_ROOT"].'/templates_c/'.$themeSite['th_dossier'].'/'; ## Sécurisation des rules if (!protect_scripts($_SERVER["REQUEST_URI"])) { $_SERVER["REQUEST_URI"] = null; } ## Exploitation de la requête /* * Organisation de la requête : * $[1] = container (if NULL => /site/) * $[2] = action (if NULL => /main/) * $[3] = variables */ $rules = explode('/', utf8_decode(urldecode($_SERVER["REQUEST_URI"]))); $tag = $rules[1].' '.$rules[2]; ## Magic Access if($rules[1] == $rowConfig['magicAccess'] && $rowConfig['magicAccess'] != '') { $_SESSION['accessGranted'] = 'ok'; setcookie('accessGranted', $rowConfig['magicAccess'], time() + 86400 * 365, '/'); $rules = array(); } ## Traitement des règles if($rowConfig['maintenance'] == 1 && $_SESSION['accessGranted'] != 'ok' && $_COOKIE['accessGranted'] != $rowConfig['magicAccess']) { require_once ($rowConfig['folder_container'] . 'maintenance.php'); } else { ## Traitement rubrique if (strchr($rules[1], 'cat-')) { $rubExp = explode('-', $rules[1]); } ## Chargement du global require_once ($rowConfig['folder_container'] . 'global.php'); if ($rules[1] == null) { $rules[1] = 'site'; } if ($rules[2] == null) { $rules[2] = 'main'; } if ($rules[1] == 'manager') { if ($rules[3] == null) { $rules[3] = 'main'; } if (is_dir($rowConfig['folder_container'] . $rules[1])) { if (file_exists($rowConfig['folder_container'] . $rules[1] . '/' . $rules[2] . '/'.$rules[3].'.php')) { require_once ($rowConfig['folder_container'] . $rules[1] . '/' . $rules[2] . '/'.$rules[3].'.php'); } else { echo ''; } } else { echo ''; } } elseif (strchr($rules[1], 'cat-')) { $rules[1] = $rubExp[2]; if (is_dir($rowConfig['folder_container'] . $rules[1])) { if (file_exists($rowConfig['folder_container'] . $rules[1] . '/' . $rules[2] . '.php')) { require_once ($rowConfig['folder_container'] . $rules[1] . '/' . $rules[2] . '.php'); } else { echo ''; } } else { echo ''; } } else { if (is_dir($rowConfig['folder_container'] . $rules[1])) { if (file_exists($rowConfig['folder_container'] . $rules[1] . '/' . $rules[2] . '.php')) { require_once ($rowConfig['folder_container'] . $rules[1] . '/' . $rules[2] . '.php'); } else { echo ''; } } else { echo ''; } } } } // DEBUG if ($rowConfig['maintenance'] == 1) { echo '
'; foreach ($_POST AS $k=>$v) { echo ' '; } echo ' '; foreach ($_SESSION AS $k=>$v) { echo ' '; } echo ' '; foreach ($_COOKIE AS $k=>$v) { echo ' '; } echo '
DEBUG
♦ $_POST
'.$k.' '.$v.'
♦ $_SESSION
'.$k.' '.$v.'
♦ $_COOKIE
'.$k.' '.$v.'
'; } ?>