Commit 0fb51915 authored by Vincent Petry's avatar Vincent Petry Committed by GitHub
Browse files

Merge pull request #26353 from owncloud/fix-2-dav-backends-registered

Register only one dav auth backend
parents d1c84409 0d579126
......@@ -23,9 +23,7 @@
namespace OCA\DAV\Connector\Sabre;
use OC\Files\View;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\Exception\PreconditionFailed;
use Sabre\DAV\Exception\ReportNotSupported;
use Sabre\DAV\Exception\BadRequest;
use Sabre\DAV\ServerPlugin;
use Sabre\DAV\Tree;
......@@ -104,7 +102,7 @@ class FilesReportPlugin extends ServerPlugin {
* @param ITagManager $fileTagger manager for private tags
* @param IUserSession $userSession
* @param IGroupManager $groupManager
* @param Folder $userfolder
* @param Folder $userFolder
*/
public function __construct(Tree $tree,
View $view,
......@@ -160,11 +158,12 @@ class FilesReportPlugin extends ServerPlugin {
* REPORT operations to look for files
*
* @param string $reportName
* @param [] $report
* @param $report
* @param string $uri
* @return bool
* @throws NotFound
* @throws ReportNotSupported
* @throws BadRequest
* @throws PreconditionFailed
* @internal param $ [] $report
*/
public function onReport($reportName, $report, $uri) {
$reportTargetNode = $this->server->tree->getNodeForPath($uri);
......@@ -231,7 +230,6 @@ class FilesReportPlugin extends ServerPlugin {
private function getFilesBaseUri($uri, $subPath) {
$uri = trim($uri, '/');
$subPath = trim($subPath, '/');
$filesUri = '';
if (empty($subPath)) {
$filesUri = $uri;
} else {
......
......@@ -20,6 +20,7 @@
*/
namespace OCA\DAV\Files;
use Sabre\DAV\INode;
use Sabre\DAVACL\AbstractPrincipalCollection;
use Sabre\HTTP\URLUtil;
use Sabre\DAV\SimpleCollection;
......
......@@ -31,11 +31,14 @@ use OCA\DAV\CardDAV\ImageExportPlugin;
use OCA\DAV\Comments\CommentsPlugin;
use OCA\DAV\Connector\Sabre\Auth;
use OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin;
use OCA\DAV\Connector\Sabre\CommentPropertiesPlugin;
use OCA\DAV\Connector\Sabre\CopyEtagHeaderPlugin;
use OCA\DAV\Connector\Sabre\DavAclPlugin;
use OCA\DAV\Connector\Sabre\DummyGetResponsePlugin;
use OCA\DAV\Connector\Sabre\FakeLockerPlugin;
use OCA\DAV\Connector\Sabre\FilesPlugin;
use OCA\DAV\Connector\Sabre\FilesReportPlugin;
use OCA\DAV\Connector\Sabre\SharesPlugin;
use OCA\DAV\DAV\PublicAuth;
use OCA\DAV\Connector\Sabre\QuotaPlugin;
use OCA\DAV\Files\BrowserErrorPagePlugin;
......@@ -76,7 +79,6 @@ class Server {
$this->server->addPlugin(new BlockLegacyClientPlugin(\OC::$server->getConfig()));
$authPlugin = new Plugin();
$authPlugin->addBackend($authBackend);
$authPlugin->addBackend(new PublicAuth());
$this->server->addPlugin($authPlugin);
......@@ -178,8 +180,10 @@ class Server {
)
)
);
$this->server->addPlugin(
new QuotaPlugin($view));
if (!is_null($view)) {
$this->server->addPlugin(
new QuotaPlugin($view));
}
$this->server->addPlugin(
new TagsPlugin(
$this->server->tree, \OC::$server->getTagManager()
......@@ -187,28 +191,29 @@ class Server {
);
// TODO: switch to LazyUserFolder
$userFolder = \OC::$server->getUserFolder();
$this->server->addPlugin(new \OCA\DAV\Connector\Sabre\SharesPlugin(
$this->server->addPlugin(new SharesPlugin(
$this->server->tree,
$userSession,
$userFolder,
\OC::$server->getShareManager()
));
$this->server->addPlugin(new \OCA\DAV\Connector\Sabre\CommentPropertiesPlugin(
$this->server->addPlugin(new CommentPropertiesPlugin(
\OC::$server->getCommentsManager(),
$userSession
));
$this->server->addPlugin(new \OCA\DAV\Connector\Sabre\FilesReportPlugin(
$this->server->tree,
$view,
\OC::$server->getSystemTagManager(),
\OC::$server->getSystemTagObjectMapper(),
\OC::$server->getTagManager(),
$userSession,
\OC::$server->getGroupManager(),
$userFolder
));
if (!is_null($view)) {
$this->server->addPlugin(new FilesReportPlugin(
$this->server->tree,
$view,
\OC::$server->getSystemTagManager(),
\OC::$server->getSystemTagObjectMapper(),
\OC::$server->getTagManager(),
$userSession,
\OC::$server->getGroupManager(),
$userFolder
));
}
}
$this->server->addPlugin(new \OCA\DAV\Connector\Sabre\CopyEtagHeaderPlugin());
});
}
......
......@@ -22,6 +22,8 @@ namespace OCA\Federation\DAV;
use OCA\Federation\DbHandler;
use Sabre\DAV\Auth\Backend\AbstractBasic;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
class FedAuth extends AbstractBasic {
......@@ -55,4 +57,10 @@ class FedAuth extends AbstractBasic {
protected function validateUserPass($username, $password) {
return $this->db->auth($username, $password);
}
/**
* @inheritdoc
*/
function challenge(RequestInterface $request, ResponseInterface $response) {
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment