Lines 126-132
def query(self, request):
|
Link Here
|
---|
|
126 |
from univention.management.console.ldap import get_user_connection, reset_cache as reset_ldap_connection_cache |
126 |
from univention.management.console.ldap import get_user_connection, reset_cache as reset_ldap_connection_cache |
127 |
from univention.management.console.config import ucr |
127 |
from univention.management.console.config import ucr |
128 |
from univention.management.console.log import MODULE, CORE |
128 |
from univention.management.console.log import MODULE, CORE |
129 |
from univention.management.console.error import UMC_Error, NotAcceptable, PasswordRequired, LDAP_ServerDown, LDAP_ConnectionFailed, Unauthorized |
129 |
from univention.management.console.error import UMC_Error, NotAcceptable, PasswordRequired, LDAP_ServerDown, LDAP_ConnectionFailed |
130 |
|
130 |
|
131 |
_ = Translation('univention.management.console').translate |
131 |
_ = Translation('univention.management.console').translate |
132 |
|
132 |
|
Lines 299-315
def error_handling(self, etype, exc, etraceback):
|
Link Here
|
---|
|
299 |
:param exc: The exception instance. |
299 |
:param exc: The exception instance. |
300 |
:param etraceback: The exception traceback instance; may be None. |
300 |
:param etraceback: The exception traceback instance; may be None. |
301 |
""" |
301 |
""" |
302 |
if isinstance(exc, udm_errors.ldapError) and isinstance(getattr(exc, 'original_exception', None), ldap.SERVER_DOWN): |
302 |
if isinstance(exc, udm_errors.ldapError) and isinstance(getattr(exc, 'original_exception', None), (ldap.SERVER_DOWN, ldap.INVALID_CREDENTIALS)): |
303 |
exc = exc.original_exception |
|
|
304 |
if isinstance(exc, udm_errors.ldapError) and isinstance(getattr(exc, 'original_exception', None), ldap.INVALID_CREDENTIALS): |
305 |
exc = exc.original_exception |
303 |
exc = exc.original_exception |
306 |
if isinstance(exc, ldap.SERVER_DOWN): |
304 |
if isinstance(exc, ldap.SERVER_DOWN): |
307 |
raise LDAP_ServerDown() |
305 |
raise LDAP_ServerDown() |
308 |
if isinstance(exc, ldap.CONNECT_ERROR): |
306 |
if isinstance(exc, (ldap.CONNECT_ERROR, ldap.INVALID_CREDENTIALS)): |
309 |
raise LDAP_ConnectionFailed(exc) |
307 |
raise LDAP_ConnectionFailed(exc) |
310 |
if isinstance(exc, ldap.INVALID_CREDENTIALS): |
308 |
if isinstance(exc, ldap.INVALID_CREDENTIALS): |
311 |
reset_ldap_connection_cache() |
309 |
reset_ldap_connection_cache() |
312 |
raise Unauthorized |
|
|
313 |
|
310 |
|
314 |
def __error_handling(self, request, method, etype, exc, etraceback): |
311 |
def __error_handling(self, request, method, etype, exc, etraceback): |
315 |
""" |
312 |
""" |