summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-09-21 11:17:46 +0000
committerthomascube <thomas@roundcube.net>2011-09-21 11:17:46 +0000
commit2d3e2bc56108fc014edfaa154237b551daea4cc0 (patch)
tree26430c969e5879944c3fc92609cd6d0ff3e41174 /program/include
parentc054ec5c7a859aa15243f0b1cbd3e84239ed4023 (diff)
Add option 'searchonly' for address books; currently used by LDAP directories
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_addressbook.php1
-rw-r--r--program/include/rcube_ldap.php9
-rw-r--r--program/include/rcube_result_set.php3
3 files changed, 12 insertions, 1 deletions
diff --git a/program/include/rcube_addressbook.php b/program/include/rcube_addressbook.php
index 6d126e9e3..94a715bae 100644
--- a/program/include/rcube_addressbook.php
+++ b/program/include/rcube_addressbook.php
@@ -38,6 +38,7 @@ abstract class rcube_addressbook
public $primary_key;
public $groups = false;
public $readonly = true;
+ public $searchonly = false;
public $undelete = false;
public $ready = false;
public $group_id = null;
diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index c6ca88e5e..13e7b5448 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -71,6 +71,9 @@ class rcube_ldap extends rcube_addressbook
function __construct($p, $debug=false, $mail_domain=NULL)
{
$this->prop = $p;
+
+ if (isset($p['searchonly']))
+ $this->searchonly = $p['searchonly'];
// check if groups are configured
if (is_array($p['groups']) && count($p['groups'])) {
@@ -429,6 +432,12 @@ class rcube_ldap extends rcube_addressbook
*/
function list_records($cols=null, $subset=0)
{
+ if ($this->prop['searchonly'] && empty($this->filter) && !$this->group_id) {
+ $this->result = new rcube_result_set(0);
+ $this->result->searchonly = true;
+ return $this->result;
+ }
+
// add general filter to query
if (!empty($this->prop['filter']) && empty($this->filter))
{
diff --git a/program/include/rcube_result_set.php b/program/include/rcube_result_set.php
index 10361609f..db52fc55b 100644
--- a/program/include/rcube_result_set.php
+++ b/program/include/rcube_result_set.php
@@ -5,7 +5,7 @@
| program/include/rcube_result_set.php |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2006-2010, The Roundcube Dev Team |
+ | Copyright (C) 2006-2011, The Roundcube Dev Team |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
@@ -31,6 +31,7 @@ class rcube_result_set
var $count = 0;
var $first = 0;
var $current = 0;
+ var $searchonly = false;
var $records = array();