summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/versions.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2012-06-28 12:42:47 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2012-06-28 12:42:47 +0200
commitf22f49671bcdc87058c6060db4ca4e4e1d9704f1 (patch)
treef58c1c0eb9f2631bd4bd652548d3bfbf85fa7d35 /apps/files_versions/versions.php
parent52f99a7570921f994035c96002b7ae46acdfea9b (diff)
downloadnextcloud-server-f22f49671bcdc87058c6060db4ca4e4e1d9704f1.tar.gz
nextcloud-server-f22f49671bcdc87058c6060db4ca4e4e1d9704f1.zip
move hook to erase versions from deleted files to the right place
Diffstat (limited to 'apps/files_versions/versions.php')
-rw-r--r--apps/files_versions/versions.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/files_versions/versions.php b/apps/files_versions/versions.php
index 9c0829ff1de..787de0f78ad 100644
--- a/apps/files_versions/versions.php
+++ b/apps/files_versions/versions.php
@@ -309,5 +309,17 @@ class Storage {
}
-
+ /**
+ * @brief Erase versions of deleted file
+ */
+ public static function removeVersions($params) {
+ $rel_path = $params[\OC_Filesystem::signal_param_path];
+ $abs_path = \OCP\Config::getSystemValue('datadirectory').'/'.\OC_User::getUser()."/versions".$rel_path.'.v';
+ if(Storage::isversioned($rel_path)) {
+ $versions = Storage::getVersions($rel_path);
+ foreach ($versions as $v){
+ unlink($abs_path . $v['version']);
+ }
+ }
+ }
}