aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/lib/DAV/Auth/Backend/Apache.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-11-10 12:49:51 +0000
committerMario <mario@mariovavti.com>2019-11-10 14:10:03 +0100
commit580c3f4ffe9608d2beb56d418c68b3b112420e76 (patch)
tree82335d01179ac361d3f547a4b8e8c598d302e9f3 /vendor/sabre/dav/lib/DAV/Auth/Backend/Apache.php
parentd22766f458a8539a40a57f3946459a9be1f21cd6 (diff)
downloadvolse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.gz
volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.bz2
volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.zip
another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
Diffstat (limited to 'vendor/sabre/dav/lib/DAV/Auth/Backend/Apache.php')
-rw-r--r--vendor/sabre/dav/lib/DAV/Auth/Backend/Apache.php35
1 files changed, 19 insertions, 16 deletions
diff --git a/vendor/sabre/dav/lib/DAV/Auth/Backend/Apache.php b/vendor/sabre/dav/lib/DAV/Auth/Backend/Apache.php
index e203d2685..201fe615c 100644
--- a/vendor/sabre/dav/lib/DAV/Auth/Backend/Apache.php
+++ b/vendor/sabre/dav/lib/DAV/Auth/Backend/Apache.php
@@ -1,24 +1,26 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAV\Auth\Backend;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
/**
- * Apache authenticator
+ * Apache (or NGINX) authenticator.
*
* This authentication backend assumes that authentication has been
- * configured in apache, rather than within SabreDAV.
+ * configured in apache (or NGINX), rather than within SabreDAV.
*
- * Make sure apache is properly configured for this to work.
+ * Make sure apache (or NGINX) is properly configured for this to work.
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class Apache implements BackendInterface {
-
+class Apache implements BackendInterface
+{
/**
* This is the prefix that will be used to generate principal urls.
*
@@ -50,22 +52,25 @@ class Apache implements BackendInterface {
*
* principals/users/[username]
*
- * @param RequestInterface $request
+ * @param RequestInterface $request
* @param ResponseInterface $response
+ *
* @return array
*/
- function check(RequestInterface $request, ResponseInterface $response) {
-
+ public function check(RequestInterface $request, ResponseInterface $response)
+ {
$remoteUser = $request->getRawServerValue('REMOTE_USER');
if (is_null($remoteUser)) {
$remoteUser = $request->getRawServerValue('REDIRECT_REMOTE_USER');
}
if (is_null($remoteUser)) {
- return [false, 'No REMOTE_USER property was found in the PHP $_SERVER super-global. This likely means your server is not configured correctly'];
+ $remoteUser = $request->getRawServerValue('PHP_AUTH_USER');
+ }
+ if (is_null($remoteUser)) {
+ return [false, 'No REMOTE_USER, REDIRECT_REMOTE_USER, or PHP_AUTH_USER property was found in the PHP $_SERVER super-global. This likely means your server is not configured correctly'];
}
- return [true, $this->principalPrefix . $remoteUser];
-
+ return [true, $this->principalPrefix.$remoteUser];
}
/**
@@ -85,12 +90,10 @@ class Apache implements BackendInterface {
* append your own WWW-Authenticate header instead of overwriting the
* existing one.
*
- * @param RequestInterface $request
+ * @param RequestInterface $request
* @param ResponseInterface $response
- * @return void
*/
- function challenge(RequestInterface $request, ResponseInterface $response) {
-
+ public function challenge(RequestInterface $request, ResponseInterface $response)
+ {
}
-
}