summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-25 16:56:19 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-25 16:56:19 +0100
commit776d91f3bc9ab0b281540f469b4f60f8d43ced03 (patch)
treee5a997db3bf2c2953bc4c2e2580722b741a2c531
parent29e3c4a60e014cbc93bf4e1b032465a58188ba47 (diff)
parentbd456b5889443816d80278e0818ae64bd32ffe4d (diff)
downloadnextcloud-server-776d91f3bc9ab0b281540f469b4f60f8d43ced03.tar.gz
nextcloud-server-776d91f3bc9ab0b281540f469b4f60f8d43ced03.zip
Merge pull request #21854 from owncloud/fix-share-hook-group-add
Fix addUserToGroup hook of the share code
-rw-r--r--lib/private/share/hooks.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/private/share/hooks.php b/lib/private/share/hooks.php
index c939164e39e..b730146ddfe 100644
--- a/lib/private/share/hooks.php
+++ b/lib/private/share/hooks.php
@@ -55,6 +55,15 @@ class Hooks extends \OC\Share\Constants {
* @param array $arguments
*/
public static function pre_addToGroup($arguments) {
+ $currentUser = \OC::$server->getUserSession()->getUser();
+ $currentUserID = is_null($currentUser) ? '' : $currentUser->getUID();
+
+ // setup filesystem for added user if it isn't the current user
+ if($currentUserID !== $arguments['uid']) {
+ \OC_Util::tearDownFS();
+ \OC_Util::setupFS($arguments['uid']);
+ }
+
/** @var \OC\DB\Connection $db */
$db = \OC::$server->getDatabaseConnection();
@@ -120,6 +129,14 @@ class Hooks extends \OC\Share\Constants {
];
}
}
+
+ // re-setup old filesystem state
+ if($currentUserID !== $arguments['uid']) {
+ \OC_Util::tearDownFS();
+ if($currentUserID !== '') {
+ \OC_Util::setupFS($currentUserID);
+ }
+ }
}
/**