diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-10-21 08:31:24 -0700 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-10-21 08:31:24 -0700 |
commit | 1ba1628ed6d22833096049ca9975c3d72f99804c (patch) | |
tree | 9a4ede0de3ac8494f206b07e2fc5e4013e61d234 /index.php | |
parent | c1e24b0461111affb121f5a1bc9d42acf94caf93 (diff) | |
parent | 027b4e156853b4d5e358e19e83506ec4446de7ab (diff) | |
download | wallabag-1ba1628ed6d22833096049ca9975c3d72f99804c.tar.gz wallabag-1ba1628ed6d22833096049ca9975c3d72f99804c.tar.zst wallabag-1ba1628ed6d22833096049ca9975c3d72f99804c.zip |
Merge pull request #285 from dsacchet/dev
Adding support for http_auth
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -81,8 +81,18 @@ if (Session::isLogged()) { | |||
81 | $poche->action($action, $url, $id); | 81 | $poche->action($action, $url, $id); |
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'])) { | ||
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 | } | ||
84 | } else { | 93 | } else { |
85 | $tpl_file = Tools::getTplFile('login'); | 94 | $tpl_file = Tools::getTplFile('login'); |
95 | $tpl_vars['http_auth'] = 0; | ||
86 | } | 96 | } |
87 | 97 | ||
88 | # 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) |
@@ -90,4 +100,4 @@ $messages = $poche->messages->display('all', FALSE); | |||
90 | $tpl_vars = array_merge($tpl_vars, array('messages' => $messages)); | 100 | $tpl_vars = array_merge($tpl_vars, array('messages' => $messages)); |
91 | 101 | ||
92 | # display poche | 102 | # display poche |
93 | echo $poche->tpl->render($tpl_file, $tpl_vars); \ No newline at end of file | 103 | echo $poche->tpl->render($tpl_file, $tpl_vars); |