From b726d131a4c2b8277e1bf72de18481d7a072911d Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 23 Aug 2016 11:32:11 -0700 Subject: [PATCH] More helpful message for LDAP TLS issue --- app/Models/Ldap.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/Ldap.php b/app/Models/Ldap.php index b05475f2be..9e4b01a9a2 100644 --- a/app/Models/Ldap.php +++ b/app/Models/Ldap.php @@ -247,8 +247,12 @@ class Ldap extends Model // Perform the search do { + // Paginate (non-critical, if not supported by server) - ldap_control_paged_result($ldapconn, $page_size, false, $cookie); + if (!$ldap_paging = @ldap_control_paged_result($ldapconn, $page_size, false, $cookie)) { + throw new Exception('Problem with your LDAP connection. Try checking the Use TLS setting in Admin > Settings. '); + } + $search_results = ldap_search($ldapconn, $base_dn, '('.$filter.')');