diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index dc1cceb87..181f76b22 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -336,9 +336,11 @@ class AccountController < ApplicationController :expires => 1.month.from_now, :path => (Redmine::Configuration['autologin_cookie_path'] || '/'), :secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false), - :domain => Redmine::Configuration['cookie_domain'], :httponly => true } + if Redmine::Configuration['cookie_domain'].present? + cookie_options = cookie_options.merge(domain: Redmine::Configuration['cookie_domain']) + end cookies[autologin_cookie_name] = cookie_options end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 88cd51d67..10e5e6f06 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -199,7 +199,11 @@ class ApplicationController < ActionController::Base # Logs out current user def logout_user if User.current.logged? - cookies.delete(autologin_cookie_name, domain: :all) + if Redmine::Configuration['cookie_domain'].present? + cookies.delete(autologin_cookie_name, domain: Redmine::Configuration['cookie_domain']) + else + cookies.delete autologin_cookie_name + end # Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) self.logged_user = nil end diff --git a/app/views/courses/homework.html.erb b/app/views/courses/homework.html.erb index 7b74351cd..32728adf0 100644 --- a/app/views/courses/homework.html.erb +++ b/app/views/courses/homework.html.erb @@ -31,7 +31,7 @@ <% end %>
diff --git a/app/views/welcome/_course_list.html.erb b/app/views/welcome/_course_list.html.erb index 111c0abb1..d51bcc8f7 100644 --- a/app/views/welcome/_course_list.html.erb +++ b/app/views/welcome/_course_list.html.erb @@ -25,7 +25,7 @@ <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %> <% end %> (<%= course.members.count %>人) - <% files_count = course.attachments.count %> + <% files_count = visable_attachemnts_incourse(course).count %> <% if files_count > 0%> (<%= link_to "#{files_count.to_s}份", course_files_path(course) %>公开资料) <% end %> diff --git a/config/configuration.yml b/config/configuration.yml index 45e307157..390754a87 100644 --- a/config/configuration.yml +++ b/config/configuration.yml @@ -90,7 +90,6 @@ default: user_name: "huang.jingquan@163.com" password: 'xinhu1ji2qu366' - cookie_domain: ".trustie.net" # Absolute path to the directory where attachments are stored. # The default is the 'files' directory in your Redmine instance. # Your Redmine instance needs to have write permission on this @@ -104,7 +103,7 @@ default: # autologin_cookie_name: the name of the cookie (default: autologin) # autologin_cookie_path: the cookie path (default: /) # autologin_cookie_secure: true sets the cookie secure flag (default: false) - autologin_cookie_name: + autologin_cookie_name: "autologin_trustie" autologin_cookie_path: autologin_cookie_secure: @@ -201,7 +200,7 @@ default: # specific configuration options for production environment # that overrides the default ones production: - # CJK support + cookie_domain: ".trustie.net" rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf email_delivery: delivery_method: :smtp diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 5333b91a7..d27895b03 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -19,7 +19,7 @@ a:hover.project_name{ color:#016f33;} a.project_txt02{ color:#0781b4; width:618px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} a:hover.project_txt{ color:#066e9a;} .noline{ border-bottom:none;} -.news_description{max-height: 38px;overflow:hidden; } +.news_description{max-height: 360px;overflow:hidden; } .news_description_none{max-height: none;} a.news_foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:600px; height:20px; padding-top:3px; cursor:pointer;} a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;}