~therp-nl/therp-addons/7.0_lp1215631

« back to all changes in this revision

Viewing changes to users_ldap_groups/users_ldap_groups.py

  • Committer: Holger Brunn
  • Date: 2013-01-28 11:01:51 UTC
  • mto: This revision was merged to the branch mainline in revision 77.
  • Revision ID: hbrunn@therp.nl-20130128110151-o5fsiihrptsh2ywp
[ADD] operator 'query', allowing group mappings for the typical posixAccount
setup

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
            required=True),
44
44
        'ldap_attribute': fields.char('LDAP attribute', size=64, 
45
45
            help='The LDAP attribute to check.\n'
46
 
                'For active directory, use memberOf.', required=True),
 
46
                'For active directory, use memberOf.'),
47
47
        'operator': fields.selection(_get_operators, 'Operator', 
48
48
            help='The operator to check the attribute against the value\n'
49
49
            'For active directory, use \'contains\'', required=True),
90
90
        operator=getattr(users_ldap_groups_operators, mapping['operator'])()
91
91
        logger.debug('checking mapping %s' % mapping)
92
92
        if operator.check_value(ldap_entry, mapping['ldap_attribute'], 
93
 
                mapping['value']):
 
93
                mapping['value'], conf, self, logger):
94
94
            logger.debug('adding user %d to group %s' % 
95
95
                    (user_id, mapping['group'][1]))
96
96
            userobj.write(cr, uid, user_id,