protected void setLDAPAttributes()

in ldap/src/java/org/apache/fulcrum/security/ldap/LDAPUserManagerImpl.java [627:678]


    protected void setLDAPAttributes(User user, Attributes attribs)
            throws NamingException
    {
        Attribute attr;

        // Set the User id.
        attr = attribs.get(this.ldapUserid);
        if (attr != null && attr.get() != null)
        {
            try
            {
                user.setId(attr.get());
            }
            catch (Exception ex)
            {
                getLogger().error("Exception caught:", ex);
            }
        }

        // Set the Username.
        attr = attribs.get(this.ldapUsername);
        if (attr != null && attr.get() != null)
        {
            user.setName(attr.get().toString());
        }

        if (user instanceof LDAPUser)
        {
            LDAPUser u = (LDAPUser)user;

            // Set the Firstname.
            attr = attribs.get(this.ldapFirstname);
            if (attr != null && attr.get() != null)
            {
                u.setFirstName(attr.get().toString());
            }

            // Set the Lastname.
            attr = attribs.get(this.ldapLastname);
            if (attr != null && attr.get() != null)
            {
                u.setLastName(attr.get().toString());
            }

            // Set the E-Mail
            attr = attribs.get(this.ldapEmail);
            if (attr != null && attr.get() != null)
            {
                u.setEmail(attr.get().toString());
            }
        }
    }