Sabre/DAV 4.0: beforeMethod is now beforeMethod:*
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
parent
8648ee131a
commit
52ba75f644
|
@ -94,7 +94,7 @@ class InvitationResponseServer {
|
||||||
));
|
));
|
||||||
|
|
||||||
// wait with registering these until auth is handled and the filesystem is setup
|
// wait with registering these until auth is handled and the filesystem is setup
|
||||||
$this->server->on('beforeMethod', function () use ($root) {
|
$this->server->on('beforeMethod:*', function () use ($root) {
|
||||||
// register plugins from apps
|
// register plugins from apps
|
||||||
$pluginManager = new PluginManager(
|
$pluginManager = new PluginManager(
|
||||||
\OC::$server,
|
\OC::$server,
|
||||||
|
|
|
@ -83,7 +83,7 @@ class Plugin extends ServerPlugin {
|
||||||
*/
|
*/
|
||||||
public function initialize(Server $server) {
|
public function initialize(Server $server) {
|
||||||
$this->server = $server;
|
$this->server = $server;
|
||||||
$server->on('beforeMethod', [$this, 'beforeMethod']);
|
$server->on('beforeMethod:*', [$this, 'beforeMethod']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -46,7 +46,7 @@ class AnonymousOptionsPlugin extends ServerPlugin {
|
||||||
public function initialize(\Sabre\DAV\Server $server) {
|
public function initialize(\Sabre\DAV\Server $server) {
|
||||||
$this->server = $server;
|
$this->server = $server;
|
||||||
// before auth
|
// before auth
|
||||||
$this->server->on('beforeMethod', [$this, 'handleAnonymousOptions'], 9);
|
$this->server->on('beforeMethod:*', [$this, 'handleAnonymousOptions'], 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -74,7 +74,7 @@ class AppEnabledPlugin extends ServerPlugin {
|
||||||
public function initialize(\Sabre\DAV\Server $server) {
|
public function initialize(\Sabre\DAV\Server $server) {
|
||||||
|
|
||||||
$this->server = $server;
|
$this->server = $server;
|
||||||
$this->server->on('beforeMethod', [$this, 'checkAppEnabled'], 30);
|
$this->server->on('beforeMethod:*', [$this, 'checkAppEnabled'], 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -53,7 +53,7 @@ class BlockLegacyClientPlugin extends ServerPlugin {
|
||||||
*/
|
*/
|
||||||
public function initialize(\Sabre\DAV\Server $server) {
|
public function initialize(\Sabre\DAV\Server $server) {
|
||||||
$this->server = $server;
|
$this->server = $server;
|
||||||
$this->server->on('beforeMethod', [$this, 'beforeHandler'], 200);
|
$this->server->on('beforeMethod:*', [$this, 'beforeHandler'], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -45,7 +45,7 @@ class LockPlugin extends ServerPlugin {
|
||||||
*/
|
*/
|
||||||
public function initialize(\Sabre\DAV\Server $server) {
|
public function initialize(\Sabre\DAV\Server $server) {
|
||||||
$this->server = $server;
|
$this->server = $server;
|
||||||
$this->server->on('beforeMethod', [$this, 'getLock'], 50);
|
$this->server->on('beforeMethod:*', [$this, 'getLock'], 50);
|
||||||
$this->server->on('afterMethod', [$this, 'releaseLock'], 50);
|
$this->server->on('afterMethod', [$this, 'releaseLock'], 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ class MaintenancePlugin extends ServerPlugin {
|
||||||
*/
|
*/
|
||||||
public function initialize(\Sabre\DAV\Server $server) {
|
public function initialize(\Sabre\DAV\Server $server) {
|
||||||
$this->server = $server;
|
$this->server = $server;
|
||||||
$this->server->on('beforeMethod', [$this, 'checkMaintenanceMode'], 1);
|
$this->server->on('beforeMethod:*', [$this, 'checkMaintenanceMode'], 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -140,7 +140,7 @@ class ServerFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
// wait with registering these until auth is handled and the filesystem is setup
|
// wait with registering these until auth is handled and the filesystem is setup
|
||||||
$server->on('beforeMethod', function () use ($server, $objectTree, $viewCallBack) {
|
$server->on('beforeMethod:*', function () use ($server, $objectTree, $viewCallBack) {
|
||||||
// ensure the skeleton is copied
|
// ensure the skeleton is copied
|
||||||
$userFolder = \OC::$server->getUserFolder();
|
$userFolder = \OC::$server->getUserFolder();
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ class FilesDropPlugin extends ServerPlugin {
|
||||||
* @throws MethodNotAllowed
|
* @throws MethodNotAllowed
|
||||||
*/
|
*/
|
||||||
public function initialize(\Sabre\DAV\Server $server) {
|
public function initialize(\Sabre\DAV\Server $server) {
|
||||||
$server->on('beforeMethod', [$this, 'beforeMethod'], 999);
|
$server->on('beforeMethod:*', [$this, 'beforeMethod'], 999);
|
||||||
$this->enabled = false;
|
$this->enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ class PublicLinkCheckPlugin extends ServerPlugin {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function initialize(\Sabre\DAV\Server $server) {
|
public function initialize(\Sabre\DAV\Server $server) {
|
||||||
$server->on('beforeMethod', [$this, 'beforeMethod']);
|
$server->on('beforeMethod:*', [$this, 'beforeMethod']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function beforeMethod(RequestInterface $request, ResponseInterface $response){
|
public function beforeMethod(RequestInterface $request, ResponseInterface $response){
|
||||||
|
|
|
@ -217,7 +217,7 @@ class Server {
|
||||||
$this->server->addPlugin(new SearchPlugin($lazySearchBackend));
|
$this->server->addPlugin(new SearchPlugin($lazySearchBackend));
|
||||||
|
|
||||||
// wait with registering these until auth is handled and the filesystem is setup
|
// wait with registering these until auth is handled and the filesystem is setup
|
||||||
$this->server->on('beforeMethod', function () use ($root, $lazySearchBackend) {
|
$this->server->on('beforeMethod:*', function () use ($root, $lazySearchBackend) {
|
||||||
// custom properties plugin must be the last one
|
// custom properties plugin must be the last one
|
||||||
$userSession = \OC::$server->getUserSession();
|
$userSession = \OC::$server->getUserSession();
|
||||||
$user = $userSession->getUser();
|
$user = $userSession->getUser();
|
||||||
|
|
|
@ -66,7 +66,7 @@ class FilesDropPluginTest extends TestCase {
|
||||||
$this->server->expects($this->once())
|
$this->server->expects($this->once())
|
||||||
->method('on')
|
->method('on')
|
||||||
->with(
|
->with(
|
||||||
$this->equalTo('beforeMethod'),
|
$this->equalTo('beforeMethod:*'),
|
||||||
$this->equalTo([$this->plugin, 'beforeMethod']),
|
$this->equalTo([$this->plugin, 'beforeMethod']),
|
||||||
$this->equalTo(999)
|
$this->equalTo(999)
|
||||||
);
|
);
|
||||||
|
|
|
@ -58,7 +58,7 @@ function handleException($e) {
|
||||||
// we shall not log on RemoteException
|
// we shall not log on RemoteException
|
||||||
$server->addPlugin(new ExceptionLoggerPlugin('webdav', \OC::$server->getLogger()));
|
$server->addPlugin(new ExceptionLoggerPlugin('webdav', \OC::$server->getLogger()));
|
||||||
}
|
}
|
||||||
$server->on('beforeMethod', function () use ($e) {
|
$server->on('beforeMethod:*', function () use ($e) {
|
||||||
if ($e instanceof RemoteException) {
|
if ($e instanceof RemoteException) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case 503:
|
case 503:
|
||||||
|
|
Loading…
Reference in New Issue