diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -8,7 +8,7 @@ | |||
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.2.0'); | 11 | define ('POCHE', '1.3.0'); |
12 | require_once 'inc/poche/global.inc.php'; | 12 | require_once 'inc/poche/global.inc.php'; |
13 | session_start(); | 13 | session_start(); |
14 | 14 | ||
@@ -64,12 +64,22 @@ if (isset($_GET['login'])) { | |||
64 | $poche->updatePassword(); | 64 | $poche->updatePassword(); |
65 | } elseif (isset($_GET['import'])) { | 65 | } elseif (isset($_GET['import'])) { |
66 | $import = $poche->import($_GET['from']); | 66 | $import = $poche->import($_GET['from']); |
67 | } elseif (isset($_GET['download'])) { | ||
68 | Tools::download_db();; | ||
67 | } elseif (isset($_GET['export'])) { | 69 | } elseif (isset($_GET['export'])) { |
68 | $poche->export(); | 70 | $poche->export(); |
69 | } elseif (isset($_GET['updatetheme'])) { | 71 | } elseif (isset($_GET['updatetheme'])) { |
70 | $poche->updateTheme(); | 72 | $poche->updateTheme(); |
71 | } elseif (isset($_GET['updatelanguage'])) { | 73 | } elseif (isset($_GET['updatelanguage'])) { |
72 | $poche->updateLanguage(); | 74 | $poche->updateLanguage(); |
75 | } elseif (isset($_GET['feed'])) { | ||
76 | if (isset($_GET['action']) && $_GET['action'] == 'generate') { | ||
77 | $poche->generateToken(); | ||
78 | } | ||
79 | else { | ||
80 | $tag_id = (isset($_GET['tag_id']) ? intval($_GET['tag_id']) : 0); | ||
81 | $poche->generateFeeds($_GET['token'], $_GET['user_id'], $tag_id, $_GET['type']); | ||
82 | } | ||
73 | } | 83 | } |
74 | 84 | ||
75 | elseif (isset($_GET['plainurl']) && !empty($_GET['plainurl'])) { | 85 | elseif (isset($_GET['plainurl']) && !empty($_GET['plainurl'])) { |
@@ -90,6 +100,15 @@ if (Session::isLogged()) { | |||
90 | $tpl_file = Tools::getTplFile('login'); | 100 | $tpl_file = Tools::getTplFile('login'); |
91 | $tpl_vars['http_auth'] = 1; | 101 | $tpl_vars['http_auth'] = 1; |
92 | } | 102 | } |
103 | } elseif(isset($_SERVER['REMOTE_USER'])) { | ||
104 | if($poche->store->userExists($_SERVER['REMOTE_USER'])) { | ||
105 | $poche->login($referer); | ||
106 | } else { | ||
107 | $poche->messages->add('e', _('login failed: user doesn\'t exist')); | ||
108 | Tools::logm('user doesn\'t exist'); | ||
109 | $tpl_file = Tools::getTplFile('login'); | ||
110 | $tpl_vars['http_auth'] = 1; | ||
111 | } | ||
93 | } else { | 112 | } else { |
94 | $tpl_file = Tools::getTplFile('login'); | 113 | $tpl_file = Tools::getTplFile('login'); |
95 | $tpl_vars['http_auth'] = 0; | 114 | $tpl_vars['http_auth'] = 0; |