You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
993 B

<?php
class FrontController
{
function __construct()
{
global $dsn, $user, $pass, $vues;
$listeAction_Administrator = array('goToAdministratorConnexion', 'verifValidation', 'ajoutSource', 'supprimerSource', 'setNbArticlesParPage', 'goToAdministratoristration', 'refreshData', 'quitterAdministrator');
try {
$action = "";
if (isset($_REQUEST['action'])) {
$action = $_REQUEST['action'];
}
if (in_array($action, $listeAction_Administrator)) {
if ($Administrator == NULL) {
new ControllerAdministrator();
} else {
header("Location:" . $vues["AdministratorConnexion"]);
}
} else {
$gate = new GatewayAdministrator(new ConnectionBaseDeDonnee($dsn, $user, $pass));
}
} catch (Exception $e) {
header("Location:" . $vues["erreur"]);
}
}
}