Commit 0e01dba9 authored by Pierre-Elliott Bécue's avatar Pierre-Elliott Bécue
Browse files

[ldap_crans] On stocke l'utilisateur courant en mémoire de CransLdap

parent a21406f5
......@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment