X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=program%2Finclude%2Frcube_ldap.php;fp=program%2Finclude%2Frcube_ldap.php;h=c592fae89fc0aff10956762c3ce850260487efa3;hb=7033aedb93d429abdeccf3bceb7152b5f91dc104;hp=6bef779859af86fed1ada4777d2661ce36169d4c;hpb=a6cc1ac49674e1902dbb9a2c34f22408471bc4d3;p=roundcube.git diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php index 6bef779..c592fae 100644 --- a/program/include/rcube_ldap.php +++ b/program/include/rcube_ldap.php @@ -17,7 +17,7 @@ | Aleksander Machniak | +-----------------------------------------------------------------------+ - $Id: rcube_ldap.php 5736 2012-01-06 15:57:33Z thomasb $ + $Id: rcube_ldap.php 5879 2012-02-15 08:29:33Z thomasb $ */ @@ -35,8 +35,6 @@ class rcube_ldap extends rcube_addressbook public $readonly = true; public $ready = false; public $group_id = 0; - public $list_page = 1; - public $page_size = 10; public $coltypes = array(); /** private properties */ @@ -47,7 +45,6 @@ class rcube_ldap extends rcube_addressbook protected $filter = ''; protected $result = null; protected $ldap_result = null; - protected $sort_col = ''; protected $mail_domain = ''; protected $debug = false; @@ -413,24 +410,15 @@ class rcube_ldap extends rcube_addressbook /** - * Set internal list page + * Set internal sort settings * - * @param number $page Page number to list + * @param string $sort_col Sort column + * @param string $sort_order Sort order */ - function set_page($page) + function set_sort_order($sort_col, $sort_order = null) { - $this->list_page = (int)$page; - } - - - /** - * Set internal page size - * - * @param number $size Number of messages to display on one page - */ - function set_pagesize($size) - { - $this->page_size = (int)$size; + if ($this->fieldmap[$sort_col]) + $this->sort_col = $this->fieldmap[$sort_col]; } @@ -618,6 +606,9 @@ class rcube_ldap extends rcube_addressbook for ($i=0; $i < $entry[$attr]['count']; $i++) { + if (empty($entry[$attr][$i])) + continue; + $result = @ldap_read($this->conn, $entry[$attr][$i], '(objectclass=*)', $attrib, 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit']); @@ -1234,9 +1225,9 @@ class rcube_ldap extends rcube_addressbook $attrs, 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit']) ) { $entries_count = ldap_count_entries($this->conn, $this->ldap_result); - $this->_debug("S: $count_entries record(s)"); + $this->_debug("S: $entries_count record(s)"); - return $count ? $count_entries : true; + return $count ? $entries_count : true; } else { $this->_debug("S: ".ldap_error($this->conn));