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/attachment.rb b/app/models/attachment.rb index aa436965b..999cefdaa 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -43,7 +43,7 @@ class Attachment < ActiveRecord::Base #elasticsearch kaminari init Kaminari::Hooks.init Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari - settings index: { number_of_shards: 1 } do + settings index: { number_of_shards: 5 } do mappings dynamic: 'false' do indexes :filename, analyzer: 'smartcn',index_options: 'offsets' indexes :downloads, analyzer: 'smartcn',index_options: 'offsets' diff --git a/app/models/course.rb b/app/models/course.rb index edc5e105b..30a6bb439 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -12,7 +12,7 @@ class Course < ActiveRecord::Base #elasticsearch kaminari init Kaminari::Hooks.init Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari - settings index: { number_of_shards: 1 } do + settings index: { number_of_shards: 5 } do mappings dynamic: 'false' do indexes :name, analyzer: 'smartcn',index_options: 'offsets' indexes :description, analyzer: 'smartcn',index_options: 'offsets' diff --git a/app/models/project.rb b/app/models/project.rb index c68e73369..ff546e098 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -35,7 +35,7 @@ class Project < ActiveRecord::Base #elasticsearch kaminari init Kaminari::Hooks.init Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari - settings index: { number_of_shards: 1 } do + settings index: { number_of_shards: 5 } do mappings dynamic: 'false' do indexes :name, analyzer: 'smartcn',index_options: 'offsets' indexes :description, analyzer: 'smartcn',index_options: 'offsets' diff --git a/app/models/user.rb b/app/models/user.rb index cdec39a3d..9c437a186 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -30,7 +30,7 @@ class User < Principal #elasticsearch kaminari init Kaminari::Hooks.init Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari - settings index: { number_of_shards: 1 } do + settings index: { number_of_shards: 5 } do mappings dynamic: 'false' do indexes :login, analyzer: 'smartcn',index_options: 'offsets' indexes :firstname, analyzer: 'smartcn',index_options: 'offsets' @@ -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 diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index c2b1b509f..6e8fda92e 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -126,7 +126,7 @@ <% end %> -
请您尽早完成匿评!如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。
+请您尽早完成匿评,如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。
例如,您缺评了两份作品,则您的最终成绩将被扣除 <%= ma.course_message.homework_detail_manual.absence_penalty %> * 2 = <%= ma.course_message.homework_detail_manual.absence_penalty * 2 %>分
<% end%> @@ -209,7 +209,7 @@ -