mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
fix(lookup-server): do not query data by default
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
178b5d7910
commit
37166f149e
6 changed files with 12 additions and 15 deletions
|
|
@ -1065,8 +1065,8 @@ class FederatedShareProvider implements IShareProvider {
|
|||
if ($this->gsConfig->isGlobalScaleEnabled()) {
|
||||
return true;
|
||||
}
|
||||
$result = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'yes');
|
||||
return ($result === 'yes');
|
||||
$result = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'no');
|
||||
return $result === 'yes';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -845,7 +845,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
|
|||
$this->gsConfig->expects($this->once())->method('isGlobalScaleEnabled')
|
||||
->willReturn($gsEnabled);
|
||||
$this->config->expects($this->any())->method('getAppValue')
|
||||
->with('files_sharing', 'lookupServerEnabled', 'yes')
|
||||
->with('files_sharing', 'lookupServerEnabled', 'no')
|
||||
->willReturn($isEnabled);
|
||||
|
||||
$this->assertSame($expected,
|
||||
|
|
|
|||
|
|
@ -218,12 +218,9 @@ class ShareesAPIController extends OCSController {
|
|||
$this->offset = $perPage * ($page - 1);
|
||||
|
||||
// In global scale mode we always search the loogup server
|
||||
if ($this->config->getSystemValueBool('gs.enabled', false)) {
|
||||
$lookup = true;
|
||||
$this->result['lookupEnabled'] = true;
|
||||
} else {
|
||||
$this->result['lookupEnabled'] = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'yes') === 'yes';
|
||||
}
|
||||
$lookup = $this->config->getSystemValueBool('gs.enabled', false)
|
||||
|| $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'no') === 'yes';
|
||||
$this->result['lookupEnabled'] = $lookup;
|
||||
|
||||
[$result, $hasMoreResults] = $this->collaboratorSearch->search($search, $shareTypes, $lookup, $this->limit, $this->offset);
|
||||
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ class ShareesAPIControllerTest extends TestCase {
|
|||
->method('getAppValue')
|
||||
->with($this->anything(), $this->anything(), $this->anything())
|
||||
->willReturnMap([
|
||||
['files_sharing', 'lookupServerEnabled', 'yes', 'yes'],
|
||||
['files_sharing', 'lookupServerEnabled', 'no', 'yes'],
|
||||
]);
|
||||
|
||||
$this->shareManager->expects($this->once())
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class LookupPlugin implements ISearchPlugin {
|
|||
|
||||
public function search($search, $limit, $offset, ISearchResult $searchResult) {
|
||||
$isGlobalScaleEnabled = $this->config->getSystemValue('gs.enabled', false);
|
||||
$isLookupServerEnabled = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'yes') === 'yes';
|
||||
$isLookupServerEnabled = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'no') === 'yes';
|
||||
$hasInternetConnection = $this->config->getSystemValueBool('has_internet_connection', true);
|
||||
|
||||
// if case of Global Scale we always search the lookup server
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class LookupPluginTest extends TestCase {
|
|||
public function testSearchNoLookupServerURI() {
|
||||
$this->config->expects($this->once())
|
||||
->method('getAppValue')
|
||||
->with('files_sharing', 'lookupServerEnabled', 'yes')
|
||||
->with('files_sharing', 'lookupServerEnabled', 'no')
|
||||
->willReturn('yes');
|
||||
$this->config->expects($this->at(0))
|
||||
->method('getSystemValue')
|
||||
|
|
@ -118,7 +118,7 @@ class LookupPluginTest extends TestCase {
|
|||
public function testSearchNoInternet() {
|
||||
$this->config->expects($this->once())
|
||||
->method('getAppValue')
|
||||
->with('files_sharing', 'lookupServerEnabled', 'yes')
|
||||
->with('files_sharing', 'lookupServerEnabled', 'no')
|
||||
->willReturn('yes');
|
||||
$this->config->expects($this->at(0))
|
||||
->method('getSystemValue')
|
||||
|
|
@ -154,7 +154,7 @@ class LookupPluginTest extends TestCase {
|
|||
|
||||
$this->config->expects($this->once())
|
||||
->method('getAppValue')
|
||||
->with('files_sharing', 'lookupServerEnabled', 'yes')
|
||||
->with('files_sharing', 'lookupServerEnabled', 'no')
|
||||
->willReturn('yes');
|
||||
$this->config->expects($this->at(0))
|
||||
->method('getSystemValue')
|
||||
|
|
@ -213,7 +213,7 @@ class LookupPluginTest extends TestCase {
|
|||
|
||||
$this->config->expects($this->once())
|
||||
->method('getAppValue')
|
||||
->with('files_sharing', 'lookupServerEnabled', 'yes')
|
||||
->with('files_sharing', 'lookupServerEnabled', 'no')
|
||||
->willReturn($LookupEnabled ? 'yes' : 'no');
|
||||
$this->config->expects($this->at(0))
|
||||
->method('getSystemValue')
|
||||
|
|
|
|||
Loading…
Reference in a new issue