Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-10-30 19:24:55 +0300
committerRobin Appelman <robin@icewind.nl>2019-11-13 14:39:39 +0300
commit2165f10aaf58d7662d6ffb9cb432b70672fc0738 (patch)
treeb6906c34ca1f4d4300ae642bde788ee11e842617 /apps/dav/lib/Connector/Sabre/File.php
parent136c4ef925eb77a421b8bd67d476405603a0fa1d (diff)
hookup creation and upload time into dav
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/dav/lib/Connector/Sabre/File.php')
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php
index dd25b046bcf..bc72fd24e71 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -291,6 +291,19 @@ class File extends Node implements IFile {
}
}
+ $fileInfoUpdate = [
+ 'upload_time' => time()
+ ];
+
+ // allow sync clients to send the creation time along in a header
+ if (isset($this->request->server['HTTP_X_OC_CTIME'])) {
+ $ctime = $this->sanitizeMtime($this->request->server['HTTP_X_OC_CTIME']);
+ $fileInfoUpdate['creation_time'] = $ctime;
+ $this->header('X-OC-CTime: accepted');
+ }
+
+ $this->fileView->putFileInfo($this->path, $fileInfoUpdate);
+
if ($view) {
$this->emitPostHooks($exists);
}