Show users shared with in the drop down for reshared files
This commit is contained in:
parent
e0ff57e8c2
commit
8c8490b28e
3 changed files with 17 additions and 12 deletions
|
@ -6,17 +6,18 @@ require_once('../lib_share.php');
|
|||
|
||||
$userDirectory = "/".OC_User::getUser()."/files";
|
||||
$source = $userDirectory.$_GET['source'];
|
||||
$users = OC_Share::getMySharedItem($source);
|
||||
$path = $source;
|
||||
for ($i = 0; $i < count($users); $i++) {
|
||||
if ($users[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
|
||||
$users[$i]['token'] = OC_Share::getTokenFromSource($source);
|
||||
if ($users = OC_Share::getMySharedItem($source)) {
|
||||
for ($i = 0; $i < count($users); $i++) {
|
||||
if ($users[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
|
||||
$users[$i]['token'] = OC_Share::getTokenFromSource($source);
|
||||
}
|
||||
}
|
||||
}
|
||||
$source = dirname($source);
|
||||
while ($source != "" && $source != "/" && $source != "." && $source != $userDirectory) {
|
||||
$values = array_values(OC_Share::getMySharedItem($source));
|
||||
if (count($values) > 0) {
|
||||
if ($values = OC_Share::getMySharedItem($source)) {
|
||||
$values = array_values($values);
|
||||
$parentUsers = array();
|
||||
for ($i = 0; $i < count($values); $i++) {
|
||||
if ($values[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
|
||||
|
|
|
@ -13,11 +13,8 @@ foreach ($sources as $source) {
|
|||
if ($source && OC_FILESYSTEM::file_exists($source) && OC_FILESYSTEM::is_readable($source)) {
|
||||
$source = $userDirectory.$source;
|
||||
// If the file doesn't exist, it may be shared with the current user
|
||||
} else {
|
||||
$source = OC_Share::getSource($userDirectory.$source);
|
||||
if (!$source) {
|
||||
echo "false";
|
||||
}
|
||||
} else if (!$source = OC_Share::getSource($userDirectory.$source)) {
|
||||
echo "false";
|
||||
}
|
||||
try {
|
||||
$shared = new OC_Share($source, $uid_shared_with, $permissions);
|
||||
|
|
|
@ -176,7 +176,14 @@ class OC_Share {
|
|||
public static function getMySharedItem($source) {
|
||||
$source = self::cleanPath($source);
|
||||
$query = OC_DB::prepare("SELECT uid_shared_with, permissions FROM *PREFIX*sharing WHERE source = ? AND uid_owner = ?");
|
||||
return $query->execute(array($source, OC_User::getUser()))->fetchAll();
|
||||
$result = $query->execute(array($source, OC_User::getUser()))->fetchAll();
|
||||
if (count($result) > 0) {
|
||||
return $result;
|
||||
} else if ($originalSource = self::getSource($source)) {
|
||||
return $query->execute(array($originalSource, OC_User::getUser()))->fetchAll();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue