server/sources/ldapfeed.py
changeset 8188 1867e252e487
child 8229 b7bc631816f7
equal deleted inserted replaced
8187:981f6e487788 8188:1867e252e487
       
     1 # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
       
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
       
     3 #
       
     4 # This file is part of CubicWeb.
       
     5 #
       
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
       
     7 # terms of the GNU Lesser General Public License as published by the Free
       
     8 # Software Foundation, either version 2.1 of the License, or (at your option)
       
     9 # any later version.
       
    10 #
       
    11 # CubicWeb is distributed in the hope that it will be useful, but WITHOUT
       
    12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
       
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
       
    14 # details.
       
    15 #
       
    16 # You should have received a copy of the GNU Lesser General Public License along
       
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
       
    18 """cubicweb ldap feed source
       
    19 
       
    20 unlike ldapuser source, this source is copy based and will import ldap content
       
    21 (beside passwords for authentication) into the system source.
       
    22 """
       
    23 
       
    24 from cubicweb.server.sources import datafeed
       
    25 from cubicweb.server import ldaputils
       
    26 
       
    27 
       
    28 class LDAPFeedSource(ldaputils.LDAPSourceMixIn,
       
    29                      datafeed.DataFeedSource):
       
    30     """LDAP feed source"""
       
    31     use_cwuri_as_url = True
       
    32 
       
    33     options = datafeed.DataFeedSource.options + ldaputils.LDAPSourceMixIn.options
       
    34 
       
    35     def update_config(self, source_entity, typedconfig):
       
    36         """update configuration from source entity. `typedconfig` is config
       
    37         properly typed with defaults set
       
    38         """
       
    39         datafeed.DataFeedSource.update_config(self, source_entity, typedconfig)
       
    40         ldaputils.LDAPSourceMixIn.update_config(self, source_entity, typedconfig)
       
    41 
       
    42     def _entity_update(self, source_entity):
       
    43         datafeed.DataFeedSource._entity_update(self, source_entity)
       
    44         ldaputils.LDAPSourceMixIn._entity_update(self, source_entity)
       
    45