Project

General

Profile

« Previous | Next » 

Revision 22eeae99

Added by Thomas Noël over 13 years ago

don't crash if ldap is not available (fix #1620)

View differences:

extra/modules/ezldap.py
entry.
'''
import ldap
import ldap.modlist
try:
import ldap
import ldap.modlist
except ImportError:
ldap = None
LDAP_EMAIL = 'courriel'
import time
extra/modules/ezldap_ui.ptl
entry.
'''
# FIXME: try/except
import ldap
import ldap.modlist
try:
import ldap
import ldap.modlist
except ImportError:
ldap = None
import base64
import datetime
......
misc_cfg = get_cfg('misc', {})
ldap_url = misc_cfg.get('aq-ezldap-url')
if not get_publisher().has_site_option('ezldap') or not ldap_url:
if (ldap is None) or (not ldap_url) or (not get_publisher().has_site_option('ezldap')):
# no ldap: restore non monkey patched classes & dir
get_publisher().user_class = User
restore_legacy_root(root_directory)

Also available in: Unified diff