Commit 9492f584 authored by glondu's avatar glondu

Pour viter les problmes d'authentification, on ouvre une nouvelle

connexion  la base LDAP  chaque authentification.

darcs-hash:20061213181047-68412-f41c971d417a0374945e56b459fc702cb99ec560.gz
parent e6782d03
......@@ -74,14 +74,14 @@ if (options.port):
cherrypy.config.update(settings)
# import du crans_ldap qu'il va bien
# import du CransLdap qu'il va bien (on utilise CransLdap et non crans_ldap car on veut
# forcer l'ouverture d'une nouvelle connexion chaque login)
if (cherrypy.config.configMap["global"]["server.environment"] == "development"):
from ldap_crans_test import crans_ldap
from ldap_crans_test import CransLdap
cherrypy.log("settings : unsing test ldap : env=" + cherrypy.config.configMap["global"]["server.environment"], "LDAP")
else:
from ldap_crans import crans_ldap
from ldap_crans import CransLdap
cherrypy.log("settings : unsing prod ldap : env=" + cherrypy.config.configMap["global"]["server.environment"], "LDAP")
cherrypy.config.update({'global':{'crans_ldap':crans_ldap()}})
# ######################################################## #
# FILTRES MAISON #
......@@ -95,11 +95,9 @@ from crans.mail import quickSend
# SERVER #
# ######################################################## #
class Intranet:
__ldap = None
def __init__(self):
from pages import monCompte, impression, factures, digicode, mesmachines
from pages import gestionFactures
self.__ldap = cherrypy.config.configMap["global"]["crans_ldap"]
# liste des modules disponibles
self.monCompte = monCompte.monCompte()
......@@ -233,7 +231,7 @@ def verifLogin(login = '', password = ''):
message = None
try:
if login != '' and password != '':
cherrypy.session['LDAP'] = crans_ldap()
cherrypy.session['LDAP'] = CransLdap()
LDAP = cherrypy.session['LDAP']
adh = LDAP.search('uid=' + login)['adherent'][0]
if adh.checkPassword(password):
......
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