summaryrefslogtreecommitdiffstats
path: root/lib/connector
diff options
context:
space:
mode:
authorKlaas Freitag <freitag@owncloud.com>2012-02-14 09:59:54 +0100
committerKlaas Freitag <freitag@owncloud.com>2012-02-14 09:59:54 +0100
commit60a03580fff65d969faea8e5788b278ed8b15481 (patch)
tree7b2286bbcf87cca0d52c348f8ef0116f4c055e53 /lib/connector
parentd10f4f071d8a51128e0b8056e9af414af98cf833 (diff)
downloadnextcloud-server-60a03580fff65d969faea8e5788b278ed8b15481.tar.gz
nextcloud-server-60a03580fff65d969faea8e5788b278ed8b15481.zip
allow to set a files mtime through a PROPPATCH request on resource
'lastmodified'. Needed for syncing algorithms.
Diffstat (limited to 'lib/connector')
-rw-r--r--lib/connector/sabre/node.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php
index b8b675c1203..41acb48dfb6 100644
--- a/lib/connector/sabre/node.php
+++ b/lib/connector/sabre/node.php
@@ -97,12 +97,8 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
* in the second parameter or to now if the second param is empty.
* Even if the modification time is set to a custom value the access time is set to now.
*/
- public function setLastModifiedTime($mtime) {
- OC_Filesystem::setFileMtime($this->path, $mtime);
- }
-
- public function endsWith( $str, $sub ) {
- return ( substr( $str, strlen( $str ) - strlen( $sub ) ) === $sub );
+ public function touch($mtime) {
+ OC_Filesystem::touch($this->path, $mtime);
}
/**
@@ -123,8 +119,8 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
}
}
else {
- if( $this->endsWith( $propertyName, "modificationTime")) {
- $this->setLastModifiedTime($propertyValue);
+ if( strcmp( $propertyName, "lastmodified")) {
+ $this->touch($propertyValue);
} else {
if(!array_key_exists( $propertyName, $existing )){
$query = OC_DB::prepare( 'INSERT INTO *PREFIX*properties (userid,propertypath,propertyname,propertyvalue) VALUES(?,?,?,?)' );