diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-08 09:11:12 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-08 09:11:12 +0200 |
commit | ed06f040776d5e2f38b938005ebc2b09ddd41bd4 (patch) | |
tree | 898818d8ee3127a3c9e930ad839be03c9626fd9b /index.php | |
parent | 7aa8ccc47d511f62fc46af53f7fc43d9bedebff3 (diff) | |
download | wallabag-ed06f040776d5e2f38b938005ebc2b09ddd41bd4.tar.gz wallabag-ed06f040776d5e2f38b938005ebc2b09ddd41bd4.tar.zst wallabag-ed06f040776d5e2f38b938005ebc2b09ddd41bd4.zip |
test if /install exists
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | include dirname(__FILE__).'/inc/poche/config.inc.php'; | 11 | include dirname(__FILE__).'/inc/poche/config.inc.php'; |
12 | 12 | ||
13 | # Parse GET & REFERER vars | ||
13 | $referer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; | 14 | $referer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; |
14 | $view = Tools::checkVar('view', 'home'); | 15 | $view = Tools::checkVar('view', 'home'); |
15 | $action = Tools::checkVar('action'); | 16 | $action = Tools::checkVar('action'); |
@@ -17,6 +18,7 @@ $id = Tools::checkVar('id'); | |||
17 | $_SESSION['sort'] = Tools::checkVar('sort', 'id'); | 18 | $_SESSION['sort'] = Tools::checkVar('sort', 'id'); |
18 | $url = new Url((isset ($_GET['url'])) ? $_GET['url'] : ''); | 19 | $url = new Url((isset ($_GET['url'])) ? $_GET['url'] : ''); |
19 | 20 | ||
21 | # poche actions | ||
20 | if (isset($_GET['login'])) { | 22 | if (isset($_GET['login'])) { |
21 | # hello you | 23 | # hello you |
22 | $poche->login($referer); | 24 | $poche->login($referer); |
@@ -36,6 +38,7 @@ elseif (isset($_GET['export'])) { | |||
36 | $poche->export(); | 38 | $poche->export(); |
37 | } | 39 | } |
38 | 40 | ||
41 | # vars to send to templates | ||
39 | $tpl_vars = array( | 42 | $tpl_vars = array( |
40 | 'referer' => $referer, | 43 | 'referer' => $referer, |
41 | 'view' => $view, | 44 | 'view' => $view, |
@@ -50,6 +53,7 @@ if (Session::isLogged()) { | |||
50 | $tpl_vars = array_merge($tpl_vars, $poche->displayView($view, $id)); | 53 | $tpl_vars = array_merge($tpl_vars, $poche->displayView($view, $id)); |
51 | } | 54 | } |
52 | else { | 55 | else { |
56 | # login | ||
53 | $tpl_file = 'login.twig'; | 57 | $tpl_file = 'login.twig'; |
54 | } | 58 | } |
55 | 59 | ||
@@ -57,5 +61,5 @@ else { | |||
57 | $messages = $poche->messages->display('all', FALSE); | 61 | $messages = $poche->messages->display('all', FALSE); |
58 | $tpl_vars = array_merge($tpl_vars, array('messages' => $messages)); | 62 | $tpl_vars = array_merge($tpl_vars, array('messages' => $messages)); |
59 | 63 | ||
60 | # Aaaaaaand action ! | 64 | # display poche |
61 | echo $poche->tpl->render($tpl_file, $tpl_vars); \ No newline at end of file | 65 | echo $poche->tpl->render($tpl_file, $tpl_vars); \ No newline at end of file |