]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - index.php
dd70a989d897ebd5b6cbb51bb1e251818f51a779
3 * poche, a read it later open source system
6 * @author Nicolas LÅ“uillet <support@inthepoche.com>
8 * @license http://www.wtfpl.net/ see COPYING file
11 include dirname(__FILE__
).'/inc/poche/config.inc.php';
13 #XSRF protection with token
14 // if (!empty($_POST)) {
15 // if (!Session::isToken($_POST['token'])) {
16 // die(_('Wrong token'));
18 // unset($_SESSION['tokens']);
21 $referer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'];
22 $view = Tools
::checkVar('view', 'home');
23 $action = Tools
::checkVar('action');
24 $id = Tools
::checkVar('id');
25 $_SESSION['sort'] = Tools
::checkVar('sort');
26 $url = new Url((isset ($_GET['url'])) ? $_GET['url'] : '');
28 if (isset($_GET['login'])) {
30 $poche->login($referer);
32 elseif (isset($_GET['logout'])) {
36 elseif (isset($_GET['config'])) {
38 $poche->updatePassword();
40 elseif (isset($_GET['import'])) {
41 $poche->import($_GET['from']);
43 elseif (isset($_GET['export'])) {
48 'referer' => $referer,
50 'poche_url' => Tools
::getPocheUrl(),
51 'title' => _('poche, a read it later open source system'),
52 'token' => Session
::getToken(),
55 if (Session
::isLogged()) {
56 $poche->action($action, $url, $id);
57 $tpl_file = Tools
::getTplFile($view);
58 $tpl_vars = array_merge($tpl_vars, $poche->displayView($view, $id));
61 $tpl_file = 'login.twig';
64 # because messages can be added in $poche->action(), we have to add this entry now (we can add it before)
65 $tpl_vars = array_merge($tpl_vars, array('messages' => $poche->messages
->display()));
68 echo $poche->tpl
->render($tpl_file, $tpl_vars);