$themes = $this->getInstalledThemes();
$languages = $this->getInstalledLanguages();
$token = $this->user->getConfigValue('token');
- $http_auth = (isset($_SERVER['PHP_AUTH_USER']))?true:false;
+ $http_auth = (isset($_SERVER['PHP_AUTH_USER']) || isset($_SERVER['REMOTE_USER'])) ? true : false;
$tpl_vars = array(
'themes' => $themes,
'languages' => $languages,
* it redirects the user to the $referer link
* @return array
*/
- private function credentials() {
- if(isset($_SERVER['PHP_AUTH_USER'])) {
- return array($_SERVER['PHP_AUTH_USER'],'php_auth');
- }
- if(!empty($_POST['login']) && !empty($_POST['password'])) {
- return array($_POST['login'],$_POST['password']);
- }
- return array(false,false);
+ private function credentials() {
+ if(isset($_SERVER['PHP_AUTH_USER'])) {
+ return array($_SERVER['PHP_AUTH_USER'],'php_auth');
+ }
+ if(!empty($_POST['login']) && !empty($_POST['password'])) {
+ return array($_POST['login'],$_POST['password']);
+ }
+ if(isset($_SERVER['REMOTE_USER'])) {
+ return array($_SERVER['REMOTE_USER'],'http_auth');
+ }
+
+ return array(false,false);
}
/**
$tpl_file = Tools::getTplFile('login');
$tpl_vars['http_auth'] = 1;
}
+} elseif(isset($_SERVER['REMOTE_USER'])) {
+ if($poche->store->userExists($_SERVER['REMOTE_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;