def get(self):
        """Serve the form page.
        """
        logging.info('SelfComboPage.GET')
        logging.info('headers: %s' % self.request.headers.items())
        logging.info('params: %s' % self.request.params.items())
        logging.info('body: %s' % self.request.body)

        # Make sure (as best we can) that this is being requested from a site
        # that's allowed to embed our join form.
        # This is such a weak check that I'm not sure it's worth it.
        #if not config.DEBUG:
        #    if not self.request.referer or \
        #       urlparse(self.request.referer).hostname not in config.ALLOWED_EMBED_REFERERS:
        #        webapp2.abort(403, detail='bad referer')

        csrf_token = helpers.get_csrf_token(self.request)

        volunteer_interests = gapps.get_volunteer_interests()
        skills_categories = gapps.get_skills_categories()

        template_values = {
            'FIELDS': config.FIELDS,
            'csrf_token': csrf_token,
            'volunteer_interests': volunteer_interests,
            'skills_categories': skills_categories,
            'config': config,
        }
        template = JINJA_ENVIRONMENT.get_template('self-serve-combo.jinja')

        helpers.set_csrf_cookie(self.response, csrf_token)
        self.response.write(template.render(template_values))
Exemple #2
0
    def get(self):
        """Serve the form page.
        """
        logging.info('SelfComboPage.GET')
        logging.info('headers: %s' % self.request.headers.items())
        logging.info('params: %s' % self.request.params.items())
        logging.info('body: %s' % self.request.body)

        # Make sure (as best we can) that this is being requested from a site
        # that's allowed to embed our join form.
        # This is such a weak check that I'm not sure it's worth it.
        #if not config.DEBUG:
        #    if not self.request.referer or \
        #       urlparse(self.request.referer).hostname not in config.ALLOWED_EMBED_REFERERS:
        #        webapp2.abort(403, detail='bad referer')

        csrf_token = helpers.get_csrf_token(self.request)

        volunteer_interests = gapps.get_volunteer_interests()
        skills_categories = gapps.get_skills_categories()

        template_values = {
            'FIELDS': config.FIELDS,
            'csrf_token': csrf_token,
            'volunteer_interests': volunteer_interests,
            'skills_categories': skills_categories,
            'config': config,
        }
        template = JINJA_ENVIRONMENT.get_template('self-serve-combo.jinja')

        helpers.set_csrf_cookie(self.response, csrf_token)
        self.response.write(template.render(template_values))
Exemple #3
0
    def get(self):
        user = users.get_current_user()
        if not user:
            self.redirect(users.create_login_url(self.request.uri))
            return
        elif not gapps.is_user_authorized(user):
            self.redirect('/bad-user')
            return

        csrf_token = helpers.get_csrf_token(self.request)

        volunteer_interests = gapps.get_volunteer_interests()
        skills_categories = gapps.get_skills_categories()

        template_values = {
            'FIELDS': config.FIELDS,
            'csrf_token': csrf_token,
            'volunteer_interests': volunteer_interests,
            'skills_categories': skills_categories,
            'config': config,
        }
        template = JINJA_ENVIRONMENT.get_template('renew-member.jinja')

        helpers.set_csrf_cookie(self.response, csrf_token)
        self.response.write(template.render(template_values))
Exemple #4
0
    def get(self):
        user = users.get_current_user()
        if not user:
            self.redirect(users.create_login_url(self.request.uri))
            return
        elif not gapps.is_user_authorized(user):
            self.redirect('/bad-user')
            return

        csrf_token = helpers.get_csrf_token(self.request)

        volunteer_interests = gapps.get_volunteer_interests()
        skills_categories = gapps.get_skills_categories()

        template_values = {
            'FIELDS': config.FIELDS,
            'csrf_token': csrf_token,
            'volunteer_interests': volunteer_interests,
            'skills_categories': skills_categories,
            'config': config,
        }
        template = JINJA_ENVIRONMENT.get_template('new-member.jinja')

        helpers.set_csrf_cookie(self.response, csrf_token)
        self.response.write(template.render(template_values))
Exemple #5
0
    def get(self):
        user = users.get_current_user()
        if not user:
            self.redirect(users.create_login_url(self.request.uri))
            return
        elif not gapps.is_user_authorized(user):
            self.redirect('/bad-user')
            return

        csrf_token = helpers.get_csrf_token(self.request)

        template_values = {
            'FIELDS': config.FIELDS,
            'csrf_token': csrf_token,
            'config': config,
        }
        template = JINJA_ENVIRONMENT.get_template('authorize-user.jinja')

        helpers.set_csrf_cookie(self.response, csrf_token)
        self.response.write(template.render(template_values))
Exemple #6
0
    def get(self):
        user = users.get_current_user()
        if not user:
            self.redirect(users.create_login_url(self.request.uri))
            return
        elif not gapps.is_user_authorized(user):
            self.redirect('/bad-user')
            return

        csrf_token = helpers.get_csrf_token(self.request)

        template_values = {
            'FIELDS': config.FIELDS,
            'csrf_token': csrf_token,
            'config': config,
        }
        template = JINJA_ENVIRONMENT.get_template('authorize-user.jinja')

        helpers.set_csrf_cookie(self.response, csrf_token)
        self.response.write(template.render(template_values))