The usermanagement API is actually quite robust and useful. If you combine it with the SMTP class in my previous blog entry you can send it out to the end user from within EP automatically. It is far more flexible and useful than doing the LDAP lookups yourself — and if your LDAP changes as many times as ours have you may have to recode your queries. Not so with usermanagment.
Here’s some code:
... get the request object if you haven't already ... IUser user = (IUser) request.getUser().getUser(); contactLastName = user.getLastName(); contactFirstName = user.getFirstName(); lastRevisedName = user.getLastName()+","+ user.getFirstName(); if (user.getTelephone() != null) contactPhone = user.getTelephone(); if (user.getEmail() != null) contactEmail = user.getEmail(); city = user.getCity(); country = user.getCountry(); address = user.getStreetAddress();