Example #1
0
 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())
Example #2
0
 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())
Example #3
0
 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())
Example #4
0
 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())
Example #5
0
 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())
Example #6
0
 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())
Example #7
0
 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())
Example #8
0
    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)
Example #9
0
 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())
Example #10
0
    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)
Example #11
0
                    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)
Example #12
0
                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)