ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Locking plugin. More...
Public Member Functions | |
__construct (Backend\BackendInterface $locksBackend) | |
__construct More... | |
initialize (DAV\Server $server) | |
Initializes the plugin. More... | |
getPluginName () | |
Returns a plugin name. More... | |
propFind (DAV\PropFind $propFind, DAV\INode $node) | |
This method is called after most properties have been found it allows us to add in any Lock-related properties. More... | |
getHTTPMethods ($uri) | |
Use this method to tell the server this plugin defines additional HTTP methods. More... | |
getFeatures () | |
Returns a list of features for the HTTP OPTIONS Dav: header. More... | |
getLocks ($uri, $returnChildLocks=false) | |
Returns all lock information on a particular uri. More... | |
httpLock (RequestInterface $request, ResponseInterface $response) | |
Locks an uri. More... | |
httpUnlock (RequestInterface $request, ResponseInterface $response) | |
Unlocks a uri. More... | |
afterUnbind ($path) | |
This method is called after a node is deleted. More... | |
lockNode ($uri, LockInfo $lockInfo) | |
Locks a uri. More... | |
unlockNode ($uri, LockInfo $lockInfo) | |
Unlocks a uri. More... | |
getTimeoutHeader () | |
Returns the contents of the HTTP Timeout header. More... | |
validateTokens (RequestInterface $request, &$conditions) | |
The validateTokens event is triggered before every request. More... | |
getPluginInfo () | |
Returns a bunch of meta-data about the plugin. More... | |
Public Member Functions inherited from Sabre\DAV\ServerPlugin | |
initialize (Server $server) | |
This initializes the plugin. More... | |
getFeatures () | |
This method should return a list of server-features. More... | |
getHTTPMethods ($path) | |
Use this method to tell the server this plugin defines additional HTTP methods. More... | |
getPluginName () | |
Returns a plugin name. More... | |
getSupportedReportSet ($uri) | |
Returns a list of reports this plugin supports. More... | |
getPluginInfo () | |
Returns a bunch of meta-data about the plugin. More... | |
Protected Member Functions | |
generateLockResponse (LockInfo $lockInfo) | |
Generates the response for successful LOCK requests. More... | |
parseLockRequest ($body) | |
Parses a webdav lock xml body, and returns a new Sabre object. More... | |
Protected Attributes | |
$locksBackend | |
$server | |
Locking plugin.
This plugin provides locking support to a WebDAV server. The easiest way to get started, is by hooking it up as such:
$lockBackend = new Sabre('./mylockdb'); $lockPlugin = new Sabre($lockBackend); $server->addPlugin($lockPlugin);
Definition at line 23 of file Plugin.php.
Sabre\DAV\Locks\Plugin::__construct | ( | Backend\BackendInterface | $locksBackend | ) |
__construct
Backend\BackendInterface | $locksBackend |
Definition at line 44 of file Plugin.php.
References Sabre\DAV\Locks\Plugin\$locksBackend.
Sabre\DAV\Locks\Plugin::afterUnbind | ( | $path | ) |
This method is called after a node is deleted.
We use this event to clean up any locks that still exist on the node.
string | $path |
Definition at line 318 of file Plugin.php.
References $path, Sabre\DAV\Locks\Plugin\getLocks(), and Sabre\DAV\Locks\Plugin\unlockNode().
|
protected |
Generates the response for successful LOCK requests.
LockInfo | $lockInfo |
Definition at line 394 of file Plugin.php.
Referenced by Sabre\DAV\Locks\Plugin\httpLock().
Sabre\DAV\Locks\Plugin::getFeatures | ( | ) |
Returns a list of features for the HTTP OPTIONS Dav: header.
In this case this is only the number 2. The 2 in the Dav: header indicates the server supports locks.
Definition at line 131 of file Plugin.php.
Sabre\DAV\Locks\Plugin::getHTTPMethods | ( | $uri | ) |
Use this method to tell the server this plugin defines additional HTTP methods.
This method is passed a uri. It should only return HTTP methods that are available for the specified uri.
string | $uri |
Definition at line 117 of file Plugin.php.
Sabre\DAV\Locks\Plugin::getLocks | ( | $uri, | |
$returnChildLocks = false |
|||
) |
Returns all lock information on a particular uri.
This function should return an array with Sabre objects. If there are no locks on a file, return an empty array.
Additionally there is also the possibility of locks on parent nodes, so we'll need to traverse every part of the tree If the $returnChildLocks argument is set to true, we'll also traverse all the children of the object for any possible locks and return those as well.
string | $uri | |
bool | $returnChildLocks |
Definition at line 150 of file Plugin.php.
Referenced by Sabre\DAV\Locks\Plugin\afterUnbind(), Sabre\DAV\Locks\Plugin\httpLock(), Sabre\DAV\Locks\Plugin\httpUnlock(), Sabre\DAV\Locks\Plugin\propFind(), and Sabre\DAV\Locks\Plugin\validateTokens().
Sabre\DAV\Locks\Plugin::getPluginInfo | ( | ) |
Returns a bunch of meta-data about the plugin.
Providing this information is optional, and is mainly displayed by the Browser plugin.
The description key in the returned array may contain html and will not be sanitized.
Definition at line 579 of file Plugin.php.
References Sabre\DAV\Locks\Plugin\getPluginName().
Sabre\DAV\Locks\Plugin::getPluginName | ( | ) |
Returns a plugin name.
Using this name other plugins will be able to access other plugins using Sabre::getPlugin
Definition at line 80 of file Plugin.php.
Referenced by Sabre\DAV\Locks\Plugin\getPluginInfo().
Sabre\DAV\Locks\Plugin::getTimeoutHeader | ( | ) |
Returns the contents of the HTTP Timeout header.
The method formats the header into an integer.
Definition at line 368 of file Plugin.php.
References $header, and Sabre\DAV\Locks\LockInfo\TIMEOUT_INFINITE.
Referenced by Sabre\DAV\Locks\Plugin\httpLock().
Sabre\DAV\Locks\Plugin::httpLock | ( | RequestInterface | $request, |
ResponseInterface | $response | ||
) |
Locks an uri.
The WebDAV lock request can be operated to either create a new lock on a file, or to refresh an existing lock If a new lock is created, a full XML body should be supplied, containing information about the lock such as the type of lock (shared or exclusive) and the owner of the lock
If a lock is to be refreshed, no body should be supplied and there should be a valid If header containing the lock
Additionally, a lock can be requested for a non-existent file. In these case we're obligated to create an empty file as per RFC4918:S7.3
RequestInterface | $request | |
ResponseInterface | $response |
Definition at line 171 of file Plugin.php.
References PHPMailer\PHPMailer\$token, Sabre\DAV\Locks\LockInfo\EXCLUSIVE, Sabre\DAV\Locks\Plugin\generateLockResponse(), Sabre\HTTP\MessageInterface\getBodyAsString(), Sabre\DAV\Locks\Plugin\getLocks(), Sabre\HTTP\RequestInterface\getPath(), Sabre\DAV\Locks\Plugin\getTimeoutHeader(), Sabre\DAV\Locks\Plugin\lockNode(), Sabre\DAV\Locks\Plugin\parseLockRequest(), Sabre\HTTP\MessageInterface\setBody(), Sabre\HTTP\MessageInterface\setHeader(), Sabre\HTTP\ResponseInterface\setStatus(), and Sabre\DAV\Locks\LockInfo\SHARED.
Sabre\DAV\Locks\Plugin::httpUnlock | ( | RequestInterface | $request, |
ResponseInterface | $response | ||
) |
Unlocks a uri.
This WebDAV method allows you to remove a lock from a node. The client should provide a valid locktoken through the Lock-token http header The server should return 204 (No content) on success
RequestInterface | $request | |
ResponseInterface | $response |
Definition at line 275 of file Plugin.php.
References $path, Sabre\HTTP\MessageInterface\getHeader(), Sabre\DAV\Locks\Plugin\getLocks(), Sabre\HTTP\RequestInterface\getPath(), Sabre\HTTP\MessageInterface\setHeader(), Sabre\HTTP\ResponseInterface\setStatus(), and Sabre\DAV\Locks\Plugin\unlockNode().
Sabre\DAV\Locks\Plugin::initialize | ( | DAV\Server | $server | ) |
Initializes the plugin.
This method is automatically called by the Server class after addPlugin.
DAV\Server | $server |
Definition at line 58 of file Plugin.php.
References Sabre\DAV\Locks\Plugin\$server.
Sabre\DAV\Locks\Plugin::lockNode | ( | $uri, | |
LockInfo | $lockInfo | ||
) |
Locks a uri.
All the locking information is supplied in the lockInfo object. The object has a suggested timeout, but this can be safely ignored It is important that if the existing timeout is ignored, the property is overwritten, as this needs to be sent back to the client
string | $uri | |
LockInfo | $lockInfo |
Definition at line 337 of file Plugin.php.
Referenced by Sabre\DAV\Locks\Plugin\httpLock().
|
protected |
Parses a webdav lock xml body, and returns a new Sabre object.
string | $body |
Definition at line 551 of file Plugin.php.
References $result, and Sabre\DAV\UUIDUtil\getUUID().
Referenced by Sabre\DAV\Locks\Plugin\httpLock().
Sabre\DAV\Locks\Plugin::propFind | ( | DAV\PropFind | $propFind, |
DAV\INode | $node | ||
) |
This method is called after most properties have been found it allows us to add in any Lock-related properties.
DAV\PropFind | $propFind | |
DAV\INode | $node |
Definition at line 94 of file Plugin.php.
References Sabre\DAV\Locks\Plugin\getLocks().
Sabre\DAV\Locks\Plugin::unlockNode | ( | $uri, | |
LockInfo | $lockInfo | ||
) |
Unlocks a uri.
This method removes a lock from a uri. It is assumed all the supplied information is correct and verified
string | $uri | |
LockInfo | $lockInfo |
Definition at line 353 of file Plugin.php.
Referenced by Sabre\DAV\Locks\Plugin\afterUnbind(), and Sabre\DAV\Locks\Plugin\httpUnlock().
Sabre\DAV\Locks\Plugin::validateTokens | ( | RequestInterface | $request, |
& | $conditions | ||
) |
The validateTokens event is triggered before every request.
It's a moment where this plugin can check all the supplied lock tokens in the If: header, and check if they are valid.
In addition, it will also ensure that it checks any missing lokens that must be present in the request, and reject requests without the proper tokens.
RequestInterface | $request | |
mixed | $conditions |
Definition at line 416 of file Plugin.php.
References $ii, PHPMailer\PHPMailer\$token, Sabre\HTTP\MessageInterface\getHeader(), Sabre\DAV\Locks\Plugin\getLocks(), Sabre\HTTP\RequestInterface\getMethod(), and Sabre\HTTP\RequestInterface\getPath().
|
protected |
Definition at line 30 of file Plugin.php.
Referenced by Sabre\DAV\Locks\Plugin\__construct().
|
protected |
Definition at line 37 of file Plugin.php.
Referenced by Sabre\DAV\Locks\Plugin\initialize().