Lines 112-121
sub checkpw_ldap {
Link Here
|
112 |
my $userldapentry; |
112 |
my $userldapentry; |
113 |
|
113 |
|
114 |
if ( $ldap->{auth_by_bind} ) { |
114 |
if ( $ldap->{auth_by_bind} ) { |
115 |
# Perform an anonymous bind |
115 |
# Perform initial bind (anonymous or otherwise) |
116 |
my $res = $db->bind; |
116 |
my $res = ($config{anonymous}) ? $db->bind : $db->bind($ldapname, password=>$ldappassword); |
117 |
if ( $res->code ) { |
117 |
if ( $res->code ) { |
118 |
$debug and warn "Anonymous LDAP bind failed: ". description($res); |
118 |
$debug and warn "LDAP bind failed as ldapuser " . ($ldapname || '[ANONYMOUS]') . ": " . description($res); |
119 |
return 0; |
119 |
return 0; |
120 |
} |
120 |
} |
121 |
|
121 |
|
Lines 123-129
sub checkpw_ldap {
Link Here
|
123 |
my $search = search_method($db, $userid) or return 0; # warnings are in the sub |
123 |
my $search = search_method($db, $userid) or return 0; # warnings are in the sub |
124 |
$userldapentry = $search->shift_entry; |
124 |
$userldapentry = $search->shift_entry; |
125 |
|
125 |
|
126 |
# Perform a LDAP bind for the given username using the matched DN |
126 |
# Perform a LDAP (re)bind for the given username using the matched DN |
127 |
$res = $db->bind( $userldapentry->dn, password => $password ); |
127 |
$res = $db->bind( $userldapentry->dn, password => $password ); |
128 |
if ( $res->code ) { |
128 |
if ( $res->code ) { |
129 |
$debug and warn "LDAP bind failed as kohauser $userid: ". description($res); |
129 |
$debug and warn "LDAP bind failed as kohauser $userid: ". description($res); |
130 |
- |
|
|