diff --git a/controller/sharecontroller.php b/controller/sharecontroller.php index 8f2c72fd..129dc2d5 100644 --- a/controller/sharecontroller.php +++ b/controller/sharecontroller.php @@ -211,7 +211,7 @@ class ShareController extends ApiController { * @NoAdminRequired */ public function getVaultItems($vault_guid){ - $this->shareService->getSharedItems($this->userId, $vault_guid); + $this->shareService->getSharedItems($this->userId->getUID(), $vault_guid); } public function deleteShareRequest($share_request_id){ diff --git a/lib/Db/SharingACLMapper.php b/lib/Db/SharingACLMapper.php index 3464698b..def4ad5b 100644 --- a/lib/Db/SharingACLMapper.php +++ b/lib/Db/SharingACLMapper.php @@ -15,7 +15,7 @@ use OCP\IUser; use OCA\Passman\Utility\Utils; class SharingACLMapper extends Mapper { - const TABLE_NAME = '`*PREFIX*passman_sharing_acl`'; + const TABLE_NAME = '*PREFIX*passman_sharing_acl'; public function __construct(IDBConnection $db, Utils $utils) { parent::__construct($db, 'passman_sharing_acl'); @@ -29,7 +29,7 @@ class SharingACLMapper extends Mapper { * @return SharingACL[] */ public function getCredentialPermissions(IUser $userId, $item_guid){ - $sql = "SELECT * FROM {{self::TABLE_NAME}} WHERE user_id = ? AND item_guid = ?"; + $sql = "SELECT * FROM ". self::TABLE_NAME ." WHERE user_id = ? AND item_guid = ?"; return $this->findEntities($sql, [$userId, $item_guid]); } @@ -45,7 +45,7 @@ class SharingACLMapper extends Mapper { * @return SharingACL[] */ public function getVaultEntries($user_id, $vault_id) { - $q = "SELECT * FROM {{ self::TABLE_NAME }} WHERE target_user_id = ? AND target_vault_guid = ?"; + $q = "SELECT * FROM ". self::TABLE_NAME ." WHERE user_id = ? AND vault_guid = ?"; return $this->findEntities($q, [$user_id, $vault_id]); } } \ No newline at end of file