aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/ContactsManager.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/ContactsManager.php')
-rw-r--r--lib/private/ContactsManager.php20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/private/ContactsManager.php b/lib/private/ContactsManager.php
index f67cb196eef..87b341ac36b 100644
--- a/lib/private/ContactsManager.php
+++ b/lib/private/ContactsManager.php
@@ -10,6 +10,7 @@ namespace OC;
use OCP\Constants;
use OCP\Contacts\IManager;
use OCP\IAddressBook;
+use OCP\IAddressBookEnabled;
class ContactsManager implements IManager {
/**
@@ -19,14 +20,14 @@ class ContactsManager implements IManager {
* @param string $pattern which should match within the $searchProperties
* @param array $searchProperties defines the properties within the query pattern should match
* @param array $options = array() to define the search behavior
- * - 'types' boolean (since 15.0.0) If set to true, fields that come with a TYPE property will be an array
- * example: ['id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => ['type => 'HOME', 'value' => 'g@h.i']]
- * - 'escape_like_param' - If set to false wildcards _ and % are not escaped
- * - 'limit' - Set a numeric limit for the search results
- * - 'offset' - Set the offset for the limited search results
- * - 'enumeration' - (since 23.0.0) Whether user enumeration on system address book is allowed
- * - 'fullmatch' - (since 23.0.0) Whether matching on full detail in system address book is allowed
- * - 'strict_search' - (since 23.0.0) Whether the search pattern is full string or partial search
+ * - 'types' boolean (since 15.0.0) If set to true, fields that come with a TYPE property will be an array
+ * example: ['id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => ['type => 'HOME', 'value' => 'g@h.i']]
+ * - 'escape_like_param' - If set to false wildcards _ and % are not escaped
+ * - 'limit' - Set a numeric limit for the search results
+ * - 'offset' - Set the offset for the limited search results
+ * - 'enumeration' - (since 23.0.0) Whether user enumeration on system address book is allowed
+ * - 'fullmatch' - (since 23.0.0) Whether matching on full detail in system address book is allowed
+ * - 'strict_search' - (since 23.0.0) Whether the search pattern is full string or partial search
* @psalm-param array{types?: bool, escape_like_param?: bool, limit?: int, offset?: int, enumeration?: bool, fullmatch?: bool, strict_search?: bool} $options
* @return array an array of contacts which are arrays of key-value-pairs
*/
@@ -34,6 +35,9 @@ class ContactsManager implements IManager {
$this->loadAddressBooks();
$result = [];
foreach ($this->addressBooks as $addressBook) {
+ if ($addressBook instanceof IAddressBookEnabled && !$addressBook->isEnabled()) {
+ continue;
+ }
$searchOptions = $options;
$strictSearch = array_key_exists('strict_search', $options) && $options['strict_search'] === true;