mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 10:10:49 -04:00
Merge pull request #18337 from nextcloud/backport/18189/stable17
[stable17] Sharee API GS fixes
This commit is contained in:
commit
624302d99a
5 changed files with 23 additions and 3 deletions
|
|
@ -104,6 +104,11 @@ class Capabilities implements ICapability {
|
|||
'expire_date' => ['enabled' => true]
|
||||
];
|
||||
|
||||
// Sharee searches
|
||||
$res['sharee'] = [
|
||||
'query_lookup_default' => $this->config->getSystemValueBool('gs.enabled', false)
|
||||
];
|
||||
|
||||
return [
|
||||
'files_sharing' => $res,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -206,6 +206,14 @@ class ShareesAPIController extends OCSController {
|
|||
$this->limit = (int) $perPage;
|
||||
$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';
|
||||
}
|
||||
|
||||
list($result, $hasMoreResults) = $this->collaboratorSearch->search($search, $shareTypes, $lookup, $this->limit, $this->offset);
|
||||
|
||||
// extra treatment for 'exact' subarray, with a single merge expected keys might be lost
|
||||
|
|
@ -213,7 +221,6 @@ class ShareesAPIController extends OCSController {
|
|||
$result['exact'] = array_merge($this->result['exact'], $result['exact']);
|
||||
}
|
||||
$this->result = array_merge($this->result, $result);
|
||||
$this->result['lookupEnabled'] = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'yes') === 'yes';
|
||||
$response = new DataResponse($this->result);
|
||||
|
||||
if ($hasMoreResults) {
|
||||
|
|
|
|||
2
core/js/dist/share_backend.js
vendored
2
core/js/dist/share_backend.js
vendored
File diff suppressed because one or more lines are too long
2
core/js/dist/share_backend.js.map
vendored
2
core/js/dist/share_backend.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -145,6 +145,14 @@
|
|||
var deferred = $.Deferred();
|
||||
var view = this;
|
||||
|
||||
// query lookup GS by default if enabled
|
||||
var capabilities = OC.getCapabilities()
|
||||
if (capabilities.files_sharing
|
||||
&& capabilities.files_sharing.sharee
|
||||
&& capabilities.files_sharing.sharee.query_lookup_default) {
|
||||
this._lookup = true;
|
||||
}
|
||||
|
||||
$.get(
|
||||
OC.linkToOCS('apps/files_sharing/api/v1') + 'sharees',
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue