aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Poche.class.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-12-23 09:09:10 +0100
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-12-23 09:09:10 +0100
commit1810c13b55b01043620fd81a65ce6e84cccc429c (patch)
tree3eea228ad7e3d9272b0fd92c44544ad8d5eb23a1 /inc/poche/Poche.class.php
parenta0aa150418b628b32b18c70436d6be495129ee38 (diff)
downloadwallabag-1810c13b55b01043620fd81a65ce6e84cccc429c.tar.gz
wallabag-1810c13b55b01043620fd81a65ce6e84cccc429c.tar.zst
wallabag-1810c13b55b01043620fd81a65ce6e84cccc429c.zip
PHP_AUTH_USER isn't available when using php as cgi
Diffstat (limited to 'inc/poche/Poche.class.php')
-rw-r--r--inc/poche/Poche.class.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index adec9b28..4b26574d 100644
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -446,7 +446,7 @@ class Poche
446 $themes = $this->getInstalledThemes(); 446 $themes = $this->getInstalledThemes();
447 $languages = $this->getInstalledLanguages(); 447 $languages = $this->getInstalledLanguages();
448 $token = $this->user->getConfigValue('token'); 448 $token = $this->user->getConfigValue('token');
449 $http_auth = (isset($_SERVER['PHP_AUTH_USER']))?true:false; 449 $http_auth = (isset($_SERVER['PHP_AUTH_USER']) || isset($_SERVER['REMOTE_USER'])) ? true : false;
450 $tpl_vars = array( 450 $tpl_vars = array(
451 'themes' => $themes, 451 'themes' => $themes,
452 'languages' => $languages, 452 'languages' => $languages,
@@ -649,14 +649,18 @@ class Poche
649 * it redirects the user to the $referer link 649 * it redirects the user to the $referer link
650 * @return array 650 * @return array
651 */ 651 */
652 private function credentials() { 652 private function credentials() {
653 if(isset($_SERVER['PHP_AUTH_USER'])) { 653 if(isset($_SERVER['PHP_AUTH_USER'])) {
654 return array($_SERVER['PHP_AUTH_USER'],'php_auth'); 654 return array($_SERVER['PHP_AUTH_USER'],'php_auth');
655 } 655 }
656 if(!empty($_POST['login']) && !empty($_POST['password'])) { 656 if(!empty($_POST['login']) && !empty($_POST['password'])) {
657 return array($_POST['login'],$_POST['password']); 657 return array($_POST['login'],$_POST['password']);
658 } 658 }
659 return array(false,false); 659 if(isset($_SERVER['REMOTE_USER'])) {
660 return array($_SERVER['REMOTE_USER'],'http_auth');
661 }
662
663 return array(false,false);
660 } 664 }
661 665
662 /** 666 /**