Logo Search packages:      
Sourcecode: zope-cmfldap version File versions

def CMFLDAP::LDAPMemberDataTool::LDAPMemberData::setMemberProperties (   self,
  mapping 
)

Sets the properties of the member.  

Definition at line 158 of file LDAPMemberDataTool.py.

00158                                           :
        """ Sets the properties of the member.  """
        acl = self.acl_users
        ldap_schemakeys = [x[0] for x in acl.getLDAPSchema()]

        # back conversion of mapped attributes
        mapped_attrs = acl.getMappedUserAttrs()
        for mapped_attr in mapped_attrs:
            if ( not mapping.has_key(mapped_attr[0]) 
                 and mapping.has_key(mapped_attr[1]) ):
                mapping.set( mapped_attr[0]
                           , mapping[mapped_attr[1]]
                           )
        
        change_vals = filter( None
                            , map( lambda x, lsk=ldap_schemakeys: x in lsk
                                 , mapping.keys()
                                 )
                            )

        try:
            if change_vals:
                user_obj = self.getUser()
                dn = user_obj.getUserDN()
                rdn_attr = acl.getProperty('_rdnattr')

                if not mapping.has_key(rdn_attr):
                    mapping.set( rdn_attr
                               , user_obj.getUserName()
                               )

                acl.manage_editUser(dn, kwargs=mapping)
                user_obj._expire()
        except:
            pass

        # To be on the safe side...
        wrapper_keys = self.__dict__.keys()
        for key in ldap_schemakeys:
            if mapping.has_key(key) and key in wrapper_keys:
                setattr(self, key, mapping[key])

        MemberData.setMemberProperties(self, mapping)
        

    def setSecurityProfile(self, password=None, roles=None, domains=None):


Generated by  Doxygen 1.6.0   Back to index