Skip to content

Commit

Permalink
Merge back 10.12.0 (owncloud#40682)
Browse files Browse the repository at this point in the history
* prepare 10.12

* update translations

* Allow stream wrappers not to provide the underlying stream (owncloud#40659)

This is mainly for streams that don't wrap another one, or use
a stream not provided by the native fopen function such as
smbclient_open

* Fix issue if no version has been created yet (owncloud#40661)

* fix link in changelog.

* Revert .htaccess change

* OCM via ScienceMesh

Signed-off-by: Michiel de Jong <[email protected]>

* Get plugin from \OC::$server->query()

* Improve changelog entry

Signed-off-by: Michiel de Jong <[email protected]>

* improve changelog entry

Signed-off-by: Michiel de Jong <[email protected]>

* Whitespace change to re-trigger CI

Signed-off-by: Michiel de Jong <[email protected]>

* Upgrading phpseclib/phpseclib (3.0.18 => 3.0.19)

* changelog for phpseclib 3.0.19

* Add test for the new feature

* revert logic to expose free_space, but keep availableStorage config

* Make sender display name in mail notifications configurable (owncloud#40671)

* [tx] updated from transifex

* [tx] updated from transifex

* make getFrom configurable

* fix style

* Adjust unit tests for MailNotificationsTest

* add changelog

* Document remove_sender_display_name system setting

* Add unit test cases for when remove_sender_display_name is set to true

---------

Co-authored-by: ownClouders <[email protected]>
Co-authored-by: Phil Davis <[email protected]>

* removing double to

* prepare 10.12.0 RC3

* Bump final 10.12.0 version in version.php

---------

Signed-off-by: Michiel de Jong <[email protected]>
Co-authored-by: Juergen Weigert <[email protected]>
Co-authored-by: Juan Pablo Villafañez <[email protected]>
Co-authored-by: Michiel de Jong <[email protected]>
Co-authored-by: Piotr Mrówczyński <[email protected]>
Co-authored-by: Pasquale Tripodi <[email protected]>
Co-authored-by: ownClouders <[email protected]>
Co-authored-by: EParzefall <[email protected]>
  • Loading branch information
8 people authored Mar 13, 2023
1 parent a549cc1 commit 0d817c8
Show file tree
Hide file tree
Showing 61 changed files with 7,912 additions and 7,730 deletions.
15,278 changes: 7,639 additions & 7,639 deletions CHANGELOG.md

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions apps/files_sharing/lib/Controller/ShareesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\Share;
use OCA\Files_Sharing\AppInfo\Application;
use OCA\Files_Sharing\SharingBlacklist;
use OCP\Util\UserSearch;

Expand Down Expand Up @@ -381,6 +382,16 @@ protected function getGroups($search) {
* @return void
*/
protected function getRemote($search) {
$pluginClass = $this->config->getSystemValue('sharing.remoteShareesSearch');
if ($pluginClass !== '') {
$this->result['remotes'] = [];
/** @var \OCP\Share\IRemoteShareesSearch $plugin */
$plugin = \OC::$server->query($pluginClass);
$result = $plugin->search($search);
$this->result['exact']['remotes'] = $result;
$this->reachedEndFor[] = 'remotes';
return;
}
$this->result['remotes'] = [];
// Fetch remote search properties from app config
/**
Expand Down
49 changes: 48 additions & 1 deletion apps/files_sharing/tests/API/ShareesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
use OCP\Share;
use OCP\User;
use OCP\Util\UserSearch;
use OCP\Share\IRemoteShareesSearch;

/**
* Class ShareesTest
Expand Down Expand Up @@ -82,6 +83,9 @@ class ShareesTest extends TestCase {
/** @var UserSearch|\PHPUnit\Framework\MockObject\MockObject */
protected $userSearch;

/** @var IRemoteShareesSearch */
protected $customRemoteSearchMock;

protected function setUp(): void {
parent::setUp();

Expand Down Expand Up @@ -121,6 +125,8 @@ protected function setUp(): void {
->disableOriginalConstructor()
->getMock();

$this->customRemoteSearchMock = $this->createMock(IRemoteShareesSearch::class);

$this->sharees = new ShareesController(
'files_sharing',
$this->request,
Expand All @@ -137,6 +143,15 @@ protected function setUp(): void {
);
}

protected function tearDown(): void {
// needed for the testGetRemoteCustom
if (isset(\OC::$server[\get_class($this->customRemoteSearchMock)])) {
unset(\OC::$server[\get_class($this->customRemoteSearchMock)]);
}

parent::tearDown();
}

/**
* @param string $uid
* @param string $displayName
Expand Down Expand Up @@ -1513,7 +1528,8 @@ public function testGetRemote($searchTerm, $contacts, $shareeEnumeration, $exact

$configMap = [
['trusted_domains', [], ['trusted.domain.tld', 'trusted2.domain.tld']],
['accounts.enable_medial_search', true, true]
['accounts.enable_medial_search', true, true],
['sharing.remoteShareesSearch', '', '']
];

$this->config->expects($this->any())
Expand Down Expand Up @@ -1548,6 +1564,37 @@ public function testGetRemote($searchTerm, $contacts, $shareeEnumeration, $exact
$this->assertCount((int) $reachedEnd, $this->invokePrivate($this->sharees, 'reachedEndFor'));
}

public function testGetRemoteCustom() {
$mockedRemoteClass = \get_class($this->customRemoteSearchMock);

// need to register the mock as service. It will be removed in the tearDown
\OC::$server->registerService($mockedRemoteClass, function () {
return $this->customRemoteSearchMock;
});

$this->config->method('getSystemValue')
->with('sharing.remoteShareesSearch')
->willReturn($mockedRemoteClass);

$this->customRemoteSearchMock->expects($this->once())
->method('search')
->with('abcd1234')
->willReturn([
['label' => 'a label for u1', 'value' => ['shareType' => 7, 'shareWith' => 'u1']],
['label' => 'u2 label', 'value' => ['shareType' => 8, 'shareWith' => 'u2', 'server' => 'https://custom.server']],
]);

$exactExpected = [
['label' => 'a label for u1', 'value' => ['shareType' => 7, 'shareWith' => 'u1']],
['label' => 'u2 label', 'value' => ['shareType' => 8, 'shareWith' => 'u2', 'server' => 'https://custom.server']],
];

$this->invokePrivate($this->sharees, 'getRemote', ['abcd1234']);
$result = $this->invokePrivate($this->sharees, 'result');

$this->assertEquals($exactExpected, $result['exact']['remotes']);
}

public function dataSearch() {
$allTypes = [Share::SHARE_TYPE_USER, Share::SHARE_TYPE_GROUP, Share::SHARE_TYPE_REMOTE];

Expand Down
14 changes: 13 additions & 1 deletion apps/files_versions/lib/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,20 @@ protected static function isPublishedVersion($view, $path) {
* Folders such as "." and ".." will be ignored, so if the
* directory only contains those ones, it will be considered
* as empty.
* The view's root folder won't be considered as empty even if it
* doesn't contain any file, so this function will always
* return false in that case.
* This function will return false if the directory can't be opened
* @param View $view
* @param string $dir the directory inside the view
* @return bool true if empty, false otherwise
*/
private static function isFolderEmpty($view, $dir) {
if ($dir === '' || $dir === '.' || $dir === '/') {
// root folder won't be considered as empty
return false;
}

$isEmpty = false;
$dirResource = $view->opendir($dir);

Expand Down Expand Up @@ -344,8 +352,12 @@ private static function isFolderEmpty($view, $dir) {
private static function cleanupEmptyVersionFolder($view, $path) {
// check if folder is empty in order to delete it too
$parentPath = \dirname($path);
while (!$view->file_exists($parentPath) && ($parentPath !== '.' && $parentPath !== '/' && $parentPath !== '')) {
$parentPath = \dirname($parentPath);
}

$isEmpty = self::isFolderEmpty($view, $parentPath);
while ($isEmpty && ($parentPath !== '.' && $parentPath !== '/')) {
while ($isEmpty && ($parentPath !== '.' && $parentPath !== '/' && $parentPath !== '')) {
$view->rmdir($parentPath);

$parentPath = \dirname($parentPath);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions changelog/10.12.0_2023-02-24/40389
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Change: Allow specifying available space for objectstorages

Objectstorages are reporting only unknown storage space. This causes problems in other apps that rely on this storage method, e.g. metrics app that monitors available space. Now, new configuration in the storage level is added, allowing for using the system configuration variable by the apps or further extension of storage class for objectstorage.

https://github.com/owncloud/core/pull/40389
https://github.com/owncloud/core/pull/40669
https://github.com/owncloud/core/issues/40665
https://github.com/owncloud/enterprise/issues/5384
https://github.com/owncloud/enterprise/issues/5006
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions changelog/10.12.0_2023-02-24/40577
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Enhancement: Add support for OCM via ScienceMesh


We've added an if-statement in the files_sharing ShareesController
code that searches for remote sharees. When the config entry
`sharing.remoteShareesSearch` is set to the name of a class
that is registered in the server container and that implements
`IRemoteShareesSearch`, for instance the 'ScienceMeshSearchPlugin'
that the 'sciencemesh' app registers, use it instead of the
federatedfilesharing app to find sharee matches for OCM sharing.

https://github.com/owncloud/core/issues/40577
https://github.com/pondersource/oc-sciencemesh/pull/39
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions changelog/10.12.0_2023-02-24/40671
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Make sender display name in mail notifications configurable

In some cases mail notifications related to sharing activities are blocked by mail filters as they are flagged as email impersonation. In such cases it may be desirable for an oC admin to have a config option for removing the sender display name from the "From" address. This is now possible by setting the following config.php parameter:

remove_sender_display_name => true

https://github.com/owncloud/core/pull/40671
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The following have been updated:
- laminas/laminas-stdlib (3.11.0 to 3.13.0)
- laminas/laminas-validator (2.19.0 to 2.25.0)
- league/flysystem (1.1.9 to 1.1.10)
- phpseclib/phpseclib (3.0.18 tp 3.0.19)
- psr/container (1.1.1 to 1.1.2)
- punic/punic (3.7.0 to 3.8.0)
- sabre/uri (2.2.3 to 2.3.2)
Expand All @@ -36,3 +37,4 @@ https://github.com/owncloud/core/pull/40543
https://github.com/owncloud/core/pull/40554
https://github.com/owncloud/core/pull/40568
https://github.com/owncloud/core/pull/40591
https://github.com/owncloud/core/pull/40668
File renamed without changes.
6 changes: 0 additions & 6 deletions changelog/unreleased/40389

This file was deleted.

Loading

0 comments on commit 0d817c8

Please sign in to comment.