diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-04-03 14:42:03 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-04-03 14:42:03 +0200 |
commit | 0d67b00d5d3b7ce1b76b639dcc65c415a5f13439 (patch) | |
tree | 7c4d113bb1c3d90ef53e08138a2850576395780f /index.php | |
parent | 99679d06884120c57f43b44e55e03595f1f87bed (diff) | |
parent | 7d2f1aa2793595aa6cdc58a58260184234cfa809 (diff) | |
download | wallabag-0d67b00d5d3b7ce1b76b639dcc65c415a5f13439.tar.gz wallabag-0d67b00d5d3b7ce1b76b639dcc65c415a5f13439.tar.zst wallabag-0d67b00d5d3b7ce1b76b639dcc65c415a5f13439.zip |
wallabag 1.6.0
Diffstat (limited to 'index.php')
-rwxr-xr-x[-rw-r--r--] | index.php | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -8,10 +8,13 @@ | |||
8 | * @license http://www.wtfpl.net/ see COPYING file | 8 | * @license http://www.wtfpl.net/ see COPYING file |
9 | */ | 9 | */ |
10 | 10 | ||
11 | define ('POCHE', '1.5.2'); | 11 | define ('POCHE', '1.6.0'); |
12 | require 'check_setup.php'; | 12 | require 'check_setup.php'; |
13 | require_once 'inc/poche/global.inc.php'; | 13 | require_once 'inc/poche/global.inc.php'; |
14 | session_start(); | 14 | |
15 | # Start session | ||
16 | Session::$sessionName = 'poche'; | ||
17 | Session::init(); | ||
15 | 18 | ||
16 | # Start Poche | 19 | # Start Poche |
17 | $poche = new Poche(); | 20 | $poche = new Poche(); |
@@ -30,14 +33,14 @@ $tpl_vars = array( | |||
30 | 'referer' => $referer, | 33 | 'referer' => $referer, |
31 | 'view' => $view, | 34 | 'view' => $view, |
32 | 'poche_url' => Tools::getPocheUrl(), | 35 | 'poche_url' => Tools::getPocheUrl(), |
33 | 'title' => _('poche, a read it later open source system'), | 36 | 'title' => _('wallabag, a read it later open source system'), |
34 | 'token' => Session::getToken(), | 37 | 'token' => Session::getToken(), |
35 | 'theme' => $poche->getTheme() | 38 | 'theme' => $poche->getTheme() |
36 | ); | 39 | ); |
37 | 40 | ||
38 | if (! empty($notInstalledMessage)) { | 41 | if (! empty($notInstalledMessage)) { |
39 | if (! Poche::$canRenderTemplates || ! Poche::$configFileAvailable) { | 42 | if (! Poche::$canRenderTemplates || ! Poche::$configFileAvailable) { |
40 | # We cannot use Twig to display the error message | 43 | # We cannot use Twig to display the error message |
41 | echo '<h1>Errors</h1><ol>'; | 44 | echo '<h1>Errors</h1><ol>'; |
42 | foreach ($notInstalledMessage as $message) { | 45 | foreach ($notInstalledMessage as $message) { |
43 | echo '<li>' . $message . '</li>'; | 46 | echo '<li>' . $message . '</li>'; |
@@ -64,7 +67,8 @@ if (isset($_GET['login'])) { | |||
64 | # Update password | 67 | # Update password |
65 | $poche->updatePassword(); | 68 | $poche->updatePassword(); |
66 | } elseif (isset($_GET['import'])) { | 69 | } elseif (isset($_GET['import'])) { |
67 | $import = $poche->import($_GET['from']); | 70 | $import = $poche->import(); |
71 | $tpl_vars = array_merge($tpl_vars, $import); | ||
68 | } elseif (isset($_GET['download'])) { | 72 | } elseif (isset($_GET['download'])) { |
69 | Tools::download_db(); | 73 | Tools::download_db(); |
70 | } elseif (isset($_GET['empty-cache'])) { | 74 | } elseif (isset($_GET['empty-cache'])) { |
@@ -75,6 +79,8 @@ if (isset($_GET['login'])) { | |||
75 | $poche->updateTheme(); | 79 | $poche->updateTheme(); |
76 | } elseif (isset($_GET['updatelanguage'])) { | 80 | } elseif (isset($_GET['updatelanguage'])) { |
77 | $poche->updateLanguage(); | 81 | $poche->updateLanguage(); |
82 | } elseif (isset($_GET['uploadfile'])) { | ||
83 | $poche->uploadFile(); | ||
78 | } elseif (isset($_GET['feed'])) { | 84 | } elseif (isset($_GET['feed'])) { |
79 | if (isset($_GET['action']) && $_GET['action'] == 'generate') { | 85 | if (isset($_GET['action']) && $_GET['action'] == 'generate') { |
80 | $poche->generateToken(); | 86 | $poche->generateToken(); |
@@ -115,6 +121,7 @@ if (Session::isLogged()) { | |||
115 | } else { | 121 | } else { |
116 | $tpl_file = Tools::getTplFile('login'); | 122 | $tpl_file = Tools::getTplFile('login'); |
117 | $tpl_vars['http_auth'] = 0; | 123 | $tpl_vars['http_auth'] = 0; |
124 | Session::logout(); | ||
118 | } | 125 | } |
119 | 126 | ||
120 | # because messages can be added in $poche->action(), we have to add this entry now (we can add it before) | 127 | # because messages can be added in $poche->action(), we have to add this entry now (we can add it before) |