Clean up the logic of the contacts store a bit
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
5fa52d492a
commit
62ef45028e
|
@ -165,21 +165,21 @@ class ContactsStore implements IContactsStore {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$filterUser = true;
|
$filterOutUser = true;
|
||||||
|
|
||||||
$mailAddresses = $entry->getEMailAddresses();
|
$mailAddresses = $entry->getEMailAddresses();
|
||||||
foreach ($mailAddresses as $mailAddress) {
|
foreach ($mailAddresses as $mailAddress) {
|
||||||
if ($mailAddress === $filter) {
|
if ($mailAddress === $filter) {
|
||||||
$filterUser = false;
|
$filterOutUser = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($entry->getProperty('UID') && $entry->getProperty('UID') === $filter) {
|
if ($entry->getProperty('UID') && $entry->getProperty('UID') === $filter) {
|
||||||
$filterUser = false;
|
$filterOutUser = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($filterUser) {
|
if ($filterOutUser) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} elseif ($restrictEnumerationPhone || $restrictEnumerationGroup) {
|
} elseif ($restrictEnumerationPhone || $restrictEnumerationGroup) {
|
||||||
|
@ -208,7 +208,7 @@ class ContactsStore implements IContactsStore {
|
||||||
if ($ownGroupsOnly && !$checkedCommonGroupAlready) {
|
if ($ownGroupsOnly && !$checkedCommonGroupAlready) {
|
||||||
$user = $this->userManager->get($entry->getProperty('UID'));
|
$user = $this->userManager->get($entry->getProperty('UID'));
|
||||||
|
|
||||||
if ($user === null) {
|
if (!$user instanceof IUser) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue