1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

stockage de la vue et du tri en session

This commit is contained in:
nicosomb 2013-04-16 11:52:25 +02:00
parent 643e3037e6
commit 139769aa24
8 changed files with 99 additions and 88 deletions

View file

@ -17,6 +17,7 @@ require_once 'rain.tpl.class.php';
$db = new db(DB_PATH);
# Initialisation de RainTPL
raintpl::$tpl_dir = './tpl/';
raintpl::$cache_dir = './cache/';
raintpl::$base_url = get_poche_url();
@ -24,10 +25,23 @@ raintpl::configure('path_replace', false);
raintpl::configure('debug', false);
$tpl = new raintpl();
# Démarrage session et initialisation du jeton de sécurité
session_start();
if (!isset($_SESSION['token_poche'])) {
$token = md5(uniqid(rand(), TRUE));
$_SESSION['token_poche'] = $token;
$_SESSION['token_time_poche'] = time();
}
# Traitement des paramètres et déclenchement des actions
$action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['action']) : '';
$_SESSION['view'] = (isset ($_GET['view'])) ? htmlentities($_GET['view']) : 'index';
$_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id';
$id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : '';
$url = (isset ($_GET['url'])) ? $_GET['url'] : '';
$token = (isset ($_REQUEST['token'])) ? $_REQUEST['token'] : '';
if ($action != '') {
action_to_do($action, $id, $url, $token);
}