diff --git a/phpgwapi/inc/class.vfs_sql.inc.php b/phpgwapi/inc/class.vfs_sql.inc.php index 1f558a7c7c..bb3f667553 100644 --- a/phpgwapi/inc/class.vfs_sql.inc.php +++ b/phpgwapi/inc/class.vfs_sql.inc.php @@ -1970,6 +1970,18 @@ $edited_comment = 1; } $to_write[$this->vfs_column_prefix.$attribute] = $data['attributes'][$attribute]; + + if ($this->file_actions) + { + switch($attribute) + { + // if the modification time get's set, we also set it in the filesystem, as + // the next reload reset it again to the modification time of the filesystem + case 'modified': + touch($p->real_full_path,$data['attributes'][$attribute]); + break; + } + } } } diff --git a/phpgwapi/inc/class.vfs_webdav_server.inc.php b/phpgwapi/inc/class.vfs_webdav_server.inc.php index 40fb4602e2..6e0b4a4d4a 100644 --- a/phpgwapi/inc/class.vfs_webdav_server.inc.php +++ b/phpgwapi/inc/class.vfs_webdav_server.inc.php @@ -405,39 +405,54 @@ class vfs_webdav_server extends HTTP_WebDAV_Server function PROPPATCH(&$options) { foreach ($options["props"] as $key => $prop) { - if ($prop["ns"] == "DAV:") { - $options["props"][$key]['status'] = "403 Forbidden"; - } else { - $attributes = array(); - switch($prop['ns']) - { - // allow Webdrive (Novel) to set creation and modification time - case 'http://www.southrivertech.com/': - switch($prop['name']) - { - case 'srt_modifiedtime': - case 'getlastmodified': - $attributes['modified'] = strtotime($prop['val']); - break; - case 'srt_creationtime': - $attributes['created'] = strtotime($prop['val']); - break; - } - break; - } - if ($attributes) - { - $vfs_data = array( - 'string' => $GLOBALS['egw']->translation->convert($options['path'],'utf-8'), - 'relatives' => array(RELATIVE_ROOT), // filename is relative to the vfs-root - 'attributes'=> $attributes, - ); - $this->vfs->set_attributes($vfs_data); - } + $attributes = array(); + switch($prop['ns']) + { + // allow Webdrive to set creation and modification time + case 'http://www.southrivertech.com/': + switch($prop['name']) + { + case 'srt_modifiedtime': + case 'getlastmodified': + $attributes['modified'] = strtotime($prop['val']); + break; + case 'srt_creationtime': + $attributes['created'] = strtotime($prop['val']); + break; + } + break; + + case 'DAV:': + switch($prop['name']) + { + // allow netdrive to change the modification time + case 'getlastmodified': + $attributes['modified'] = strtotime($prop['val']); + break; + // not sure why, the filesystem example of the WebDAV class does it ... + default: + $options["props"][$key]['status'] = "403 Forbidden"; + break; + } + break; } if ($this->debug) $props[] = '('.$prop["ns"].')'.$prop['name'].'='.$prop['val']; } - if ($this->debug) error_log(__CLASS__.'::'.__METHOD__.": path=$options[path],props=".implode(', ',$props)); + if ($attributes) + { + $vfs_data = array( + 'string' => $GLOBALS['egw']->translation->convert($options['path'],'utf-8'), + 'relatives' => array(RELATIVE_ROOT), // filename is relative to the vfs-root + 'attributes'=> $attributes, + ); + $this->vfs->set_attributes($vfs_data); + } + if ($this->debug) + { + error_log(__CLASS__.'::'.__METHOD__.": path=$options[path], props=".implode(', ',$props)); + if ($attributes) error_log(__CLASS__.'::'.__METHOD__.": path=$options[path], set attributes=".str_replace("\n",' ',print_r($attributes,true))); + } + return ""; // this is as the filesystem example handler does it, no true or false ... }