summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
-rw-r--r--Changes3
-rw-r--r--lib/DJabberd/Authen/LDAP.pm10
2 files changed, 10 insertions, 3 deletions
diff --git a/Changes b/Changes
index 88f37e9..dbbdb4d 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
1Revision history for DJabberd-Authen-LDAP 1Revision history for DJabberd-Authen-LDAP
2 2
30.02 2007-08-23
4 Implement substituting vhost in auth filter
5
30.01 2007-07-26 60.01 2007-07-26
4 Initial Revision. Only supports rebinding 7 Initial Revision. Only supports rebinding
5 8
diff --git a/lib/DJabberd/Authen/LDAP.pm b/lib/DJabberd/Authen/LDAP.pm
index 9808fa8..3c06c03 100644
--- a/lib/DJabberd/Authen/LDAP.pm
+++ b/lib/DJabberd/Authen/LDAP.pm
@@ -18,10 +18,10 @@ DJabberd::Authen::LDAP - An LDAP authentication module for DJabberd
18 18
19=head1 VERSION 19=head1 VERSION
20 20
21Version 0.01 21Version 0.02
22=cut 22=cut
23 23
24our $VERSION = '0.01'; 24our $VERSION = '0.02';
25 25
26=head1 SYNOPSIS 26=head1 SYNOPSIS
27 27
@@ -46,7 +46,9 @@ The Only LDAPMethod supported at the moment is rebind which performs a bind as L
46 or does anonymous bind, then searches for the user using LDAPFilter and then will rebind 46 or does anonymous bind, then searches for the user using LDAPFilter and then will rebind
47 as the found DN to verify the password. 47 as the found DN to verify the password.
48 48
49LDAPFilter is an LDAP filter with a %u that will be substituted with the incoming userid 49LDAPFilter is an LDAP filter substutions
50 - %u will be substituted with the incoming userid (w/o the domain) (ie. myuser)
51 - %d will be substituted with the incoming userid's domain (ie. mydoman.com)
50 52
51=head1 AUTHOR 53=head1 AUTHOR
52 54
@@ -133,7 +135,9 @@ sub check_cleartext {
133 } 135 }
134 136
135 my $filter = $self->{'ldap_filter'}; 137 my $filter = $self->{'ldap_filter'};
138 my $vhost = $conn->vhost->server_name;
136 $filter =~ s/%u/$username/; 139 $filter =~ s/%u/$username/;
140 $filter =~ s/%d/$vhost/;
137 $logger->info("Searching $filter on ".$self->{'ldap_basedn'}); 141 $logger->info("Searching $filter on ".$self->{'ldap_basedn'});
138 my $srch = $ldap->search( 142 my $srch = $ldap->search(
139 base=>$self->{'ldap_basedn'}, 143 base=>$self->{'ldap_basedn'},