]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - index.php
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'));
17 // // TODO remettre le test
19 // unset($_SESSION['tokens']);
22 $referer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'];
23 $view = Tools
::checkVar('view');
24 $action = Tools
::checkVar('action');
25 $id = Tools
::checkVar('id');
26 $_SESSION['sort'] = Tools
::checkVar('sort');
27 $url = new Url((isset ($_GET['url'])) ? $_GET['url'] : '');
29 if (isset($_GET['login'])) {
31 $poche->login($referer);
33 elseif (isset($_GET['logout'])) {
37 elseif (isset($_GET['config'])) {
39 $poche->updatePassword();
41 elseif (isset($_GET['import'])) {
42 $poche->import($_GET['from']);
44 elseif (isset($_GET['export'])) {
49 'referer' => $referer,
51 'poche_url' => Tools
::getPocheUrl(),
52 'title' => _('poche, a read it later open source system'),
53 'token' => Session
::getToken(),
56 if (Session
::isLogged()) {
57 $poche->action($action, $url, $id);
58 $tpl_file = Tools
::getTplFile($view);
59 $tpl_vars = array_merge($tpl_vars, $poche->displayView($view, $id));
62 $tpl_file = 'login.twig';
66 echo $poche->tpl
->render($tpl_file, $tpl_vars);