-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
29 lines (23 loc) · 848 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require_once 'vendor/autoload.php';
use \iutnc\netvod\dispatch\Dispatcher as Dispatcher;
use iutnc\netvod\bd\ConnectionFactory;
session_start();
ConnectionFactory::setConfig("src/classes/bd/db.config.ini");
if (isset($_GET['action'])) {
$action = $_GET['action'];
} else {
$action = "accueil";
}
if (!isset($_SESSION['id_user']) && $action != 'add-user' && $action != 'mdp-oublie' && $action != 'mdp-oublie-confirmation' && $action != 'confirmer-inscription' && $action!='load-profil'){
if (isset($_SESSION['email'])){
$action='load-profil';
}else{
$action = 'sign-in';
}
}else{
$_SESSION['list_url'][]= $_SERVER['QUERY_STRING'];
if (count($_SESSION['list_url'])>8) array_shift($_SESSION['list_url']);
}
$dispatcher = new Dispatcher($action);
$dispatcher->run();