|
Lines 45-55
Link Here
|
| 45 |
from functools import wraps |
45 |
from functools import wraps |
| 46 |
import re |
46 |
import re |
| 47 |
import inspect |
47 |
import inspect |
|
|
48 |
import ldap |
| 48 |
from ldap.filter import escape_filter_chars, filter_format |
49 |
from ldap.filter import escape_filter_chars, filter_format |
| 49 |
|
50 |
|
| 50 |
from univention.management.console.config import ucr |
51 |
from univention.management.console.config import ucr |
| 51 |
from univention.management.console.log import MODULE |
52 |
from univention.management.console.log import MODULE |
| 52 |
from univention.management.console.ldap import get_machine_connection, get_admin_connection, get_user_connection # , reset_cache as reset_connection_cache |
53 |
from univention.management.console.ldap import get_machine_connection, get_admin_connection, get_user_connection, reset_cache as reset_connection_cache |
| 53 |
from univention.management.console.modules import Base, UMC_Error |
54 |
from univention.management.console.modules import Base, UMC_Error |
| 54 |
from univention.management.console.modules.decorators import sanitize |
55 |
from univention.management.console.modules.decorators import sanitize |
| 55 |
from univention.management.console.modules.sanitizers import StringSanitizer |
56 |
from univention.management.console.modules.sanitizers import StringSanitizer |
|
Lines 143-156
def wrapper_func(*args, **kwargs):
Link Here
|
| 143 |
school = LDAP_Connection._school |
144 |
school = LDAP_Connection._school |
| 144 |
kwargs['search_base'] = School.get_search_base(school) |
145 |
kwargs['search_base'] = School.get_search_base(school) |
| 145 |
return func(*args, **kwargs) |
146 |
return func(*args, **kwargs) |
| 146 |
return wraps(func)(wrapper_func) |
147 |
|
| 147 |
# def decorated(*args, **kwargs): |
148 |
def decorated(*args, **kwargs): |
| 148 |
# try: |
149 |
try: |
| 149 |
# return wrapper_func(*args, **kwargs) |
150 |
return wrapper_func(*args, **kwargs) |
| 150 |
# except ldap.INVALID_CREDENTIALS: |
151 |
except ldap.LDAPError: |
| 151 |
# reset_connection_cache() |
152 |
reset_connection_cache() |
| 152 |
# return wrapper_func(*args, **kwargs) |
153 |
return wrapper_func(*args, **kwargs) |
| 153 |
# return wraps(func)(decorated) |
154 |
return wraps(func)(decorated) |
| 154 |
return inner_wrapper |
155 |
return inner_wrapper |
| 155 |
|
156 |
|
| 156 |
|
157 |
|