diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-05 10:01:59 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-05 10:05:22 +0100 |
commit | 5f521067d8bbffc37b9700702dcd6abaed89d653 (patch) | |
tree | 8cfac1196d299a647b5dd40c1f6a244d309fe18d /lib/private | |
parent | 342c2aac98961f91f0fd38423a217cb980dd95b8 (diff) | |
download | nextcloud-server-5f521067d8bbffc37b9700702dcd6abaed89d653.tar.gz nextcloud-server-5f521067d8bbffc37b9700702dcd6abaed89d653.zip |
When a user is removed we should remove the right shares
* This means all the shares directly shared with them
* Or all group shares having a special share with them
This patch fixes the operator precedece (AND before OR).
So before this patch:
(share_with = <deleted user> AND share_type = 0) OR share_type=2
So it deleted all user specific shares
Now:
share_with = <deleted user> AND (share_type = 0 OR (share_type=2)
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/share/hooks.php | 2 |
1 files changed, 1 insertions, 1 deletions
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` = ?'); |