From 5b9ba8611d87d56f00f90c6f604fe80142364d79 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 13 Feb 2013 00:21:56 +0100 Subject: [PATCH] Fixed syntax error. --- app/models/user.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 6bb544842..c88b0b1a5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -82,19 +82,21 @@ class User < ApplicationModel if user_auth # remember last login date - user.update_last_login + user_auth.update_last_login # reset login failed - user.login_failed = 0 - user.save + user_auth.login_failed = 0 + user_auth.save return user_auth end } # set login failed +1 - user.login_failed = user.login_failed + 1 - user.save + if !user_auth && user + user.login_failed = user.login_failed + 1 + user.save + end # auth failed sleep 1