equal
deleted
inserted
replaced
51 # associate the connection to the current request |
51 # associate the connection to the current request |
52 req.set_connection(cnx, user) |
52 req.set_connection(cnx, user) |
53 return cnx |
53 return cnx |
54 |
54 |
55 def login_from_email(self, login): |
55 def login_from_email(self, login): |
|
56 # XXX should not be called from web interface |
56 session = self.repo.internal_session() |
57 session = self.repo.internal_session() |
57 rset = session.execute('Any L WHERE U login L, U primary_email M, ' |
58 try: |
58 'M address %(login)s', {'login': login}) |
59 rset = session.execute('Any L WHERE U login L, U primary_email M, ' |
59 if rset.rowcount == 1: |
60 'M address %(login)s', {'login': login}) |
60 login = rset[0][0] |
61 if rset.rowcount == 1: |
|
62 login = rset[0][0] |
|
63 finally: |
|
64 session.close() |
61 return login |
65 return login |
62 |
66 |
63 def authenticate(self, req, _login=None, _password=None): |
67 def authenticate(self, req, _login=None, _password=None): |
64 """authenticate user and return corresponding user object |
68 """authenticate user and return corresponding user object |
65 |
69 |