Hi Serge,

My patch is definitely *NOT* the best way to solve this. However it introduces 
the smallest possible amount of enthropy in the code... :)

Seriously, when you added the field provider_jahia_user_prop in the table 
jahia_user_prop, the need to prepending the '{ldap}' prefix has disapeared. 
so this prefix isn't needed any more, and can be removed from:

JahiaGroupManagerLDAPProvider::lookupGroup (int siteID, String name){
        //String tmpGroupName = removeKeyPrefix(name);
        String tmpGroupName=name; //for the sake of consistency


JahiaUserManagerLDAPProvider::lookupUser (int siteID, String name){
        //String tmpUserName = removeKeyPrefix(name);
        String tmpUserName=name; //for the sake of consistency



and as I mentioned below:

 public class JahiaLDAPUser implements JahiaUser
 {
    //static final public String USERKEY_LDAP_PREFIX = "{ldap}";//this

and

 public class JahiaLDAPGroup implements JahiaUser
 {

        //static final public String GROUPKEY_LDAP_PREFIX = "{ldap}";


This string is not used elsewhere (me thinks..). Neither lookupUser nor 
lookupGroupInLDAP, two methods that contruct JahiaUser and JahiaGroup objects 
use the %_LDAP_PREFIX.


Hope it helps,
Predrag


Le lundi 25 Octobre 2004 15:57, Serge Huber a �crit :
> Ok I can confirm we still have this bug. I will look at this more
> closely to see if your patch is the best way to solve this.
>
> Regards,
>   Serge Huber.
>
> Serge Huber wrote:
> > Hmm... Has someone already tested this with the current 4.0.5 CVS ?
> > Because it's always takes some times to setup LDAP environment to test
> > these problems.
> >
> > Regards,
> >  Serge Huber.
> >
> > Predrag Viceic wrote:
> >> Hi,
> >>
> >> There is a bug in my version (4.0 beta3) of Jahia in the class
> >> JahiaLDAPUser. Maybe you have already corrected it in the newer
> >> releases, I'll submit the patch however:
> >>
> >> public class JahiaLDAPUser implements JahiaUser
> >> {
> >>    //static final public String USERKEY_LDAP_PREFIX = "{ldap}";//this
> >> is bad
> >>    static final public String USERKEY_LDAP_PREFIX = "";  //this is good
> >>
> >> In fact this bug doesn't allow the retrieval of db properties of the
> >> LDAP user after reboot.
> >> lookupUser() removes the prefix, but the JahiaLDAPUser constructor
> >> ads it, so the setProperty() prepends {ldap} to the property name,
> >> but getProperty(), done in the construction of JahiaLDAPUSer object
> >> (mapDPToJahia()) doesn't use it . As properties are fetched from the
> >> db only on initial construction of the user object, they are not
> >> fetched..
> >>
> >> I have tested the patch, and it works.
> >>
> >> Regards
> >> Predrag

Reply via email to