Projects
Wiki     Timeline     Roadmap     Browse Source     View Tickets     New Ticket     Search

Ticket #260: aym-ldapdir-fix01.diff

File aym-ldapdir-fix01.diff, 1.9 KB (added by oxullo@…, 14 months ago)

Aymeric's patch fixes

  • ldapdirectory.py

    old new  
    146146        uid = None 
    147147 
    148148        # Find or build email 
    149         emailAddresses = self._getMultipleLdapAttributes(attrs, 'mail') 
     149        emailAddresses = set(map(lambda v: 'mailto:' + v, self._getMultipleLdapAttributes(attrs, 'mail'))) 
     150 
    150151        emailSuffix = self._rdnSchema[recordType]['emailSuffix'] 
    151152        if len(emailAddresses) == 0 and emailSuffix is not None: 
    152153            emailPrefix = self._getUniqueLdapAttribute(attrs, self._rdnSchema[recordType]['attr']) 
    153             emailAddresses.add(emailPrefix + emailSuffix) 
     154            emailAddresses.add('mailto:' + emailPrefix + emailSuffix) 
    154155 
    155156        # LDAP attribute -> principal matchings 
    156157        if recordType == DirectoryService.recordType_users: 
     
    165166            fullName = self._getUniqueLdapAttribute(attrs, 'cn') 
    166167            calendarUserAddresses   = emailAddresses 
    167168            enabledForCalendaring   = True 
     169        elif recordType in (DirectoryService.recordType_resources, DirectoryService.recordType_locations): 
     170            shortName = self._getUniqueLdapAttribute(attrs, 'cn') 
     171            fullName = self._getUniqueLdapAttribute(attrs, 'cn') 
     172            calendarUserAddresses   = emailAddresses 
     173            enabledForCalendaring   = True 
     174            autoSchedule = True 
    168175 
    169176        return LdapDirectoryRecord( 
    170177            service     = self, 
     
    352359 
    353360    def readOnlyProxyFor(self, read_write=True): 
    354361        return () 
     362     
     363    # Returns true regardless of the type. We want to be able to add delegation to 
     364    # locations and resources, due to the complete lack of a directory-based 
     365    # mechanism to create proxies 
     366    def hasEditableProxyMembership(self): 
     367        return True 
    355368 
    356369    # Credentials are checked against the LDAP server 
    357370    # Thus, the password is needed in clear-text and digest authentication