]> git.immae.eu Git - github/wallabag/wallabag.git/blame - inc/config.php
Fixed #54 - récupération de l'id améliorée et utilisation de action_to_do() pour...
[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 */
1c182b6c 10
d178419c 11if (!is_dir('db/')) {
12 @mkdir('db/',0705);
13}
14
e46efced 15define ('DB_PATH', 'sqlite:./db/poche.sqlite');
d178419c 16define ('ABS_PATH', 'assets/');
d06f30ef 17define ('CONVERT_LINKS_FOOTNOTES', TRUE);
64458521 18define ('DOWNLOAD_PICTURES', TRUE);
e46efced 19
20include 'db.php';
21include 'functions.php';
22require_once 'Readability.php';
23require_once 'Encoding.php';
8046748b 24require_once 'rain.tpl.class.php';
25
26$db = new db(DB_PATH);
27
139769aa 28# Initialisation de RainTPL
8046748b 29raintpl::$tpl_dir = './tpl/';
30raintpl::$cache_dir = './cache/';
31raintpl::$base_url = get_poche_url();
32raintpl::configure('path_replace', false);
33raintpl::configure('debug', false);
cf3180f6 34$tpl = new raintpl();
35
139769aa 36# Démarrage session et initialisation du jeton de sécurité
cf3180f6 37session_start();
38
39if (!isset($_SESSION['token_poche'])) {
40 $token = md5(uniqid(rand(), TRUE));
41 $_SESSION['token_poche'] = $token;
42 $_SESSION['token_time_poche'] = time();
139769aa 43}
44
45# Traitement des paramètres et déclenchement des actions
9fee2e72 46$view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index';
139769aa 47$action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['action']) : '';
139769aa 48$_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id';
49$id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : '';
50$url = (isset ($_GET['url'])) ? $_GET['url'] : '';
51$token = (isset ($_REQUEST['token'])) ? $_REQUEST['token'] : '';
52
53if ($action != '') {
d06f30ef 54 action_to_do($action, $url, $token, $id);
1c182b6c 55}