aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/config.php
diff options
context:
space:
mode:
authornicosomb <nicolas@loeuillet.org>2013-04-16 11:52:25 +0200
committernicosomb <nicolas@loeuillet.org>2013-04-16 11:52:25 +0200
commit139769aa245fd58d032cb009303b0ea2cc4187cd (patch)
tree5a69fec8dedb380e034b318a4fb16e0c664c2545 /inc/config.php
parent643e3037e6e63befb2cec20f7986f14480d4ae4b (diff)
downloadwallabag-139769aa245fd58d032cb009303b0ea2cc4187cd.tar.gz
wallabag-139769aa245fd58d032cb009303b0ea2cc4187cd.tar.zst
wallabag-139769aa245fd58d032cb009303b0ea2cc4187cd.zip
stockage de la vue et du tri en session
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