equal
deleted
inserted
replaced
119 |
119 |
120 def effective_principals(self, request): |
120 def effective_principals(self, request): |
121 return () |
121 return () |
122 |
122 |
123 def remember(self, request, principal, **kw): |
123 def remember(self, request, principal, **kw): |
124 try: |
124 repo = request.registry['cubicweb.repository'] |
125 repo = request.registry['cubicweb.repository'] |
125 with repo.internal_cnx() as cnx: |
126 with repo.internal_cnx() as cnx: |
126 try: |
127 cnx.execute( |
127 cnx.execute( |
128 "SET U last_login_time %(now)s WHERE U eid %(user)s", { |
128 "SET U last_login_time %(now)s WHERE U eid %(user)s", { |
129 'now': datetime.datetime.now(), |
129 'now': datetime.datetime.now(), |
130 'user': principal}) |
130 'user': principal}) |
131 cnx.commit() |
131 cnx.commit() |
132 except: |
132 except Exception: |
133 log.exception("Failed to update last_login_time") |
133 log.exception("Failed to update last_login_time") |
134 return () |
134 return () |
135 |
135 |
136 def forget(self, request): |
136 def forget(self, request): |
137 return () |
137 return () |
138 |
138 |