Browse Source

Raise an ConfigurationError if ldap_group_enabled is set to True

Bastien Sevajol 9 years ago
parent
commit
7c49d12fc3
2 changed files with 6 additions and 0 deletions
  1. 2 0
      tracim/tracim/lib/auth/ldap.py
  2. 4 0
      tracim/tracim/lib/exception.py

+ 2 - 0
tracim/tracim/lib/auth/ldap.py View File

@@ -5,6 +5,7 @@ from who_ldap import LDAPGroupsPlugin as BaseLDAPGroupsPlugin
5 5
 from who_ldap import LDAPSearchAuthenticatorPlugin as BaseLDAPSearchAuthenticatorPlugin
6 6
 
7 7
 from tracim.lib.auth.base import Auth
8
+from tracim.lib.exception import ConfigurationError
8 9
 from tracim.lib.helpers import ini_conf_to_bool
9 10
 from tracim.lib.user import UserApi
10 11
 from tracim.model import DBSession, User
@@ -33,6 +34,7 @@ class LDAPAuth(Auth):
33 34
 
34 35
         mdproviders = [('ldapuser', self.ldap_user_provider)]
35 36
         if ini_conf_to_bool(self._config.get('ldap_group_enabled', False)):
37
+            raise ConfigurationError("ldap_group_enabled is not yet available")
36 38
             mdproviders.append(('ldapgroups', self.ldap_groups_provider))
37 39
         self._config['sa_auth'].mdproviders = mdproviders
38 40
 

+ 4 - 0
tracim/tracim/lib/exception.py View File

@@ -5,6 +5,10 @@ class TracimError(Exception):
5 5
     pass
6 6
 
7 7
 
8
+class ConfigurationError(TracimError):
9
+    pass
10
+
11
+
8 12
 class AlreadyExistError(TracimError):
9 13
     pass
10 14