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