summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2015-10-06 18:09:12 +0200
committerRobin Appelman <robin@icewind.nl>2015-10-06 18:09:12 +0200
commit59cf817308c65a8bfcb876308a38c18917dfe59e (patch)
tree4518ac6508e9adf1285cdae4802b4722d64ed080 /apps/files_sharing/lib
parent3413b766311c1936097d260544a5181695cd7822 (diff)
parent17756ebf5bb7c2bdf9e949f3fc517c39ed284600 (diff)
downloadnextcloud-server-59cf817308c65a8bfcb876308a38c18917dfe59e.tar.gz
nextcloud-server-59cf817308c65a8bfcb876308a38c18917dfe59e.zip
Merge pull request #19511 from owncloud/etag-share-permissions-update
Mark shares as dirty when changing permissions
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/propagation/changewatcher.php8
-rw-r--r--apps/files_sharing/lib/propagation/propagationmanager.php8
-rw-r--r--apps/files_sharing/lib/propagation/recipientpropagator.php2
3 files changed, 14 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/propagation/changewatcher.php b/apps/files_sharing/lib/propagation/changewatcher.php
index 9da3ffe51a2..e61c161da19 100644
--- a/apps/files_sharing/lib/propagation/changewatcher.php
+++ b/apps/files_sharing/lib/propagation/changewatcher.php
@@ -99,4 +99,12 @@ class ChangeWatcher {
$propagator->propagateChanges();
}
}
+
+ public function permissionsHook($params) {
+ $share = $params['share'];
+
+ if ($share['item_type'] === 'file' || $share['item_type'] === 'folder') {
+ $this->recipientPropagator->markDirty($share, microtime(true));
+ }
+ }
}
diff --git a/apps/files_sharing/lib/propagation/propagationmanager.php b/apps/files_sharing/lib/propagation/propagationmanager.php
index 35048f89cfb..6ed70e93f84 100644
--- a/apps/files_sharing/lib/propagation/propagationmanager.php
+++ b/apps/files_sharing/lib/propagation/propagationmanager.php
@@ -25,6 +25,7 @@ use OC\Files\Filesystem;
use OC\Files\View;
use OCP\IConfig;
use OCP\IUserSession;
+use OCP\Util;
/**
@@ -134,8 +135,9 @@ class PropagationManager {
// for marking shares owned by the active user as dirty when a file inside them changes
$this->listenToOwnerChanges($user->getUID(), $user->getUID());
- \OC_Hook::connect('OC_Filesystem', 'post_write', $watcher, 'writeHook');
- \OC_Hook::connect('OC_Filesystem', 'post_delete', $watcher, 'writeHook');
- \OC_Hook::connect('OC_Filesystem', 'post_rename', $watcher, 'renameHook');
+ Util::connectHook('OC_Filesystem', 'post_write', $watcher, 'writeHook');
+ Util::connectHook('OC_Filesystem', 'post_delete', $watcher, 'writeHook');
+ Util::connectHook('OC_Filesystem', 'post_rename', $watcher, 'renameHook');
+ Util::connectHook('OCP\Share', 'post_update_permissions', $watcher, 'permissionsHook');
}
}
diff --git a/apps/files_sharing/lib/propagation/recipientpropagator.php b/apps/files_sharing/lib/propagation/recipientpropagator.php
index 420cacb3d2f..8e064e2ee54 100644
--- a/apps/files_sharing/lib/propagation/recipientpropagator.php
+++ b/apps/files_sharing/lib/propagation/recipientpropagator.php
@@ -105,7 +105,7 @@ class RecipientPropagator {
/**
* @param array $share
- * @param int $time
+ * @param float $time
*/
public function markDirty($share, $time = null) {
if ($time === null) {