aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/config.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/config.php')
-rw-r--r--inc/config.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/inc/config.php b/inc/config.php
index 84b86998..4c1978b5 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -17,6 +17,7 @@ require_once 'rain.tpl.class.php';
17 17
18$db = new db(DB_PATH); 18$db = new db(DB_PATH);
19 19
20# Initialisation de RainTPL
20raintpl::$tpl_dir = './tpl/'; 21raintpl::$tpl_dir = './tpl/';
21raintpl::$cache_dir = './cache/'; 22raintpl::$cache_dir = './cache/';
22raintpl::$base_url = get_poche_url(); 23raintpl::$base_url = get_poche_url();
@@ -24,10 +25,23 @@ raintpl::configure('path_replace', false);
24raintpl::configure('debug', false); 25raintpl::configure('debug', false);
25$tpl = new raintpl(); 26$tpl = new raintpl();
26 27
28# Démarrage session et initialisation du jeton de sécurité
27session_start(); 29session_start();
28 30
29if (!isset($_SESSION['token_poche'])) { 31if (!isset($_SESSION['token_poche'])) {
30 $token = md5(uniqid(rand(), TRUE)); 32 $token = md5(uniqid(rand(), TRUE));
31 $_SESSION['token_poche'] = $token; 33 $_SESSION['token_poche'] = $token;
32 $_SESSION['token_time_poche'] = time(); 34 $_SESSION['token_time_poche'] = time();
35}
36
37# Traitement des paramètres et déclenchement des actions
38$action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['action']) : '';
39$_SESSION['view'] = (isset ($_GET['view'])) ? htmlentities($_GET['view']) : 'index';
40$_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id';
41$id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : '';
42$url = (isset ($_GET['url'])) ? $_GET['url'] : '';
43$token = (isset ($_REQUEST['token'])) ? $_REQUEST['token'] : '';
44
45if ($action != '') {
46 action_to_do($action, $id, $url, $token);
33} \ No newline at end of file 47} \ No newline at end of file