summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-10-27 17:35:39 +0200
committerArthur Schiwon <blizzz@owncloud.com>2012-10-27 17:46:01 +0200
commit33aa630af3cedf146b1c51575200f8a723ae1fa3 (patch)
treeddb6d11edb624920ea910d31a3e2170e18311b40 /apps/user_ldap
parenta053da58ce1c29071654814ce32d083b054ea542 (diff)
downloadnextcloud-server-33aa630af3cedf146b1c51575200f8a723ae1fa3.tar.gz
nextcloud-server-33aa630af3cedf146b1c51575200f8a723ae1fa3.zip
LDAP: add error handling for failed searches
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/access.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 82a375b50ec..fa8546f1cea 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -515,6 +515,11 @@ abstract class Access {
$pagedSearchOK = $this->initPagedSearch($filter, $base, $attr, $limit, $offset);
$sr = ldap_search($link_resource, $base, $filter, $attr);
+ if(!$sr) {
+ \OCP\Util::writeLog('user_ldap', 'Error when searching: '.ldap_error($link_resource).' code '.ldap_errno($link_resource), \OCP\Util::ERROR);
+ \OCP\Util::writeLog('user_ldap', 'Attempt for Paging? '.print_r($pagedSearchOK, true), \OCP\Util::ERROR);
+ return array();
+ }
$findings = ldap_get_entries($link_resource, $sr );
if($pagedSearchOK) {
\OCP\Util::writeLog('user_ldap', 'Paged search successful', \OCP\Util::INFO);