aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/External
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2018-07-04 10:39:13 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2018-07-11 10:11:48 +0200
commit3942d731d21e6369c395358699a9561519992069 (patch)
tree0f310ce8856af82c1f279a1e1e6f323cba9f1483 /apps/files_sharing/lib/External
parent5b06a7d773d303a9b01c98eb714fd1829129646f (diff)
downloadnextcloud-server-3942d731d21e6369c395358699a9561519992069.tar.gz
nextcloud-server-3942d731d21e6369c395358699a9561519992069.zip
update unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/files_sharing/lib/External')
-rw-r--r--apps/files_sharing/lib/External/Manager.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php
index 9f8acbce4cb..a3b037e4982 100644
--- a/apps/files_sharing/lib/External/Manager.php
+++ b/apps/files_sharing/lib/External/Manager.php
@@ -276,15 +276,16 @@ class Manager {
$mountPoint = Files::buildNotExistingFileName($shareFolder, $share['name']);
$mountPoint = Filesystem::normalizePath($mountPoint);
$hash = md5($mountPoint);
+ $userShareAccepted = false;
- if($share['share_type'] === Share::SHARE_TYPE_USER) {
+ if((int)$share['share_type'] === Share::SHARE_TYPE_USER) {
$acceptShare = $this->connection->prepare('
UPDATE `*PREFIX*share_external`
SET `accepted` = ?,
`mountpoint` = ?,
`mountpoint_hash` = ?
WHERE `id` = ? AND `user` = ?');
- $updated = $acceptShare->execute(array(1, $mountPoint, $hash, $id, $this->uid));
+ $userShareAccepted = $acceptShare->execute(array(1, $mountPoint, $hash, $id, $this->uid));
} else {
$result = $this->writeShareToDb(
$share['remote'],
@@ -297,9 +298,8 @@ class Manager {
$share['remote_id'],
$id,
$share['share_type']);
- // TODO group share, add additional row for the user who accepted it
}
- if ($updated === true) {
+ if ($userShareAccepted === true) {
$this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'accept');
\OC_Hook::emit(Share::class, 'federated_share_added', ['server' => $share['remote']]);
$result = true;