update LDAP auth for plone
The Excel file received has extra columns in the wrong order. First order of business is to get them arranged so:
chMemberId Account Firstname Lastname City State Postalcode Email Password Country Beef Dairy Egg Pork Poultry Produce
after further massage, including parsing the pools data into a binary value for whether there's something in the cell for that pool (there are two possible values, but for our purposes, anything is a positive), I can run the adapted "conv_farmersAndPools.pl" like so:
perl conv_farmers.pl ./farmersimport-3-28-06.txt > ./farmers_out.ldif
which produces the farmers_out.ldif file (containing the data in LDAP import format)
This file is then uploaded to the server, where it is imported to the openLDAP db with
ldapadd -v -W -D "cn=Manager,o=People,dc=farmers,dc=coop" -f farmers_out.txt
using the Manager password.
If there's a problem with the update (as there was the first time I ran it), we can remove the new records with ldapdelete, the format is the dn
uid=91063,o=Farmers,dc=farmers,dc=coop
sudo ldapdelete -cxv -D "cn=Manager,o=People,dc=farmers,dc=coop" -W -f farmers_DN.txt
