Thread:Extension talk:LDAP Authentication/Pre-add users from LDAP/reply

Figured it out with a dump of my LDAP database and a bit of perl scripting. Posted here for posterity:

use Net::LDAP::LDIF; use Digest::MD5 qw(md5_hex); $idx = 10; $ldif = Net::LDAP::LDIF->new( $ARGV[0], "r", onerror => 'undef' ); while( not $ldif->eof ) { $entry = $ldif->read_entry ; if ( $ldif->error ) { print "Error msg: ", $ldif->error, "\n"; print "Error lines:\n", $ldif->error_lines, "\n"; } else { my $uc_username = $entry->get_value('uid'); $uc_username = uc(substr($uc_username,0,1)). substr($uc_username,1); my $cn = $entry->get_value('cn'); my $mail = $entry->get_value('mail'); my $MD5SUM = md5_hex($cn); $idx++; print "INSERT INTO `mwuser` VALUES ($idx,'$uc_username','$cn',,,NULL,'$mail','20130622223111','$MD5SUM','20130622223106',NULL,NULL,'20130622223106',0);\n"; }   }    $ldif->done ;

Simply pasted into a database dump. Quick and very dirty. Also you need to edit ${prefix}user_properties