test
continuous-integration/drone/push Build is passing Details

ServeurDeTest
Noé GARNIER 2 years ago
parent 82b617df35
commit cfbb8cbfb4

@ -7,13 +7,16 @@ class FrontController
global $error, $view, $rep; global $error, $view, $rep;
session_start(); session_start();
// Check role permissions // Check role permissions
echo "FrontController1\n";
if (isset($_SESSION['role'])) { if (isset($_SESSION['role'])) {
$role = $_SESSION['role']; $role = $_SESSION['role'];
} else { } else {
$role = "visitor"; $role = "visitor";
} }
// Check if action exists // Check if action exists
echo "FrontController2\n";
$action = $_REQUEST['action']; $action = $_REQUEST['action'];
echo $action . "\n";
if ($role == "user") { if ($role == "user") {
if ($action == NULL) { if ($action == NULL) {
new UserController(); new UserController();
@ -25,6 +28,7 @@ class FrontController
new UserController(); new UserController();
} }
} else { } else {
echo "FrontController3\n";
new VisitorController(); new VisitorController();
} }
} catch (Exception $e) { } catch (Exception $e) {

@ -7,6 +7,7 @@ class VisitorController
function __construct() function __construct()
{ {
try { try {
echo "VisitorController1\n";
global $dsn, $rep, $vues, $error; global $dsn, $rep, $vues, $error;
$model = new VisitorModel(); $model = new VisitorModel();
$action = $_REQUEST['action']; $action = $_REQUEST['action'];

Loading…
Cancel
Save