diff --git a/radicale/acl/LDAP.py b/radicale/acl/LDAP.py index 7e7ed07..bb2e2e5 100644 --- a/radicale/acl/LDAP.py +++ b/radicale/acl/LDAP.py @@ -34,12 +34,7 @@ ATTRIBUTE = config.get("acl", "ldap_attribute") CONNEXION = ldap.initialize(config.get("acl", "ldap_url")) BINDDN = config.get("acl", "ldap_binddn") PASSWORD = config.get("acl", "ldap_password") - -SCOPE = ldap.SCOPE_ONELEVEL -if config.get("acl", "ldap_scope").lower() == 'subtree': - SCOPE = ldap.SCOPE_SUBTREE -elif config.get("acl", "ldap_scope").lower() == 'base': - SCOPE = ldap.SCOPE_BASE +SCOPE = getattr(ldap, "SCOPE_%s" % config.get("acl", "ldap_scope").upper()) def has_right(owner, user, password):