add ldap main function