summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_ldap.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-08-18 17:21:03 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-08-18 17:21:03 +0200
commit028734b25cfa2ee30a129710db0440617f9f3095 (patch)
tree28a6f364c2d1172a4fae19526fd379870a51a120 /program/lib/Roundcube/rcube_ldap.php
parent96f084e9cf30fe714efd4ffd5ac6216b4d773d74 (diff)
Make LDAP errors available to the application
Diffstat (limited to 'program/lib/Roundcube/rcube_ldap.php')
-rw-r--r--program/lib/Roundcube/rcube_ldap.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php
index 274616a1f..6805c4902 100644
--- a/program/lib/Roundcube/rcube_ldap.php
+++ b/program/lib/Roundcube/rcube_ldap.php
@@ -906,7 +906,6 @@ class rcube_ldap extends rcube_addressbook
return $this->result;
}
-
/**
* Get a specific contact record
*
@@ -948,6 +947,23 @@ class rcube_ldap extends rcube_addressbook
return $assoc ? $res : $this->result;
}
+ /**
+ * Returns the last error occurred (e.g. when updating/inserting failed)
+ *
+ * @return array Hash array with the following fields: type, message
+ */
+ function get_error()
+ {
+ $err = $this->error;
+
+ // check ldap connection for errors
+ if (!$err && $this->ldap->get_error()) {
+ $err = array(self::ERROR_SEARCH, $this->ldap->get_error());
+ }
+
+ return $err;
+ }
+
/**
* Check the given data before saving.
@@ -1609,7 +1625,7 @@ class rcube_ldap extends rcube_addressbook
if ($search) {
foreach ($group_cache as $group) {
- if ($this->compare_search_value('name', $group['name'], $search, $mode)) {
+ if ($this->compare_search_value('name', $group['name'], mb_strtolower($search), $mode)) {
$groups[] = $group;
}
}