<?php require_once "inc/path.php"; require_once "user/user.php"; inclure_inc("const", "param", "session"); define("_MSG_ERREUR_CONNEXION", "0"); define("_MSG_SUCCES_CONNEXION", "1"); $param = new param(); // Contrôle du code secret $code_secret = $param->post(_PARAM_CODE_SECRET); if (strlen($code_secret) > 0) { echo _MSG_ERREUR_CONNEXION; exit; } // Contrôle de la page à administrer $page = $param->post(_PARAM_PAGE); if (strlen($page) == 0) { echo _MSG_ERREUR_CONNEXION; exit; } // Cas particulier de la page actu if (!strcmp($page, _HTML_PREFIXE_ACTU)) { echo _MSG_ERREUR_CONNEXION; exit; } $est_actu = preg_match("/^" . _HTML_PREFIXE_ACTU . "-[1-5]\$/", $page); if ($est_actu == 1) { $dossier = _XML_PATH_PAGES . _HTML_PREFIXE_ACTU; } else { $dossier = _XML_PATH_PAGES . $page; }
<?php require_once "inc/path.php"; inclure_inc("const", "param", "html"); $param = new param(); $page = $param->get(_PARAM_PAGE); if (strlen($page) == 0) { header("HTTP/1.0 404 Not Found"); exit; } // Cas particulier de la page actu if (!strcmp($page, _HTML_PREFIXE_ACTU)) { header("HTTP/1.0 404 Not Found"); exit; } $est_actu = preg_match("/^" . _HTML_PREFIXE_ACTU . "-[1-5]\$/", $page); if ($est_actu == 1) { $no_actu = (int) substr($page, 1 + strlen(_HTML_PREFIXE_ACTU)); $dossier = _XML_PATH_PAGES . _HTML_PREFIXE_ACTU; $page_retour = _PHP_PATH_ROOT . _HTML_PATH_ACTU . "?" . _PARAM_ID . "=" . $no_actu; } else { $dossier = _XML_PATH_PAGES . $page; $page_retour = _PHP_PATH_ROOT . $page . _PXP_EXT; } // Vérification de l'existence de la page if (!file_exists($dossier)) { header("HTTP/1.0 404 Not Found"); exit; } $html = new html(); $html->ouvrir();