You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/files_sharing/lib/Helper.php
-87Lines changed: 0 additions & 87 deletions
Original file line number
Diff line number
Diff line change
@@ -163,93 +163,6 @@ public static function authenticate($linkItem, $password = null) {
163
163
returntrue;
164
164
}
165
165
166
-
publicstaticfunctiongetSharesFromItem($target) {
167
-
$result = [];
168
-
$owner = Filesystem::getOwner($target);
169
-
Filesystem::initMountPoints($owner);
170
-
$info = Filesystem::getFileInfo($target);
171
-
$ownerView = newView('/'.$owner.'/files');
172
-
if ($owner != User::getUser()) {
173
-
$path = $ownerView->getPath($info['fileid']);
174
-
} else {
175
-
$path = $target;
176
-
}
177
-
178
-
$ids = [];
179
-
while ($path !== \dirname($path)) {
180
-
$info = $ownerView->getFileInfo($path);
181
-
if ($infoinstanceof \OC\Files\FileInfo) {
182
-
$ids[] = $info['fileid'];
183
-
} else {
184
-
\OCP\Util::writeLog('files_sharing', 'No fileinfo available for: ' . $path, \OCP\Util::WARN);
185
-
}
186
-
$path = \dirname($path);
187
-
}
188
-
189
-
if (!empty($ids)) {
190
-
$idList = \array_chunk($ids, 99, true);
191
-
192
-
foreach ($idListas$subList) {
193
-
$statement = "SELECT `share_with`, `share_type`, `file_target` FROM `*PREFIX*share` WHERE `file_source` IN (" . \implode(',', $subList) . ") AND `share_type` IN (0, 1, 2)";
194
-
$query = \OCP\DB::prepare($statement);
195
-
$r = $query->execute();
196
-
$result = \array_merge($result, $r->fetchAll());
197
-
}
198
-
}
199
-
200
-
return$result;
201
-
}
202
-
203
-
/**
204
-
* get the UID of the owner of the file and the path to the file relative to
0 commit comments