Hi Casey,

On the one hand your totally correct, however if you were to look further at
the code you will see the following:

<snip>
LDAPUserManager.java:165:         String dNAttribute =
TurbineResources.getString(LDAP_DN_ATTR);

LDAPUserManager.java:206:  dN = attribs.get(dNAttribute).toString();


</snip>

So you see that the "dNAttribute" is actually a variable that is being set
by the setting(s) in the Resource file.

/colin




----- Original Message -----
From: "Bragg, Casey" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2001 7:37 PM
Subject: LDAPUserManager : getting the user's dn


> This question concerns LDAPUserManager (in
> org.apache.turbine.services.security.ldap).
>
> Given the code from LDAPUserManager's public User retrieve(String
username)
> method :
>             while (answer.hasMore())
>             {
>                 SearchResult sr = (SearchResult) answer.next();
>                 Attributes attribs = sr.getAttributes();
>                 Log.debug("attribs:  " + attribs.get(dNAttribute));
>                 dN = attribs.get(dNAttribute).toString();
>                 Log.debug("dN:  " + dN);
>             }
>
> Maybe I'm reading this wrong, but this code seems to presume that each DN
> has an attribute which contains the user's DN.  Our LDAP tree (which
matches
> that used by iPlanet's mail server) doesn't appear to have such an
> attribute.  Wouldn't it be more appropriate to get the dN with the
following
> :
>             while (answer.hasMore())
>             {
> dN = sr.getName();
>             }
>
> Thanks...
>
> ...Casey
>
> P.S.  Should I post this kind of question here?
>
> ==============================================
> Casey Bragg - Software Engineer
> Allegiance Telecom, Inc.  Dallas, TX
> 469-259-2702 - [EMAIL PROTECTED]
> ==============================================
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to