mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-06-04 04:10:17 +00:00
Allow processing of supportedlock property to identify we can handle
exclusive write locks now.
This commit is contained in:
parent
b38dfb190e
commit
72be8944ec
@ -40,6 +40,8 @@ foreach( $request->xml_tags AS $k => $v ) {
|
||||
case 'DAV::DISPLAYNAME':
|
||||
case 'DAV::GETCONTENTLENGTH':
|
||||
case 'DAV::GETCONTENTTYPE':
|
||||
case 'DAV::SUPPORTEDLOCK':
|
||||
case 'DAV::LOCKDISCOVERY':
|
||||
case 'DAV::RESOURCETYPE':
|
||||
case 'DAV::SUPPORTED-PRIVILEGE-SET':
|
||||
case 'DAV::CURRENT-USER-PRIVILEGE-SET':
|
||||
@ -126,6 +128,18 @@ function collection_to_xml( $collection ) {
|
||||
$grant = new XMLElement( "grant", array(privileges($request->permissions)) );
|
||||
$prop->NewElement("acl", new XMLElement( "ace", array( $principal, $grant ) ) );
|
||||
}
|
||||
|
||||
if ( isset($attribute_list['SUPPORTEDLOCK']) ) {
|
||||
$prop->NewElement("supportedlock",
|
||||
new XMLElement( "lockentry",
|
||||
array(
|
||||
new XMLElement("lockscope", new XMLElement("exclusive")),
|
||||
new XMLElement("locktype", new XMLElement("write")),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( isset($attribute_list['SUPPORTED-PRIVILEGE-SET']) ) {
|
||||
$prop->NewElement("supported-privilege-set", privileges( $request->SupportedPrivileges(), "supported-privilege") );
|
||||
}
|
||||
@ -172,6 +186,17 @@ function item_to_xml( $item ) {
|
||||
if ( isset($attribute_list['CURRENT-USER-PRIVILEGE-SET']) ) {
|
||||
$prop->NewElement("current-user-privilege-set", privileges($request->permissions) );
|
||||
}
|
||||
|
||||
if ( isset($attribute_list['SUPPORTEDLOCK']) ) {
|
||||
$prop->NewElement("supportedlock",
|
||||
new XMLElement( "lockentry",
|
||||
array(
|
||||
new XMLElement("lockscope", new XMLElement("exclusive")),
|
||||
new XMLElement("locktype", new XMLElement("write")),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
$status = new XMLElement("status", "HTTP/1.1 200 OK" );
|
||||
|
||||
$propstat = new XMLElement( "propstat", array( $prop, $status) );
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user