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:
parent
df6afaf090
commit
027b4e1568
3 changed files with 23 additions and 2 deletions
10
index.php
10
index.php
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue