diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-09-11 08:15:10 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-09-11 08:15:10 +0000 |
| commit | c3b57fa60dff4ac103e44816ee4ca53b3b4091d0 (patch) | |
| tree | 4f803e713747a3cd1c1ee17fd7898f2eb8e370d5 /roundcubemail/program | |
| parent | 36592c385f2ac95d3a022a52bc6d0c36221f0aa8 (diff) | |
- small code improvements per discussion from #1485536
git-svn-id: https://svn.roundcube.net/trunk@2942 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rw-r--r-- | roundcubemail/program/include/rcube_ldap.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/roundcubemail/program/include/rcube_ldap.php b/roundcubemail/program/include/rcube_ldap.php index 82e1df270..b72ef80aa 100644 --- a/roundcubemail/program/include/rcube_ldap.php +++ b/roundcubemail/program/include/rcube_ldap.php @@ -343,7 +343,7 @@ class rcube_ldap extends rcube_addressbook * * @return object rcube_result_set Resultset with values for 'count' and 'first' */ - function count() + function count($check) { $count = 0; if ($this->conn && $this->ldap_result) { @@ -388,8 +388,8 @@ class rcube_ldap extends rcube_addressbook $res = null; if ($this->conn && $dn) { - $this->ldap_result = @ldap_read($this->conn, base64_decode($dn), '(objectclass=*)', array_values($this->fieldmap)); - $entry = @ldap_first_entry($this->conn, $this->ldap_result); + if ($this->ldap_result = @ldap_read($this->conn, base64_decode($dn), '(objectclass=*)', array_values($this->fieldmap))) + $entry = ldap_first_entry($this->conn, $this->ldap_result); if ($entry && ($rec = ldap_get_attributes($this->conn, $entry))) { @@ -565,11 +565,12 @@ class rcube_ldap extends rcube_addressbook { $filter = $this->filter ? $this->filter : '(objectclass=*)'; $function = $this->prop['scope'] == 'sub' ? 'ldap_search' : ($this->prop['scope'] == 'base' ? 'ldap_read' : 'ldap_list'); - $this->ldap_result = @$function($this->conn, $this->prop['base_dn'], $filter, array_values($this->fieldmap), 0, 0); - return true; + + if ($this->ldap_result = @$function($this->conn, $this->prop['base_dn'], $filter, array_values($this->fieldmap), 0, 0)) + return true; } - else - return false; + + return false; } |
