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