diff options
Diffstat (limited to 'apps/dav/lib/Connector/Sabre/FilesPlugin.php')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/FilesPlugin.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 156507e4467..95f3db9a65b 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -65,6 +65,7 @@ class FilesPlugin extends ServerPlugin { public const SIZE_PROPERTYNAME = '{http://owncloud.org/ns}size'; public const GETETAG_PROPERTYNAME = '{DAV:}getetag'; public const LASTMODIFIED_PROPERTYNAME = '{DAV:}lastmodified'; + public const CREATIONDATE_PROPERTYNAME = '{DAV:}creationdate'; public const OWNER_ID_PROPERTYNAME = '{http://owncloud.org/ns}owner-id'; public const OWNER_DISPLAY_NAME_PROPERTYNAME = '{http://owncloud.org/ns}owner-display-name'; public const CHECKSUMS_PROPERTYNAME = '{http://owncloud.org/ns}checksums'; @@ -395,6 +396,11 @@ class FilesPlugin extends ServerPlugin { $propFind->handle(self::DATA_FINGERPRINT_PROPERTYNAME, function () use ($node) { return $this->config->getSystemValue('data-fingerprint', ''); }); + $propFind->handle(self::CREATIONDATE_PROPERTYNAME, function () use ($node) { + return (new \DateTimeImmutable()) + ->setTimestamp($node->getFileInfo()->getCreationTime()) + ->format(\DateTimeInterface::ATOM); + }); $propFind->handle(self::CREATION_TIME_PROPERTYNAME, function () use ($node) { return $node->getFileInfo()->getCreationTime(); }); @@ -495,6 +501,14 @@ class FilesPlugin extends ServerPlugin { } return false; }); + $propPatch->handle(self::CREATIONDATE_PROPERTYNAME, function ($time) use ($node) { + if (empty($time)) { + return false; + } + $dateTime = new \DateTimeImmutable($time); + $node->setCreationTime($dateTime->getTimestamp()); + return true; + }); $propPatch->handle(self::CREATION_TIME_PROPERTYNAME, function ($time) use ($node) { if (empty($time)) { return false; |