aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rwxr-xr-x[-rw-r--r--]index.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/index.php b/index.php
index a26c42e1..7f72b146 100644..100755
--- a/index.php
+++ b/index.php
@@ -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
11define ('POCHE', '1.5.2'); 11define ('POCHE', '1.6.0');
12require 'check_setup.php'; 12require 'check_setup.php';
13require_once 'inc/poche/global.inc.php'; 13require_once 'inc/poche/global.inc.php';
14session_start(); 14
15# Start session
16Session::$sessionName = 'poche';
17Session::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
38if (! empty($notInstalledMessage)) { 41if (! 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)