mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-09-22 06:29:15 +00:00
Fix to work with FastCGI installation.
This commit is contained in:
parent
113fb6a40f
commit
36f57b149e
@ -83,6 +83,22 @@ class HTTPAuthSession {
|
|||||||
*/
|
*/
|
||||||
function BasicAuthSession() {
|
function BasicAuthSession() {
|
||||||
global $c;
|
global $c;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get HTTP Auth to work with PHP+FastCGI
|
||||||
|
*/
|
||||||
|
if (isset($_SERVER["AUTHORIZATION"]) && !empty($_SERVER["AUTHORIZATION"])) {
|
||||||
|
list ($type, $cred) = split (" ", $_SERVER['AUTHORIZATION']);
|
||||||
|
if ($type == 'Basic') {
|
||||||
|
list ($user, $pass) = explode (":", base64_decode($cred));
|
||||||
|
$_SERVER['PHP_AUTH_USER'] = $user;
|
||||||
|
$_SERVER['PHP_AUTH_PW'] = $pass;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fall through to the normal PHP authentication variables.
|
||||||
|
*/
|
||||||
if ( isset($_SERVER['PHP_AUTH_USER']) ) {
|
if ( isset($_SERVER['PHP_AUTH_USER']) ) {
|
||||||
if ( $u = $this->CheckPassword( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ) ) {
|
if ( $u = $this->CheckPassword( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ) ) {
|
||||||
$this->AssignSessionDetails($u);
|
$this->AssignSessionDetails($u);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user