diff options
| author | Nathan Kinkade <nkinkade@nkinka.de> | 2010-10-06 21:13:35 +0000 |
|---|---|---|
| committer | Nathan Kinkade <nkinkade@nkinka.de> | 2010-10-06 21:13:35 +0000 |
| commit | 7dae93afeb449193415d1537ffbd4831cb6fe88f (patch) | |
| tree | 80534daddd72b51f370942ca16b483b479a6e6c2 /modules/gallery/helpers/access.php | |
| parent | 46ba61da0ffd1fc15899d51bcd2a6ba70c831900 (diff) | |
| parent | ea5a4e6cfed888a562216e24125d7b703393bc67 (diff) | |
git-pulled, but had to manuall fix some conflicts.
Diffstat (limited to 'modules/gallery/helpers/access.php')
| -rw-r--r-- | modules/gallery/helpers/access.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php index 52a36298..1a448e4a 100644 --- a/modules/gallery/helpers/access.php +++ b/modules/gallery/helpers/access.php @@ -727,8 +727,18 @@ class access_Core { fclose($fp); } - list ($response) = remote::do_request(url::abs_file("var/security_test/verify")); - $works = $response == "HTTP/1.1 200 OK"; + // Proxy our authorization headers so that if the entire Gallery is covered by Basic Auth + // this callback will still work. + $headers = array(); + if (function_exists("apache_request_headers")) { + $arh = apache_request_headers(); + if (!empty($arh["Authorization"])) { + $headers["Authorization"] = $arh["Authorization"]; + } + } + list ($status, $headers, $body) = + remote::do_request(url::abs_file("var/security_test/verify"), "GET", $headers); + $works = ($status == "HTTP/1.1 200 OK") && ($body == "success"); } catch (Exception $e) { @dir::unlink(VARPATH . "security_test"); throw $e; |
