From 1810c13b55b01043620fd81a65ce6e84cccc429c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 23 Dec 2013 09:09:10 +0100 Subject: PHP_AUTH_USER isn't available when using php as cgi --- index.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'index.php') diff --git a/index.php b/index.php index 145da772..fb251298 100644 --- a/index.php +++ b/index.php @@ -100,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; -- cgit v1.2.3