Commit 04ed7be6 authored by Yadd's avatar Yadd
Browse files

exported vars are now asked to the LDAP server (instead of *)

parent 5499a042
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# LDAP user database backend class # LDAP user database backend class
package Lemonldap::NG::Portal::UserDBLDAP; package Lemonldap::NG::Portal::UserDBLDAP;
use strict;
use Lemonldap::NG::Portal::Simple; use Lemonldap::NG::Portal::Simple;
use Lemonldap::NG::Portal::_LDAP 'ldap'; #link protected ldap use Lemonldap::NG::Portal::_LDAP 'ldap'; #link protected ldap
...@@ -57,20 +58,25 @@ sub search { ...@@ -57,20 +58,25 @@ sub search {
base => $self->{ldapBase}, base => $self->{ldapBase},
scope => 'sub', scope => 'sub',
filter => $self->{LDAPFilter}, filter => $self->{LDAPFilter},
(
ref( $self->{exportedVars} )
? ( attrs => values( %{ $self->{exportedVars} } ) )
: ()
),
); );
$self->lmLog( $self->lmLog(
"LDAP Search with base: " 'LDAP Search with base: '
. $self->{ldapBase} . $self->{ldapBase}
. " and filter: " . ' and filter: '
. $self->{LDAPFilter}, . $self->{LDAPFilter},
'debug' 'debug'
); );
if ( $mesg->code() != 0 ) { if ( $mesg->code() != 0 ) {
$self->lmLog( "LDAP Search error: " . $mesg->error, 'error' ); $self->lmLog( 'LDAP Search error: ' . $mesg->error, 'error' );
return PE_LDAPERROR; return PE_LDAPERROR;
} }
unless ( $self->{entry} = $mesg->entry(0) ) { unless ( $self->{entry} = $mesg->entry(0) ) {
$user = $self->{mail} || $self->{user}; my $user = $self->{mail} || $self->{user};
$self->_sub( 'userError', "$user was not found in LDAP directory" ); $self->_sub( 'userError', "$user was not found in LDAP directory" );
return PE_BADCREDENTIALS; return PE_BADCREDENTIALS;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment