diff options
author | Marcos Zuriaga <wolfi@wolfi.es> | 2016-10-04 21:46:59 +0300 |
---|---|---|
committer | Marcos Zuriaga <wolfi@wolfi.es> | 2016-10-04 21:46:59 +0300 |
commit | 00149bb912f4bd1a684294057785b1d5f08fd9a6 (patch) | |
tree | 38f08c488c49c1be672ceb4d66576a19ae83a7fc | |
parent | 352338fc77edd4c1d222f3d77b1c9d9dc0c031e1 (diff) |
Fixes some issues with the ACL queries
-rw-r--r-- | lib/Db/ShareRequest.php | 2 | ||||
-rw-r--r-- | lib/Db/ShareRequestMapper.php | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/Db/ShareRequest.php b/lib/Db/ShareRequest.php index 473ec95d..df7947be 100644 --- a/lib/Db/ShareRequest.php +++ b/lib/Db/ShareRequest.php @@ -82,7 +82,7 @@ class ShareRequest extends PermissionEntity implements \JsonSerializable { return [ 'item_id' => $this->getItemId(), 'item_guid' => $this->getItemGuid(), - 'user_id' => $this->getFromUserId(), + 'user_id' => $this->getTargetUserId(), 'created' => $this->getCreated(), 'permissions' => $this->getPermissions(), 'vault_id' => $this->getTargetUserId(), diff --git a/lib/Db/ShareRequestMapper.php b/lib/Db/ShareRequestMapper.php index 95f3f4eb..3e7f5b93 100644 --- a/lib/Db/ShareRequestMapper.php +++ b/lib/Db/ShareRequestMapper.php @@ -43,7 +43,8 @@ class ShareRequestMapper extends Mapper { * @return ShareRequest[] */ public function getRequestsByItemGuid($item_guid){ - $q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME . " WHERE item_guid = ? GROUP BY user_id"; + $this->db->executeQuery("SET sql_mode = '';"); + $q = "SELECT *, target_user_id FROM *PREFIX*" . self::TABLE_NAME . " WHERE item_guid = ? GROUP BY target_user_id;"; return $this->findEntities($q, [$item_guid]); } |