|
@ -23,21 +23,22 @@ from openerp.osv import fields, orm |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CompanyLDAP(orm.Model): |
|
|
class CompanyLDAP(orm.Model): |
|
|
_inherit='res.company.ldap' |
|
|
|
|
|
_columns={ |
|
|
|
|
|
|
|
|
_inherit = 'res.company.ldap' |
|
|
|
|
|
_columns = { |
|
|
'name_attribute': fields.char('Name Attribute', size=64, |
|
|
'name_attribute': fields.char('Name Attribute', size=64, |
|
|
help="Default in 'cn'. For an AD you could use 'displayName' instead."), |
|
|
help="Default in 'cn'. For an AD you could use 'displayName' instead."), |
|
|
'mail_attribute': fields.char('E-mail attribute', size=64, |
|
|
'mail_attribute': fields.char('E-mail attribute', size=64, |
|
|
help="Active Directory uses the 'mail' attribute."), |
|
|
help="Active Directory uses the 'mail' attribute."), |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
_defaults = { |
|
|
|
|
|
'mail_attribute': 'mail', |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
def get_ldap_dicts(self, cr, ids=None): |
|
|
def get_ldap_dicts(self, cr, ids=None): |
|
|
""" |
|
|
""" |
|
|
Copy of auth_ldap's funtion, changing only the SQL, so that it returns |
|
|
Copy of auth_ldap's funtion, changing only the SQL, so that it returns |
|
|
all fields in the table. |
|
|
all fields in the table. |
|
|
""" |
|
|
""" |
|
|
|
|
|
|
|
|
if ids: |
|
|
if ids: |
|
|
id_clause = 'AND id IN (%s)' |
|
|
id_clause = 'AND id IN (%s)' |
|
|
args = [tuple(ids)] |
|
|
args = [tuple(ids)] |
|
@ -51,7 +52,6 @@ class CompanyLDAP(orm.Model): |
|
|
""", args) |
|
|
""", args) |
|
|
return cr.dictfetchall() |
|
|
return cr.dictfetchall() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def map_ldap_attributes(self, cr, uid, conf, login, ldap_entry): |
|
|
def map_ldap_attributes(self, cr, uid, conf, login, ldap_entry): |
|
|
values = super(CompanyLDAP, self).map_ldap_attributes(cr, uid, conf, |
|
|
values = super(CompanyLDAP, self).map_ldap_attributes(cr, uid, conf, |
|
|
login, ldap_entry) |
|
|
login, ldap_entry) |
|
|