Skip to content

Commit

Permalink
do not try and set an ldap option unless we have actually connected
Browse files Browse the repository at this point in the history
git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@207 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
Dave Goodwin committed Oct 27, 2011
1 parent 3bee936 commit 99f1b5f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions website_code/php/login_library.php
Expand Up @@ -130,15 +130,14 @@ function get_user_ldap($host,$port,$bind_pwd,$bind_dn,$basedn,$ldap_filter,$ldap
$ldapbind = null;

$ds = @ldap_connect($host, (int)$port);

@ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);

if ($ds) {
@ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);

if ($bind_dn != '') {

$ldapbind = @ldap_bind($ds, $bind_dn, $bind_pwd);

_debug("$basedn / $ldap_filter_attr / $eureka_username / $ldap_search_attr ");
$sr = @ldap_search($ds, $basedn, $ldap_filter_attr ."=". $eureka_username, array_values($ldap_search_attr));

if(!$sr){
Expand Down

0 comments on commit 99f1b5f

Please sign in to comment.