Show federation and email results also with exact user match unless containing @
Before when you have a user "smith" and a federated user "smith@example.com" you could see the federation result with "smit" but not with "smith" anymore. With most LDAP configurations and local backend setups this is disturbing and causes issues. The idea of not showing the email and federation on a matching user was with: Local user registered with "smith@example.com" user id and having that same email / cloud id in your contacts addressbook. So we now only hide those "side results" when the search does contain an @ Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
0d4ea5fc63
commit
679aa21075
|
@ -90,9 +90,10 @@ class Search implements ISearch {
|
||||||
$searchResult->unsetResult($emailType);
|
$searchResult->unsetResult($emailType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we have an exact local user match, there is no need to show the remote and email matches
|
// if we have an exact local user match with an email-a-like query,
|
||||||
|
// there is no need to show the remote and email matches.
|
||||||
$userType = new SearchResultType('users');
|
$userType = new SearchResultType('users');
|
||||||
if ($searchResult->hasExactIdMatch($userType)) {
|
if (strpos($search, '@') !== false && $searchResult->hasExactIdMatch($userType)) {
|
||||||
$searchResult->unsetResult($remoteType);
|
$searchResult->unsetResult($remoteType);
|
||||||
$searchResult->unsetResult($emailType);
|
$searchResult->unsetResult($emailType);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue