function renderCurrentAction() { global $renderingMap, $config; // as defined in this file and configuration-file if (isset($renderingMap[getCurrentAction()])) { eval($renderingMap[getCurrentAction()]); } else { eval($renderingMap[$config['defaultaction']]); log_message("No mapping for requested rendering/process. " . getCurrentAction() . " Redirecting to defaultaction."); } }
function processCurrentAction() { global $processingMap; // defined in this file // retrieve command from $_GET and execute if (isset($processingMap[getCurrentAction()])) { log_message("Processing action request: " . getCurrentAction()); //execute command as defined in above mapping; eval($processingMap[getCurrentAction()]); } else { log_message("No mapping for requested action/process: " . getCurrentAction()); } }
<?php // start the session if (!isset($_SESSION)) { session_start(); } // only for ie // header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); require_once "./controller/configuration.php"; require_once "./controller/MySQL_Connector.php"; require_once "./controller/settings.php"; // effectue la bonne action selectiné par l'utilisateur switch (getCurrentAction()) { case $ACTION_logIn: // pour les test on utilise un compte deja existant // $user = new User("a.rousseau", "arousse"); $user = new User($_POST["login"], $_POST["password"]); if ($user->login()) { // TO DO: affiché une réussite } else { // TO DO: gestion des erreurs } break; case $ACTION_logOut: if (isConnectUser()) { $_SESSION["user"]->logout(); } break; case $ACTION_contactView: if (isset($_GET["contact"]) && $_GET["contact"] != -1) { if (isContactActif($_GET["contact"], $_SESSION["client"])) { $_SESSION["contact"] = $_GET["contact"];