[Koha] LDAP support 2.2.4

KL Nasveschuk klnasveschuk at klnconsulting.net
Sat Dec 10 04:18:35 NZDT 2005


Hi,
Thanks for getting back to me. I know I have this setup wrong, but I'm
close.

I have Net::LDAP installed.

Here is my Auth.pm with applicable sections that I changed:


        ##################################################
        ### LOCAL
        ### Change the code below to match your own LDAP server.
        ##################################################
        # LDAP connexion parameters
        my $ldapserver = '172.16.0.24';
        # Infos to do an anonymous bind
        my $ldapinfos = 'ou=users,dc=tow,dc=net ';
        my $name  = "ou=users,dc=tow,dc=net";
        my $db = Net::LDAP->new( $ldapserver );

All my users are under ou=users,dc=tow,dc=net. 

 ......

                my $userdnsearch = $db->search(base => $name,
                                filter =>"(uid=$userid)",

I changed a-login to uid. Will that work?

......

                my %borrower;
                $borrower{cardnumber} = $userid;
                $borrower{firstname} = $memberhash{givenName}; #
MANDATORY FIELD                $borrower{surname} = $memberhash{sn}; #
MANDATORY FIELD
                $borrower{initials} =
substr($borrower{firstname},0,1).substr($borrower{surname},0,1)."  "; #
MANDATORY FIELD
                $borrower{streetaddress} =
$memberhash{homePostalAddress}." "; # MANDATORY FIELD
                $borrower{city} = $memberhash{l}." "; # MANDATORY FIELD
                $borrower{phone} = $memberhash{homePhone}." "; #
MANDATORY FIELD                $borrower{branchcode} =
$memberhash{businessCategory}; # MANDATORY FIELD
                $borrower{emailaddress} = $memberhash{mail};
                $borrower{categorycode} = $memberhash{employeeType};

I changed some of these to match what I have in LDAP.

I was getting an error message in opac-error_log that said:

[Fri Dec 09 13:45:46 2005] [error] [client 172.16.56.200] LDAP Auth
impossible : wrong password
at /usr/local/koha/intranet/modules/C4/Auth.pm line 471, <DATA> line
424., referer: http://172.16.60.186:8000/cgi-bin/koha/opac-user.pl

Wrong passwd hash?

Does it look like there are any problems with what is above as far as
Koha mandatory fields to LDAP attributes?

Thanks.

Kent N


On Thu, 2005-12-08 at 16:08 +0100, Paul POULAIN wrote:
> KL Nasveschuk a écrit :
> > I've seen a little information about LDAP support for Koha but nothing
> > about setting it up or how to use it.
> > 
> > If anyone could shed some light on this for me I'd appreciate it.
> 
> In the modules/C4 directory, you'll find Auth_with_ldap.pm package
> open it with your text editor, modify it to fit your needs (ldap server 
> & structure)
> then :
> * rename Auth.pm Auth_ini.pm
> * copy Auth_with_ldap.pm to Auth.pm
> 
> It should work
> Note that when you upgrade your version, you have to copy manually your 
> modified Auth_with_ldap & overwrite official Auth.pm once again.
> 
> Don't forget to save somewhere the official auth.pm it can alway be useful.
> 
> About upgrading :
> diff old_koha/Auth_ini.pm new_koha/Auth_ini.pm to see if some changes 
> have been done between versions. It is really rare (only between 2.2.3 
> and 2.2.4 since 2.2.0)
> 
> HTH
> 



More information about the Koha mailing list