equal
deleted
inserted
replaced
58 user = self.authmanager.validate_session(req, session) |
58 user = self.authmanager.validate_session(req, session) |
59 except InvalidSession: |
59 except InvalidSession: |
60 # invalid session |
60 # invalid session |
61 self.close_session(session) |
61 self.close_session(session) |
62 raise |
62 raise |
63 # associate the connection to the current request |
|
64 req.set_session(session, user) |
|
65 return session |
63 return session |
66 |
64 |
67 def open_session(self, req): |
65 def open_session(self, req): |
68 """open and return a new session for the given request. The session is |
66 """open and return a new session for the given request. The session is |
69 also bound to the request. |
67 also bound to the request. |
72 (no authentication info found or wrong user/password) |
70 (no authentication info found or wrong user/password) |
73 """ |
71 """ |
74 cnx, login = self.authmanager.authenticate(req) |
72 cnx, login = self.authmanager.authenticate(req) |
75 session = DBAPISession(cnx, login) |
73 session = DBAPISession(cnx, login) |
76 self._sessions[session.sessionid] = session |
74 self._sessions[session.sessionid] = session |
77 # associate the connection to the current request |
|
78 req.set_session(session) |
|
79 return session |
75 return session |
80 |
76 |
81 def postlogin(self, req, session): |
77 def postlogin(self, req, session): |
82 """postlogin: the user have been related to a session |
78 """postlogin: the user have been related to a session |
83 |
79 |