Closed Bug 394702 Opened 17 years ago Closed 17 years ago

LDAP attributes are mapped to address book properties with reversed priority

Categories

(MailNews Core :: LDAP Integration, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jeremy.laine, Assigned: jeremy.laine)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070723 Iceweasel/2.0.0.6 (Debian-2.0.0.6-1)
Build Identifier: 

When an LDAP entry contains several attributes which map to the same address book card property, the first attribute specified in the attribute map should be used. The actual behaviour is in fact the opposite.

To exhibit the bug:

1/ add the following to prefs.js:

user_pref("ldap_2.servers.default.attrmap.LastName", "sn,initials");

2/ create an LDAP entry with both "sn" and "initials" attributes

3/ lookup the entry in the address book : the value of "initials" is shown as the last name, instead of the "sn" value



Reproducible: Always
The attached patch fixes the bug: it makes sure that for a given card property, we stop as soon as we have found an LDAP attribute that maps to the property.
Attachment #279407 - Flags: review?(bugzilla)
Attachment #279407 - Flags: superreview?(bienvenu)
Comment on attachment 279407 [details] [diff] [review]
Patch to fix LDAP attributes priority

Looks good. r=me.
Attachment #279407 - Flags: review?(bugzilla) → review+
Assignee: nobody → jeremy.laine
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 279407 [details] [diff] [review]
Patch to fix LDAP attributes priority

thx for the patch, Jeremy
Attachment #279407 - Flags: superreview?(bienvenu) → superreview+
I've just checked this into trunk on behalf of Jeremy:

Checking in mailnews/addrbook/src/nsAbLDAPAttributeMap.js;
/cvsroot/mozilla/mailnews/addrbook/src/nsAbLDAPAttributeMap.js,v  <--  nsAbLDAPAttributeMap.js
new revision: 1.4; previous revision: 1.3
done

Marking as fixed as its in on trunk now.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment on attachment 279407 [details] [diff] [review]
Patch to fix LDAP attributes priority

Not sure if we want this on branch or not.

We've not had any complaints about it (yet), and there's probably a quite simple work around (list only the attribute you need in the preference, rather than several of them).

So I think probably not.

Scott - comments?
I'd lean towards not taking it on the branch Mark, given your analysis.
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: