Beispiel #1
0
 def stop(self):
     """End the current active session.
     """
     request = getRequest()
     if "euphorie.session" in request.other:
         del request.other["euphorie.session"]
     deleteCookie(request.response, SESSION_COOKIE)
     setCookie(request.response, getSecret(), SESSION_COOKIE, '')
Beispiel #2
0
 def stop(self):
     """End the current active session.
     """
     request = getRequest()
     if "euphorie.session" in request.other:
         del request.other["euphorie.session"]
     deleteCookie(request.response, SESSION_COOKIE)
     setCookie(request.response, getSecret(), SESSION_COOKIE, '')
Beispiel #3
0
    def resume(self, session):
        """Activate the given session.

        :param session: session to activate
        :type session: :py:class:`euphorie.client.model.SurveySession`
        """
        request = getRequest()
        request.other["euphorie.session"] = session
        setCookie(request.response, getSecret(), SESSION_COOKIE, session.id)
Beispiel #4
0
    def resume(self, session):
        """Activate the given session.

        :param session: session to activate
        :type session: :py:class:`euphorie.client.model.SurveySession`
        """
        account = aq_base(getSecurityManager().getUser())
        if session.account is not account:
            raise ValueError('Can only resume session for current user.')

        request = getRequest()
        request.other["euphorie.session"] = session
        setCookie(request.response, getSecret(), SESSION_COOKIE, session.id)
Beispiel #5
0
    def resume(self, session):
        """Activate the given session.

        :param session: session to activate
        :type session: :py:class:`euphorie.client.model.SurveySession`
        """
        account = aq_base(getSecurityManager().getUser())
        if session.account is not account:
            raise ValueError('Can only resume session for current user.')

        request = getRequest()
        request.other["euphorie.session"] = session
        setCookie(request.response, getSecret(), SESSION_COOKIE, session.id)
Beispiel #6
0
    def start(self, title, survey, account=None):
        """Create a new session and activate it.

        :param title: title for the new session.
        :type title: unicode
        :param survey: survey for which the session is being created
        :type survey: :py:class:`euphorie.content.survey.Survey`
        :rtype: :py:class:`euphorie.client.model.SurveySession` instance
        """
        survey_session = create_survey_session(title, survey, account)
        request = getRequest()
        setCookie(request.response, getSecret(), SESSION_COOKIE,
                survey_session.id)
        request.other['euphorie.session'] = survey_session
        return survey_session
Beispiel #7
0
    def start(self, title, survey, account=None):
        """Create a new session and activate it.

        :param title: title for the new session.
        :type title: unicode
        :param survey: survey for which the session is being created
        :type survey: :py:class:`euphorie.content.survey.Survey`
        :rtype: :py:class:`euphorie.client.model.SurveySession` instance
        """
        survey_session = create_survey_session(title, survey, account)
        request = getRequest()
        setCookie(request.response, getSecret(), SESSION_COOKIE,
                  survey_session.id)
        request.other['euphorie.session'] = survey_session
        return survey_session
Beispiel #8
0
 def setCookie(self, response, secret, name, value, timeout=0):
     from euphorie.client.cookie import setCookie
     return setCookie(response, secret, name, value, timeout)
Beispiel #9
0
 def setCookie(self, response, secret, name, value, timeout=0):
     from euphorie.client.cookie import setCookie
     return setCookie(response, secret, name, value, timeout)