]> git.immae.eu Git - github/wallabag/wallabag.git/blame - inc/config.php
Fixed #13 - tri par date / tri par titre
[github/wallabag/wallabag.git] / inc / config.php
CommitLineData
e46efced 1<?php
2/**
3 * poche, a read it later open source system
4 *
5 * @category poche
6 * @author Nicolas Lœuillet <nicolas@loeuillet.org>
7 * @copyright 2013
8 * @license http://www.wtfpl.net/ see COPYING file
9 */
10define ('DB_PATH', 'sqlite:./db/poche.sqlite');
11
12include 'db.php';
13include 'functions.php';
14require_once 'Readability.php';
15require_once 'Encoding.php';
8046748b 16require_once 'rain.tpl.class.php';
17
18$db = new db(DB_PATH);
19
139769aa 20# Initialisation de RainTPL
8046748b 21raintpl::$tpl_dir = './tpl/';
22raintpl::$cache_dir = './cache/';
23raintpl::$base_url = get_poche_url();
24raintpl::configure('path_replace', false);
25raintpl::configure('debug', false);
cf3180f6 26$tpl = new raintpl();
27
139769aa 28# Démarrage session et initialisation du jeton de sécurité
cf3180f6 29session_start();
30
31if (!isset($_SESSION['token_poche'])) {
32 $token = md5(uniqid(rand(), TRUE));
33 $_SESSION['token_poche'] = $token;
34 $_SESSION['token_time_poche'] = time();
139769aa 35}
36
37# Traitement des paramètres et déclenchement des actions
9fee2e72 38$view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index';
139769aa 39$action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['action']) : '';
139769aa 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);
cf3180f6 47}