summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2012-05-15 12:03:20 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2012-05-15 12:03:20 -0400
commitb619821f4a7048c56d198095c5c3b3c9fca02ae1 (patch)
tree65a0e3e342feb550587630e418a3352bef35446f /apps
parent6673375eeb898cce4c840138ff1414974a8e1506 (diff)
downloadnextcloud-server-b619821f4a7048c56d198095c5c3b3c9fca02ae1.tar.gz
nextcloud-server-b619821f4a7048c56d198095c5c3b3c9fca02ae1.zip
Create a new OC_Share object instead of manually inserting rows when adding a user to a group share, prevents a couple of potential bugs
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib_share.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php
index 73ddaf0b9ea..9e43fef7696 100644
--- a/apps/files_sharing/lib_share.php
+++ b/apps/files_sharing/lib_share.php
@@ -472,12 +472,10 @@ class OC_Share {
$gid = '@'.$arguments['gid'];
$result = $query->execute(array($gid))->fetchAll();
if (count($result) > 0) {
- $query = OCP\DB::prepare('INSERT INTO *PREFIX*sharing VALUES(?,?,?,?,?)');
- $sharedFolder = '/'.$arguments['uid'].'/files/Shared/';
$lastSource = '';
for ($i = 0; $i < count($result) - 1; $i++) {
if ($result[$i]['source'] != $lastSource) {
- $query->execute(array($result[$i]['uid_owner'], $arguments['uid'].'@'.$arguments['gid'], $result[$i]['source'], $sharedFolder.basename($result[$i]['source']), $result[$i]['permissions']));
+ new OC_Share($result[$i]['source'], $arguments['gid'], $result[$i]['permissions']);
$lastSource = $result[$i]['source'];
}
}