ADD defsult and sugegsted values; auto-install
parent
f7ac5cf999
commit
50e82c307a
|
@ -2,7 +2,7 @@
|
|||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# This module copyright (C) 2013 Daniel Reis.
|
||||
# Copyright (C) 2013 Daniel Reis (https://launchpad.com/~dreis-pt)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
|
@ -20,21 +20,22 @@
|
|||
##############################################################################
|
||||
|
||||
{
|
||||
"name" : "LDAP mapping for user name and e-mail",
|
||||
"version" : "1.0",
|
||||
"depends" : ["auth_ldap"],
|
||||
"author" : "Daniel Reis",
|
||||
"description": """\
|
||||
'name': "LDAP mapping for user name and e-mail",
|
||||
'version': "1.0",
|
||||
'depends': ["auth_ldap"],
|
||||
'author': "Daniel Reis (https://launchpad.com/~dreis-pt)",
|
||||
'description': """\
|
||||
Allows to define the LDAP attributes to use to retrieve user name and e-mail address.
|
||||
|
||||
The default attribute used for the name is "cn".
|
||||
For Active Directory, you might prefer to use "displayName" instead.
|
||||
AD also supports the "mail" attribute, so it can be mapped into OpenERP.
|
||||
""",
|
||||
"category" : "Tools",
|
||||
"data" : [
|
||||
'category': "Tools",
|
||||
'data': [
|
||||
'users_ldap_view.xml',
|
||||
],
|
||||
"installable": True,
|
||||
'installable': True,
|
||||
'auto_install': True,
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -30,14 +30,15 @@ class CompanyLDAP(orm.Model):
|
|||
'mail_attribute': fields.char('E-mail attribute', size=64,
|
||||
help="Active Directory uses the 'mail' attribute."),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'mail_attribute': 'mail',
|
||||
}
|
||||
|
||||
def get_ldap_dicts(self, cr, ids=None):
|
||||
"""
|
||||
Copy of auth_ldap's funtion, changing only the SQL, so that it returns
|
||||
all fields in the table.
|
||||
"""
|
||||
|
||||
if ids:
|
||||
id_clause = 'AND id IN (%s)'
|
||||
args = [tuple(ids)]
|
||||
|
@ -51,7 +52,6 @@ class CompanyLDAP(orm.Model):
|
|||
""", args)
|
||||
return cr.dictfetchall()
|
||||
|
||||
|
||||
def map_ldap_attributes(self, cr, uid, conf, login, ldap_entry):
|
||||
values = super(CompanyLDAP, self).map_ldap_attributes(cr, uid, conf,
|
||||
login, ldap_entry)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<field name="arch" type="xml">
|
||||
|
||||
<field name="ldap_filter" position="after">
|
||||
<field name="name_attribute"/>
|
||||
<field name="name_attribute" placeholder="e.g. displayName"/>
|
||||
<field name="mail_attribute"/>
|
||||
</field>
|
||||
|
||||
|
|
Loading…
Reference in New Issue