You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.9 KiB

11 years ago
11 years ago
11 years ago
11 years ago
  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
  5. # All Right Reserved
  6. #
  7. # Author : Nicolas Bessi (Camptocamp), Thanks to Laurent Lauden for his code adaptation
  8. # Active directory Donor: M. Benadiba (Informatique Assistances.fr)
  9. # Contribution : Joel Grand-Guillaume
  10. #
  11. # WARNING: This program as such is intended to be used by professional
  12. # programmers who take the whole responsability of assessing all potential
  13. # consequences resulting from its eventual inadequacies and bugs
  14. # End users who are looking for a ready-to-use solution with commercial
  15. # garantees and support are strongly adviced to contract a Free Software
  16. # Service Company
  17. #
  18. # This program is Free Software; you can redistribute it and/or
  19. # modify it under the terms of the GNU General Public License
  20. # as published by the Free Software Foundation; either version 2
  21. # of the License, or (at your option) any later version.
  22. #
  23. # This program is distributed in the hope that it will be useful,
  24. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. # GNU General Public License for more details.
  27. #
  28. # You should have received a copy of the GNU General Public License
  29. # along with this program; if not, write to the Free Software
  30. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  31. #
  32. ##############################################################################
  33. from osv import osv, fields
  34. class Res_company(osv.osv):
  35. """Defin ldap connexion parameters"""
  36. _inherit = 'res.company'
  37. _columns = {
  38. 'base_dn': fields.char(
  39. 'User dn',
  40. size=128,
  41. help="Exemple: cn=contacts_admin,dc=ldap,dc=dcc2c"
  42. ),
  43. 'contact_dn': fields.char(
  44. 'Bind dn',
  45. size=128,
  46. help="Exemple: dc=ldap,dc=dcc2c -- watchout"
  47. " the OU will be automatically included inside"
  48. ),
  49. 'ounit': fields.char(
  50. 'Contact Organizational unit of the contacts',
  51. size=128,
  52. help="Exemple: Contacts"
  53. ),
  54. 'ldap_server': fields.char(
  55. 'Server address',
  56. size=128,
  57. help="Exemple: ldap.camptocamp.com"
  58. ),
  59. 'passwd': fields.char('ldap password', size=128, help="Exemple: Mypassword1234"),
  60. 'ldap_active': fields.boolean(
  61. 'Activate ldap link for this company',
  62. help='If not check nothing will be reported into the ldap'
  63. ),
  64. 'is_activedir': fields.boolean(
  65. 'Active Directory ?',
  66. help='The ldap is part of an Active Directory'
  67. ),
  68. 'ldap_port': fields.integer('LDAP Port',
  69. help="If not specified, the default port"
  70. "(389), will be used")
  71. }
  72. Res_company()