diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-06-09 14:53:32 +0300 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-11-28 12:27:34 +0300 |
commit | f418d55ffc8a363c18c216ea6ec11ca6294d83db (patch) | |
tree | ea3438d6d25deebe5509e237a9fccb22038f19f2 /apps | |
parent | 68ed4ef59fb76b9f07264ed8b1774d3fa52fb456 (diff) |
Use the correct realm for basic authentication - fixes #23427
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/connector/publicauth.php | 11 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/auth.php | 4 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/serverfactory.php | 3 | ||||
-rw-r--r-- | apps/federation/dav/fedauth.php | 4 |
4 files changed, 20 insertions, 2 deletions
diff --git a/apps/dav/lib/connector/publicauth.php b/apps/dav/lib/connector/publicauth.php index 36da6492fb0..19c5be27b25 100644 --- a/apps/dav/lib/connector/publicauth.php +++ b/apps/dav/lib/connector/publicauth.php @@ -26,6 +26,13 @@ namespace OCA\DAV\Connector; +use Sabre\DAV\Auth\Backend\AbstractBasic; + +/** + * Class PublicAuth + * + * @package OCA\DAV\Connector + */ class PublicAuth extends \Sabre\DAV\Auth\Backend\AbstractBasic { /** @@ -40,6 +47,10 @@ class PublicAuth extends \Sabre\DAV\Auth\Backend\AbstractBasic { */ public function __construct($config) { $this->config = $config; + + // setup realm + $defaults = new \OC_Defaults(); + $this->realm = $defaults->getName(); } /** diff --git a/apps/dav/lib/connector/sabre/auth.php b/apps/dav/lib/connector/sabre/auth.php index b63efa3a1ba..15efbd4865e 100644 --- a/apps/dav/lib/connector/sabre/auth.php +++ b/apps/dav/lib/connector/sabre/auth.php @@ -66,6 +66,10 @@ class Auth extends AbstractBasic { $this->userSession = $userSession; $this->request = $request; $this->principalPrefix = $principalPrefix; + + // setup realm + $defaults = new \OC_Defaults(); + $this->realm = $defaults->getName(); } /** diff --git a/apps/dav/lib/connector/sabre/serverfactory.php b/apps/dav/lib/connector/sabre/serverfactory.php index 8462f624552..10475bd90fe 100644 --- a/apps/dav/lib/connector/sabre/serverfactory.php +++ b/apps/dav/lib/connector/sabre/serverfactory.php @@ -98,10 +98,9 @@ class ServerFactory { $server->setBaseUri($baseUri); // Load plugins - $defaults = new \OC_Defaults(); $server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin($this->config)); $server->addPlugin(new \OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin($this->config)); - $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend, $defaults->getName())); + $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend)); // FIXME: The following line is a workaround for legacy components relying on being able to send a GET to / $server->addPlugin(new \OCA\DAV\Connector\Sabre\DummyGetResponsePlugin()); $server->addPlugin(new \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin('webdav', $this->logger)); diff --git a/apps/federation/dav/fedauth.php b/apps/federation/dav/fedauth.php index 6c45fd556cf..b3d39be1c84 100644 --- a/apps/federation/dav/fedauth.php +++ b/apps/federation/dav/fedauth.php @@ -38,6 +38,10 @@ class FedAuth extends AbstractBasic { public function __construct(DbHandler $db) { $this->db = $db; $this->principalPrefix = 'principals/system/'; + + // setup realm + $defaults = new \OC_Defaults(); + $this->realm = $defaults->getName(); } /** |