Skip to content
Snippets Groups Projects
Commit b619821f authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Create a new OC_Share object instead of manually inserting rows when adding a...

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
parent 6673375e
Branches
No related tags found
No related merge requests found
......@@ -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'];
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment