From 85cc4c39229923cdc23184f4f49c8397958442ca Mon Sep 17 00:00:00 2001 From: "mayur maheshwari (Open ERP)" Date: Mon, 6 Jun 2011 10:18:46 +0530 Subject: [PATCH] [ADD]users_ldap:add a missing file installer.py nad xml in user_ldap bzr revid: mma@tinyerp.com-20110606044846-nnmzb8kyfnmonyjr --- addons/users_ldap/installer.py | 55 +++++++++++++++++++++++ addons/users_ldap/user_ldap_installer.xml | 53 ++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 addons/users_ldap/installer.py create mode 100644 addons/users_ldap/user_ldap_installer.xml diff --git a/addons/users_ldap/installer.py b/addons/users_ldap/installer.py new file mode 100644 index 00000000000..d9ae1963ae0 --- /dev/null +++ b/addons/users_ldap/installer.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from osv import fields, osv +import pooler +import tools +import logging +from service import security +import ldap +from ldap.filter import filter_format + +class ldap_installer(osv.osv): + _name = 'ldap.installer' + _order = 'sequence' + _rec_name = 'ldap_server' + _columns = { + 'sequence': fields.integer('Sequence'), + 'company': fields.many2one('res.company', 'Company', required=True, + ondelete='cascade'), + 'ldap_server': fields.char('LDAP Server address', size=64, required=True), + 'ldap_server_port': fields.integer('LDAP Server port', required=True), + 'ldap_binddn': fields.char('LDAP binddn', size=64, required=True), + 'ldap_password': fields.char('LDAP password', size=64, required=True), + 'ldap_filter': fields.char('LDAP filter', size=64, required=True), + 'ldap_base': fields.char('LDAP base', size=64, required=True), + 'user': fields.many2one('res.users', 'Model User', + help="Model used for user creation"), + 'create_user': fields.boolean('Create user', + help="Create the user if not in database"), + } + _defaults = { + 'ldap_server': lambda *a: '127.0.0.1', + 'ldap_server_port': lambda *a: 389, + 'sequence': lambda *a: 10, + 'create_user': lambda *a: True, + } + +ldap_installer() diff --git a/addons/users_ldap/user_ldap_installer.xml b/addons/users_ldap/user_ldap_installer.xml new file mode 100644 index 00000000000..76628159824 --- /dev/null +++ b/addons/users_ldap/user_ldap_installer.xml @@ -0,0 +1,53 @@ + + + + + + ldap.installer.form + ldap.installer + form + +
+ + + + + + + + + + + + +
+ + + ldap.installer.tree + ldap.installer + tree + + + + + + + + + + + Setup your ldap configuration + ir.actions.act_window + ldap.installer + form + tree,form + + + + + normal + current + skip + +
+