diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-05 11:53:28 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-05 11:53:28 +0100 |
commit | e6bab280a6eb72332058e97c5188d440b3be4c6a (patch) | |
tree | 571c696a50c27e45e61b7e6bca8dc955bd5fb935 | |
parent | a92a4809673b63fb82b16a1cfaa8b243b0e1d89d (diff) | |
parent | b50edf322265083ff041c264e395623c7e71de24 (diff) | |
download | nextcloud-server-e6bab280a6eb72332058e97c5188d440b3be4c6a.tar.gz nextcloud-server-e6bab280a6eb72332058e97c5188d440b3be4c6a.zip |
Merge pull request #22143 from owncloud/fix_12385
When a user is removed we should remove the right shares
-rw-r--r-- | build/integration/features/sharing-v1.feature | 25 | ||||
-rw-r--r-- | lib/private/share/hooks.php | 2 |
2 files changed, 16 insertions, 11 deletions
diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature index bdc1a4224d8..1a1a5c1981a 100644 --- a/build/integration/features/sharing-v1.feature +++ b/build/integration/features/sharing-v1.feature @@ -480,13 +480,18 @@ Feature: sharing Then the OCS status code should be "100" And the HTTP status code should be "200" - - - - - - - - - - + Scenario: Keep usergroup shares (#22143) + Given As an "admin" + And user "user0" exists + And user "user1" exists + And user "user2" exists + And group "group" exists + And user "user1" belongs to group "group" + And user "user2" belongs to group "group" + And user "user0" created a folder "/TMP" + And file "TMP" of user "user0" is shared with group "group" + And user "user1" created a folder "/myFOLDER" + And User "user1" moves file "/TMP" to "/myFOLDER/myTMP" + And user "user2" does not exist + And user "user1" should see following elements + | /myFOLDER/myTMP/ | diff --git a/lib/private/share/hooks.php b/lib/private/share/hooks.php index 1fa233916d1..c939164e39e 100644 --- a/lib/private/share/hooks.php +++ b/lib/private/share/hooks.php @@ -38,7 +38,7 @@ class Hooks extends \OC\Share\Constants { public static function post_deleteUser($arguments) { // Delete any items shared with the deleted user $query = \OC_DB::prepare('DELETE FROM `*PREFIX*share`' - .' WHERE `share_with` = ? AND `share_type` = ? OR `share_type` = ?'); + .' WHERE `share_with` = ? AND (`share_type` = ? OR `share_type` = ?)'); $query->execute(array($arguments['uid'], self::SHARE_TYPE_USER, self::$shareTypeGroupUserUnique)); // Delete any items the deleted user shared $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*share` WHERE `uid_owner` = ?'); |