X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=4e86fe11d5a9709a684910e7a0b38403b99f766d;hb=529db4861d0b54fbd4f80765684eb343b97241cf;hp=d2b363b0342bb044e44595abc89dacc60fe618dd;hpb=d460914f65254d201911a8346792d680218c8dc3;p=github%2Fwallabag%2Fwallabag.git diff --git a/index.php b/index.php index d2b363b0..4e86fe11 100644 --- a/index.php +++ b/index.php @@ -8,7 +8,7 @@ * @license http://www.wtfpl.net/ see COPYING file */ -define ('POCHE', '1.2.0'); +define ('POCHE', '1.3.0'); require_once 'inc/poche/global.inc.php'; session_start(); @@ -77,7 +77,8 @@ if (isset($_GET['login'])) { $poche->generateToken(); } else { - $poche->generateFeeds($_GET['token'], $_GET['user_id'], $_GET['type']); + $tag_id = (isset($_GET['tag_id']) ? intval($_GET['tag_id']) : 0); + $poche->generateFeeds($_GET['token'], $_GET['user_id'], $tag_id, $_GET['type']); } } @@ -99,6 +100,15 @@ if (Session::isLogged()) { $tpl_file = Tools::getTplFile('login'); $tpl_vars['http_auth'] = 1; } +} elseif(isset($_SERVER['REMOTE_USER'])) { + if($poche->store->userExists($_SERVER['REMOTE_USER'])) { + $poche->login($referer); + } else { + $poche->messages->add('e', _('login failed: user doesn\'t exist')); + Tools::logm('user doesn\'t exist'); + $tpl_file = Tools::getTplFile('login'); + $tpl_vars['http_auth'] = 1; + } } else { $tpl_file = Tools::getTplFile('login'); $tpl_vars['http_auth'] = 0;