From 52a0da83c459782e4abd24682ff1b0885b9cf3ee Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 30 Nov 2015 21:52:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BF=E5=90=8D=E7=94=A8=E6=88=B7=E7=95=99?= =?UTF-8?q?=E8=A8=80=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 2 ++ app/models/user.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 6cc622c49..c9c4dcce3 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -3,6 +3,8 @@ class WordsController < ApplicationController include ApplicationHelper before_filter :find_user, :only => [:new, :create, :destroy, :more, :back] + before_filter :require_login, :only => [:create_reply] + def create if params[:new_form][:user_message].size>0 && User.current.logged? unless params[:user_id].nil? diff --git a/app/models/user.rb b/app/models/user.rb index cdec39a3d..12be9b0f9 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -477,7 +477,7 @@ class User < Principal end if user # user is already in local database - #return nil unless user.active? + return nil if user.locked? return nil unless user.check_password?(password) else # user is not yet registered, try to authenticate with available sources