1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Adding support for http_auth

This commit is contained in:
Denis Sacchet 2013-10-20 23:28:45 +02:00
parent df6afaf090
commit 027b4e1568
3 changed files with 23 additions and 2 deletions

View file

@ -82,9 +82,17 @@ if (Session::isLogged()) {
$tpl_file = Tools::getTplFile($view);
$tpl_vars = array_merge($tpl_vars, $poche->displayView($view, $id));
} elseif(isset($_SERVER['PHP_AUTH_USER'])) {
$poche->login($referer);
if($poche->store->userExists($_SERVER['PHP_AUTH_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;
}
# because messages can be added in $poche->action(), we have to add this entry now (we can add it before)