Skip to content
Open
2 changes: 2 additions & 0 deletions apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ public function testGetQuotaInfoUnlimited(): void {
->willReturnMap([
['\OCA\Files_Sharing\SharedStorage', false],
['\OC\Files\Storage\Wrapper\Quota', false],
[\OCA\Files_Sharing\External\Storage::class, false],
]);

$storage->expects($this->once())
Expand Down Expand Up @@ -341,6 +342,7 @@ public function testGetQuotaInfoSpecific(): void {
->willReturnMap([
['\OCA\Files_Sharing\SharedStorage', false],
['\OC\Files\Storage\Wrapper\Quota', true],
[\OCA\Files_Sharing\External\Storage::class, false],
]);

$storage->expects($this->once())
Expand Down
1 change: 1 addition & 0 deletions apps/files/src/actions/moveOrCopyAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ async function openFilePickerForAction(
// We don't want to show the current nodes in the file picker
return !fileIDs.includes(n.fileid)
})
.setFilter((n: Node) => (n.permissions & Permission.CREATE) === Permission.CREATE)
.setMimeTypeFilter([])
.setMultiSelect(false)
.startAt(dir)
Expand Down
5 changes: 4 additions & 1 deletion apps/files_sharing/lib/Command/ExiprationNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
namespace OCA\Files_Sharing\Command;

use OCA\Files_Sharing\OrphanHelper;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IDBConnection;
use OCP\Notification\IManager as NotificationManager;
Expand All @@ -23,6 +24,7 @@ public function __construct(
private NotificationManager $notificationManager,
private IDBConnection $connection,
private ShareManager $shareManager,
private OrphanHelper $orphanHelper,
) {
parent::__construct();
}
Expand Down Expand Up @@ -50,7 +52,8 @@ public function execute(InputInterface $input, OutputInterface $output): int {
foreach ($shares as $share) {
if ($share->getExpirationDate() === null
|| $share->getExpirationDate()->getTimestamp() < $minTime->getTimestamp()
|| $share->getExpirationDate()->getTimestamp() > $maxTime->getTimestamp()) {
|| $share->getExpirationDate()->getTimestamp() > $maxTime->getTimestamp()
|| !$this->orphanHelper->isShareValid($share->getSharedBy(), $share->getNodeId())) {
continue;
}

Expand Down
11 changes: 9 additions & 2 deletions lib/private/legacy/OC_Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,16 @@ public static function getStorageInfo($path, $rootInfo = null, $includeMountPoin
$relative = 0;
}

/*
* \OCA\Files_Sharing\External\Storage returns the cloud ID as the owner for the storage.
* It is unnecessary to query the user manager for the display name, as it won't have this information.
*/
$isRemoteShare = $storage->instanceOfStorage(\OCA\Files_Sharing\External\Storage::class);

$ownerId = $storage->getOwner($path);
$ownerDisplayName = '';
if ($ownerId !== false) {

if ($isRemoteShare === false && $ownerId !== false) {
$ownerDisplayName = \OC::$server->getUserManager()->getDisplayName($ownerId) ?? '';
}

Expand All @@ -565,7 +572,7 @@ public static function getStorageInfo($path, $rootInfo = null, $includeMountPoin
'mountPoint' => trim($mountPoint, '/'),
];

if ($ownerId && $path === '/') {
if ($isRemoteShare === false && $ownerId !== false && $path === '/') {
// If path is root, store this as last known quota usage for this user
\OCP\Server::get(\OCP\IConfig::class)->setUserValue($ownerId, 'files', 'lastSeenQuotaUsage', (string)$relative);
}
Expand Down