Skip to content

Commit

Permalink
Fix listing address books without __owner fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jan 22, 2016
1 parent d4d5ff4 commit b7d1be9
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions turba/lib/Driver.php
Expand Up @@ -626,16 +626,18 @@ public function search(array $search_criteria, $sort_order = null,

/* If we are not using Horde_Share, enforce the requirement that the
* current user must be the owner of the addressbook. */
$fields = array(
'AND' => array(
$fields,
array(
'field' => $this->toDriver('__owner'),
'op' => '=',
'test' => $this->getContactOwner()
if (isset($this->map['__owner'])) {
$fields = array(
'AND' => array(
$fields,
array(
'field' => $this->toDriver('__owner'),
'op' => '=',
'test' => $this->getContactOwner()
)
)
)
);
);
}

if (in_array('email', $return_fields) &&
!in_array('emails', $return_fields)) {
Expand Down

0 comments on commit b7d1be9

Please sign in to comment.