Ejemplo n.º 1
0
    def POST(self):
        
        # Reads the form parameters & the previously requested path (if any)
        http_input = web.input(next="/")
        email = http_input.email
        password = http_input.password
        requested_path = http_input.next
        #TODO: horrible fix to circumvent encoding problems
        persistent = any(key.startswith("Rester") for key in http_input)

        # Tries to log in, and redirects to the previously requested path (if any)
        if config.session_manager.maybe_login(email, password, persistent):
            raise web.seeother(requested_path)
        else:
            login_form = user_forms.login_form(email, persistent)
            login_form.valid = False

            return config.views.layout(config.views.login(login_form, user_forms.recover_password_form()))
Ejemplo n.º 2
0
    def POST(self):

        # Reads the form parameters & the previously requested path (if any)
        http_input = web.input(next="/")
        email = http_input.email
        password = http_input.password
        requested_path = http_input.next
        #TODO: horrible fix to circumvent encoding problems
        persistent = any(key.startswith("Rester") for key in http_input)

        # Tries to log in, and redirects to the previously requested path (if any)
        if config.session_manager.maybe_login(email, password, persistent):
            raise web.seeother(requested_path)
        else:
            login_form = user_forms.login_form(email, persistent)
            login_form.valid = False

            return config.views.layout(
                config.views.login(login_form,
                                   user_forms.recover_password_form()))
Ejemplo n.º 3
0
 def GET(self):
     return config.views.layout(config.views.login(user_forms.login_form(), user_forms.recover_password_form()))
Ejemplo n.º 4
0
 def GET(self):
     return config.views.layout(
         config.views.login(user_forms.login_form(),
                            user_forms.recover_password_form()))