def login(self): """ This is where the login form will be rendered The login counter will tell if the user has tried to login with the wrong credentials """ identity = request.environ.get('repoze.who.identity') came_from = str(request.GET.get('came_from', '')) or \ url(controller='account', action='welcome') if identity: redirect(url(came_from)) else: c.came_from = came_from c.login_counter = request.environ['repoze.who.logins'] + 1 if c.login_counter > 1: flash('Incorrect Username or Password','error') return render('/login.html')
def denial_handler(reason): log.info("Testing: " + str(response.status_int)) if response.status_int == 403: abort(response.status_int,detail=reason) else: flash(reason,"error")