[ldap_crans] On stocke l'utilisateur courant en mémoire de CransLdap
This commit is contained in:
parent
a21406f50e
commit
0e01dba9a8
1 changed files with 4 additions and 2 deletions
|
@ -28,6 +28,8 @@ from unicodedata import normalize
|
|||
import secrets_new as secrets
|
||||
import ridtools
|
||||
from user_tests import isadm
|
||||
import getpass
|
||||
cur_user = os.getenv("SUDO_USER") or os.getenv("USER") or os.getenv("LOGNAME") or getpass.getuser()
|
||||
|
||||
date_format = '%d/%m/%Y %H:%M'
|
||||
date_format_new = '%d/%m/%Y %H:%M:%S'
|
||||
|
@ -41,8 +43,6 @@ random.seed() # On initialise le générateur aléatoire
|
|||
|
||||
test_hosts = tuple()
|
||||
|
||||
cur_user = os.getenv('SUDO_USER') or pwd.getpwuid(os.getuid())[0]
|
||||
|
||||
if __name__ == 'ldap_crans_test' or os.environ.get('crans_ldap', '') == 'test':
|
||||
if hostname != "vo":
|
||||
raise ImportError, coul("La base de test n'est accessible que depuis vo !", "rouge")
|
||||
|
@ -392,6 +392,7 @@ class CransLdap:
|
|||
search_champs = {}
|
||||
for i in auto_search_champs.keys():
|
||||
search_champs[i] = auto_search_champs[i] + non_auto_search_champs[i]
|
||||
del i
|
||||
|
||||
# Profondeur des différentes recherches (scope)
|
||||
scope = { 'adherent': 1,
|
||||
|
@ -403,6 +404,7 @@ class CransLdap:
|
|||
'facture': 2}
|
||||
|
||||
def __init__(self, readonly=False):
|
||||
self.cur_user = cur_user
|
||||
self.connect(readonly)
|
||||
|
||||
def __del__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue