From f4bc6f6af55ad1fe67c5a5439c406dc9f8f80610 Mon Sep 17 00:00:00 2001 From: "bbaetz%acm.org" Date: Mon, 14 Jul 2003 13:35:12 +0000 Subject: [PATCH] Bug 122365 - Allow installation definable LDAP filters r,a=justdave git-svn-id: svn://10.0.0.236/trunk@144823 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/Bugzilla/Auth/LDAP.pm | 4 ++-- mozilla/webtools/bugzilla/defparams.pl | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/LDAP.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/LDAP.pm index 179b5a2c588..c34c3698fe3 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/LDAP.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/LDAP.pm @@ -84,7 +84,7 @@ sub authenticate { # We've got our anonymous bind; let's look up this user. $mesg = $LDAPconn->search( base => Param("LDAPBaseDN"), scope => "sub", - filter => Param("LDAPuidattribute") . "=$username", + filter => '(&(' . Param("LDAPuidattribute") . "=$username)" . Param("LDAPfilter") . ')', attrs => ['dn'], ); return (AUTH_LOGINFAILED, undef, "lookup_failure") @@ -102,7 +102,7 @@ sub authenticate { # mail attribute for this user. $mesg = $LDAPconn->search( base => Param("LDAPBaseDN"), scope => "sub", - filter => Param("LDAPuidattribute") . "=$username", + filter => '(&(' . Param("LDAPuidattribute") . "=$username)" . Param("LDAPfilter") . ')', ); my $user_entry = $mesg->shift_entry if !$mesg->code && $mesg->count; if(!$user_entry || !$user_entry->exists(Param("LDAPmailattribute"))) { diff --git a/mozilla/webtools/bugzilla/defparams.pl b/mozilla/webtools/bugzilla/defparams.pl index 15232ad4696..e2dcf753372 100644 --- a/mozilla/webtools/bugzilla/defparams.pl +++ b/mozilla/webtools/bugzilla/defparams.pl @@ -388,6 +388,14 @@ sub check_loginmethod { default => 'mail' }, + { + name => 'LDAPfilter', + desc => 'LDAP filter to AND with the LDAPuidattribute for ' . + 'filtering the list of valid users.', + type => 't', + default => '', + }, + { name => 'loginmethod', desc => 'The type of login authentication to use: