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