aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorDenis Sacchet <denis@sacchet.fr>2013-10-20 23:28:45 +0200
committerDenis Sacchet <denis@sacchet.fr>2013-10-20 23:28:45 +0200
commit027b4e156853b4d5e358e19e83506ec4446de7ab (patch)
tree9a4ede0de3ac8494f206b07e2fc5e4013e61d234 /index.php
parentdf6afaf0909506a334ef2b8c6f69770cd9890e0d (diff)
downloadwallabag-027b4e156853b4d5e358e19e83506ec4446de7ab.tar.gz
wallabag-027b4e156853b4d5e358e19e83506ec4446de7ab.tar.zst
wallabag-027b4e156853b4d5e358e19e83506ec4446de7ab.zip
Adding support for http_auth
Diffstat (limited to 'index.php')
-rw-r--r--index.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/index.php b/index.php
index d79f3f95..d400354d 100644
--- a/index.php
+++ b/index.php
@@ -82,9 +82,17 @@ if (Session::isLogged()) {
82 $tpl_file = Tools::getTplFile($view); 82 $tpl_file = Tools::getTplFile($view);
83 $tpl_vars = array_merge($tpl_vars, $poche->displayView($view, $id)); 83 $tpl_vars = array_merge($tpl_vars, $poche->displayView($view, $id));
84} elseif(isset($_SERVER['PHP_AUTH_USER'])) { 84} elseif(isset($_SERVER['PHP_AUTH_USER'])) {
85 $poche->login($referer); 85 if($poche->store->userExists($_SERVER['PHP_AUTH_USER'])) {
86 $poche->login($referer);
87 } else {
88 $poche->messages->add('e', _('login failed: user doesn\'t exist'));
89 Tools::logm('user doesn\'t exist');
90 $tpl_file = Tools::getTplFile('login');
91 $tpl_vars['http_auth'] = 1;
92 }
86} else { 93} else {
87 $tpl_file = Tools::getTplFile('login'); 94 $tpl_file = Tools::getTplFile('login');
95 $tpl_vars['http_auth'] = 0;
88} 96}
89 97
90# because messages can be added in $poche->action(), we have to add this entry now (we can add it before) 98# because messages can be added in $poche->action(), we have to add this entry now (we can add it before)