-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28209 from owncloud/stable10-improved-fed-user-se…
…arch [Stable10] improved fed user search
- Loading branch information
Showing
9 changed files
with
149 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1233,6 +1233,34 @@ public function dataGetRemote() { | |
] | ||
] | ||
], | ||
// #16 check email property is matched for remote users | ||
[ | ||
'[email protected]', | ||
[ | ||
[ | ||
'FN' => 'User3 @ Localhost', | ||
], | ||
[ | ||
'FN' => 'User2 @ Localhost', | ||
'CLOUD' => [ | ||
], | ||
], | ||
[ | ||
'FN' => 'User @ Localhost', | ||
'CLOUD' => [ | ||
'username@localhost', | ||
], | ||
'EMAIL' => '[email protected]' | ||
], | ||
], | ||
true, | ||
[ | ||
['label' => 'User @ Localhost', 'value' => ['shareType' => Share::SHARE_TYPE_REMOTE, 'shareWith' => 'username@localhost', 'server' => 'localhost']], | ||
['label' => '[email protected]', 'value' => ['shareType' => Share::SHARE_TYPE_REMOTE, 'shareWith' => '[email protected]']] | ||
], | ||
[], | ||
true, | ||
], | ||
]; | ||
} | ||
|
||
|
@@ -1248,6 +1276,11 @@ public function dataGetRemote() { | |
* @param array $previousExact | ||
*/ | ||
public function testGetRemote($searchTerm, $contacts, $shareeEnumeration, $exactExpected, $expected, $reachedEnd, $previousExact = []) { | ||
|
||
// Set the limit and offset for remote user searching | ||
$this->invokePrivate($this->sharees, 'limit', [2]); | ||
$this->invokePrivate($this->sharees, 'offset', [0]); | ||
|
||
$this->config->expects($this->any()) | ||
->method('getSystemValue') | ||
->with('trusted_domains') | ||
|
@@ -1259,10 +1292,15 @@ public function testGetRemote($searchTerm, $contacts, $shareeEnumeration, $exact | |
$this->invokePrivate($this->sharees, 'result', [$result]); | ||
} | ||
|
||
$this->config->expects($this->once()) | ||
->method('getAppValue') | ||
->with('dav', 'remote_search_properties') | ||
->willReturn('EMAIL,CLOUD,FN'); | ||
|
||
$this->invokePrivate($this->sharees, 'shareeEnumeration', [$shareeEnumeration]); | ||
$this->contactsManager->expects($this->any()) | ||
->method('search') | ||
->with($searchTerm, ['CLOUD', 'FN']) | ||
->with($searchTerm, ['EMAIL', 'CLOUD', 'FN'], [], 2, 0) | ||
->willReturn($contacts); | ||
|
||
$this->invokePrivate($this->sharees, 'getRemote', [$searchTerm]); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,10 +55,12 @@ public function getDisplayName(); | |
* @param string $pattern which should match within the $searchProperties | ||
* @param array $searchProperties defines the properties within the query pattern should match | ||
* @param array $options - for future use. One should always have options! | ||
* @param int $limit | ||
* @param int $offset | ||
* @return array an array of contacts which are arrays of key-value-pairs | ||
* @since 5.0.0 | ||
*/ | ||
public function search($pattern, $searchProperties, $options); | ||
public function search($pattern, $searchProperties, $options, $limit = null, $offset = null); | ||
// // dummy results | ||
// return array( | ||
// array('id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => '[email protected]', 'GEO' => '37.386013;-122.082932'), | ||
|