[CalendarServer-changes] [6216] CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Aug 31 10:39:33 PDT 2010


Revision: 6216
          http://trac.macosforge.org/projects/calendarserver/changeset/6216
Author:   sagen at apple.com
Date:     2010-08-31 10:39:33 -0700 (Tue, 31 Aug 2010)
Log Message:
-----------
Because mailto: CUAs get normalized to lowercase, we should do case-insensitive searches when faulting in by emailAddress from OD

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py

Modified: CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py	2010-08-31 16:44:59 UTC (rev 6215)
+++ CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py	2010-08-31 17:39:33 UTC (rev 6216)
@@ -555,7 +555,7 @@
 
     def queryDirectory(self, recordTypes, indexType, indexKey,
         lookupMethod=opendirectory.queryRecordsWithAttribute_list):
-        
+
         origIndexKey = indexKey
         if indexType == self.INDEX_TYPE_CUA:
             # The directory doesn't contain CUAs, so we need to convert
@@ -573,10 +573,15 @@
                 self.INDEX_TYPE_AUTHID    : dsattributes.kDSNAttrAltSecurityIdentities,
             }.get(indexType)
             assert queryattr is not None, "Invalid type for record faulting query"
+        # mailto: CUAs get normalized to lowercase internally, so do a case
+        # insensitive search
+        if queryattr == dsattributes.kDSNAttrEMailAddress:
+            caseInsensitive = True
+        else:
+            caseInsensitive = False
 
         query = dsquery.match(queryattr, indexKey, dsattributes.eDSExact)
 
-
         results = []
         for recordType in recordTypes:
 
@@ -614,7 +619,7 @@
                     query.attribute,
                     query.value,
                     query.matchType,
-                    False,
+                    caseInsensitive,
                     listRecordTypes,
                     attrs,
                 ))
@@ -624,7 +629,7 @@
                         query.attribute,
                         query.value,
                         query.matchType,
-                        False,
+                        caseInsensitive,
                         listRecordTypes,
                         attrs,
                     )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100831/43234b32/attachment-0001.html>


More information about the calendarserver-changes mailing list