]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - inc/config.php
3 * poche, a read it later open source system
6 * @author Nicolas Lœuillet <nicolas@loeuillet.org>
8 * @license http://www.wtfpl.net/ see COPYING file
10 define ('DB_PATH', 'sqlite:./db/poche.sqlite');
13 include 'functions.php';
14 require_once 'Readability.php';
15 require_once 'Encoding.php';
16 require_once 'rain.tpl.class.php';
18 $db = new db(DB_PATH
);
20 # Initialisation de RainTPL
21 raintpl
::$tpl_dir = './tpl/';
22 raintpl
::$cache_dir = './cache/';
23 raintpl
::$base_url = get_poche_url();
24 raintpl
::configure('path_replace', false);
25 raintpl
::configure('debug', false);
28 # Démarrage session et initialisation du jeton de sécurité
31 if (!isset($_SESSION['token_poche'])) {
32 $token = md5(uniqid(rand(), TRUE));
33 $_SESSION['token_poche'] = $token;
34 $_SESSION['token_time_poche'] = time();
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'] : '';
46 action_to_do($action, $id, $url, $token);