]>
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 $referer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'];
14 $view = Tools
::checkVar('view', 'home');
15 $action = Tools
::checkVar('action');
16 $id = Tools
::checkVar('id');
17 $_SESSION['sort'] = Tools
::checkVar('sort', 'id');
18 $url = new Url((isset ($_GET['url'])) ? $_GET['url'] : '');
20 if (isset($_GET['login'])) {
22 $poche->login($referer);
24 elseif (isset($_GET['logout'])) {
28 elseif (isset($_GET['config'])) {
30 $poche->updatePassword();
32 elseif (isset($_GET['import'])) {
33 $poche->import($_GET['from']);
35 elseif (isset($_GET['export'])) {
40 'referer' => $referer,
42 'poche_url' => Tools
::getPocheUrl(),
43 'title' => _('poche, a read it later open source system'),
44 'token' => Session
::getToken(),
47 if (Session
::isLogged()) {
48 $poche->action($action, $url, $id);
49 $tpl_file = Tools
::getTplFile($view);
50 $tpl_vars = array_merge($tpl_vars, $poche->displayView($view, $id));
53 $tpl_file = 'login.twig';
56 # because messages can be added in $poche->action(), we have to add this entry now (we can add it before)
57 $messages = $poche->messages
->display('all', FALSE);
58 $tpl_vars = array_merge($tpl_vars, array('messages' => $messages));
61 echo $poche->tpl
->render($tpl_file, $tpl_vars);