diff options
Diffstat (limited to 'inc/config.php')
-rw-r--r-- | inc/config.php | 14 |
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 | ||
20 | raintpl::$tpl_dir = './tpl/'; | 21 | raintpl::$tpl_dir = './tpl/'; |
21 | raintpl::$cache_dir = './cache/'; | 22 | raintpl::$cache_dir = './cache/'; |
22 | raintpl::$base_url = get_poche_url(); | 23 | raintpl::$base_url = get_poche_url(); |
@@ -24,10 +25,23 @@ raintpl::configure('path_replace', false); | |||
24 | raintpl::configure('debug', false); | 25 | raintpl::configure('debug', false); |
25 | $tpl = new raintpl(); | 26 | $tpl = new raintpl(); |
26 | 27 | ||
28 | # Démarrage session et initialisation du jeton de sécurité | ||
27 | session_start(); | 29 | session_start(); |
28 | 30 | ||
29 | if (!isset($_SESSION['token_poche'])) { | 31 | if (!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 | |||
45 | if ($action != '') { | ||
46 | action_to_do($action, $id, $url, $token); | ||
33 | } \ No newline at end of file | 47 | } \ No newline at end of file |