def logout(self): """Remove the link between this identity and the visit.""" visit = self.visit_link if visit: visit.destroySelf() # Clear the current identity identity.set_current_identity(SqlObjectIdentity())
def logout(self): """Remove the link between this identity and the visit.""" visit = self.visit_link if visit: visit.delete() # Clear the current identity identity.set_current_identity(AppEngineIdentity())
def logout(self): """Remove the link between this identity and the visit.""" visit = self.visit_link if visit: session.delete(visit) session.flush() # Clear the current identity identity.set_current_identity(SqlAlchemyIdentity())
def logout(self): """Remove the link between this identity and the visit.""" store = cherrypy.thread_data.store visit = self.visit_link if visit: store.remove(visit) # Clear the current identity identity.set_current_identity(StormIdentity())
def record_request(self, visit): # default to keeping the identity hook off if not gearshift.config.get('tools.identity.on', True): log.debug("Identity is not enabled. Setting current identity to None") set_current_identity(None) return try: identity = self.identity_from_request(visit.key) except IdentityException, e: log.exception("Caught exception while getting identity from request") errors = [str(e)] raise IdentityFailure(errors)
def logout(self): """Remove the link between this identity and the visit.""" visit = self.visit_link if visit: db = datastore.db try: del db[visit.id] except ResourceNotFound: pass except ResourceConflict: pass # Clear the current identity identity.set_current_identity(CouchDbIdentity())
def record_request(self, visit): # default to keeping the identity hook off if not gearshift.config.get('tools.identity.on', True): log.debug( "Identity is not enabled. Setting current identity to None") set_current_identity(None) return try: identity = self.identity_from_request(visit.key) except IdentityException, e: log.exception( "Caught exception while getting identity from request") errors = [str(e)] raise IdentityFailure(errors)
user_name, pw, visit_key) if identity is None: log.warning("The credentials specified weren't valid") return None return identity except KeyError: log.error("Missing fields in login form") return None else: return None def record_request(self, visit): # default to keeping the identity hook off if not gearshift.config.get('tools.identity.on', True): log.debug( "Identity is not enabled. Setting current identity to None") set_current_identity(None) return try: identity = self.identity_from_request(visit.key) except IdentityException, e: log.exception( "Caught exception while getting identity from request") errors = [str(e)] raise IdentityFailure(errors) # stash the user in the thread data for this request set_current_identity(identity) set_current_provider(self.provider)
submit_y = params.pop('%s.y' % self.submit_button_name, None) set_login_attempted(True) identity = self.provider.validate_identity(user_name, pw, visit_key) if identity is None: log.warning("The credentials specified weren't valid") return None return identity except KeyError: log.error("Missing fields in login form") return None else: return None def record_request(self, visit): # default to keeping the identity hook off if not gearshift.config.get('tools.identity.on', True): log.debug("Identity is not enabled. Setting current identity to None") set_current_identity(None) return try: identity = self.identity_from_request(visit.key) except IdentityException, e: log.exception("Caught exception while getting identity from request") errors = [str(e)] raise IdentityFailure(errors) # stash the user in the thread data for this request set_current_identity(identity) set_current_provider(self.provider)