3. Add/Edit Members

Adding "members" (borrowers) to the library or changing information about a borrower can be started from the Koha home page.

Figure 3.10. Member management from home page

Member management from home page

If you happen to be at the home page when a potential borrower asks to be added to the library's membership, this works well. In most cases, however, you will get to member management from the circulation page, either through the pull-down "Members" menu at the top of the page, or by clicking on "Add" or "Edit" after doing a search for borrowers.

No matter how you get there, the screen you will see is the same.

Figure 3.11. Member detail entry

Member detail entry

On this page, required information appears in bold type with an asterisk: the card number, the given (first) name, the surname (last name), the postal address, and the town. It is to your advantage, of course, to fill in the rest of the fields with as much information as possible. Many of the fields on this screen are designed to allow flexible data entry; the zip code, for example, may be called "postal code" in your country, or may not even be an important part of your addresses. Decide how you want to use the fields and then try to be consistent as you add new members or edit information about existing borrowers.

A few of the fields on this page deserve some explanation.

Card number

If you set your "autoMemberNum" system preference to "1" (on), then card numbers will be calculated automatically and inserted into this field when new members are added.

Category

Be sure to choose the correct category for the member, since this may affect how loan periods and fines are calculated for this borrower.

Notes (alternate contact)

Use this field wisely; if you have extensive notes on how to contact others when you cannot contact the borrower, it will make your work easier when you have to hunt down a "missing" member.

Expiry date

If you leave this field blank when adding a new member, Koha can calculate the expiration date of the borrower's membership based on the "Enrollment Period" value you set for this borrower's category in the Borrower Categories parameter.

Borrower message and Circulation note

These two fields are most often used when adding extra information to an existing borrower's account. The "Borrower message" will appear on the OPAC screen when the borrower logs in; it is a handy way to communicate information to a borrower. The "Circulation note" is intend to communicate information to other staff members. Both the messages appear on the staff screen when a borrower presents their card at the circulation desk to check items out.

FLAGS

These three radio buttons can be used to set the status of the account. "Gone no address" means that mail to the borrower has been returned to the library and no new mailing address has yet been provided. "Lost" means the card (not the borrower!) has been reported lost. "Debarred" means the borrower has violated library rules and is not entitled to library services until the situation has been resolved.

Sorting fields

These are general-purpose fields that can be used to store any type of special information which might be used for retrieving the records of a special group of borrowers from the database.

When you have filled in the fields, click on "Save." If any of the required fields have been left blank, you will receive an error message and be given the opportunity to add the missing information.

3.1. - User comments -

(Send comments and remarks to . They will be added to this section.)

Posted by Paul Poulain

If you have an LDAP server, Koha can use that to authenticate users.

In the modules/C4 directory, you'll find the Auth_with_ldap.pm package. Open it with your text editor, modify it to fit your needs (LDAP server name and parameters), then :

  • rename Auth.pm to Auth_ini.pm

  • copy Auth_with_ldap.pm to Auth.pm

It should work. Note that when you upgrade your Koha version, you have to manually copy your modified Auth_with_ldap.pm and overwrite the official Auth.pm once again.

Don't forget to save the official Auth.pm somewhere; it can alway be useful.

Posted by Kent Nasveschuk

An anonymous bind to LDAP requires us to compare passwords by retrieving the password then comparing to what the user has supplied. If passwords stored in LDAP are hashed using different mechanisms, the burden of determining what mechanism is used is on the Koha application. I changed the code in Auth.pm a little so that bind() uses the person's DN and password. The burden of what password hash is used is on LDAP and not Koha.

Between local in Auth.pm:

        ##################################################
        ### LOCAL
        ### Change the code below to match your own LDAP server.
        ##################################################
        # LDAP connexion parameters

        # LDAP server
        my $ldapserver = '172.16.0.24';

        # Base DN for users
        my $name  = "ou=users,dc=tow,dc=net";

        # Bind uses the users full DN, if uid doesn't work try "cn"
#        my $binddn = "cn=$userid,$name";
        my $binddn = "uid=$userid,$name";

        my $db = Net::LDAP->new( $ldapserver );
        
        # do bind
        my $res =$db->bind(
                        dn        =>$binddn,
                        password =>$password);
        
        # check connexion, anything other code than LDAP_SUCCESS (0)
        # is a problem
        if($res->code != 0 ) {
                # auth refused
                warn "LDAP Auth failed server not responding or wrong user password combination";
                return 0;
        # search user
        }else {
        
                my $userdnsearch = $db->search(base => "$name",
                                filter =>"(cn=$userid)",
                                );
                my $userldapentry=$userdnsearch -> shift_entry;
                
                # build LDAP hash
                my %memberhash;
                my $x =$userldapentry->{asn}{attributes};
                my $key;
                foreach my $k ( @$x) {
                        foreach my $k2 (keys %$k) {
                                if ($k2 eq 'type') {
                                        $key = $$k{$k2};
                                } else {
                                        my $a = @$k{$k2};
                                        foreach my $k3 (@$a) {
                                                $memberhash{$key} .= $k3." ";
                                        }
                                }
                        }
                }
                #
                # BUILD %borrower to CREATE or MODIFY BORROWER
                # change $memberhash{'xxx'} to fit your ldap structure.
                # check twice that mandatory fields are correctly filled
                #
                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};
        ##################################################
        ### /LOCAL
        ### No change needed after this line (unless there's a bug ;-) )
        ##################################################

This works for passwords stored in LDAP that use MD5 or SMD5. I imagine it will work for other hashing mechanisms also.

Posted by Bruno Marmol

For testing the LDAP password, I needed to patch this code to not do an anonymous bind. I don't use the compare() function. I just do:

        my $res =$db->bind( "uid=$userid,$name",password => $password);
        # check connexion
        if($res->code) {
                # auth refused
                #warn "LDAP Auth: not binded";
                return 0;
                }