From a794d612afe07a4332a1e5e76b3e9667b0cd6454 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 15:53:28 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BB=8E=E4=B8=BB=E9=A1=B5=E7=99=BB?= =?UTF-8?q?=E9=99=86=E6=97=B6=E8=B7=B3=E8=BD=AC=E5=88=B0=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 769214d65..039080dad 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -31,9 +31,9 @@ class AccountController < ApplicationController else authenticate_user end - rescue AuthSourceException => e - logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" - render_error :message => e.message + #rescue AuthSourceException => e + # logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" + # render_error :message => e.message end # Log out current user and redirect to welcome page @@ -261,9 +261,18 @@ class AccountController < ApplicationController end call_hook(:controller_account_success_authentication_after, {:user => user }) #by young -# redirect_back_or_default my_page_path - redirect_back_or_default User.current -# redirect_to User.current + code = // + #根据home_url生产正则表达式 + class_eval("code = " + "/" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index)?\/") + if code.match(params[:back_url]) + redirect_to user_activities_path(user) + else + #redirect_back_or_default my_page_path + redirect_back_or_default User.current + #redirect_to User.current + end + + end def set_autologin_cookie(user) From 06706b577da09742f49ae552242512fab9617dca Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 16:27:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E3=80=81=E8=AE=A8?= =?UTF-8?q?=E8=AE=BA=E5=8C=BA=E5=9B=9E=E5=A4=8D=E7=9A=84=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/show.html.erb | 4 ++-- app/views/messages/show.html.erb | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index a40ee631a..642d71649 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -65,7 +65,7 @@ <% pages_count = @reply_pages.offset %> <% @replies.each do |reply| %>
"> -

<%= pages_count += 1 %>楼 :

+

+ <%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %>
<%= link_to( @@ -150,7 +151,7 @@
- <%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %> +
<%= textilizable message, :content, :attachments => message.attachments %> From 03dbcb116879dcda1b8f51cfafa316534e4c3c98 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 17:33:01 +0800 Subject: [PATCH 3/3] acount --- app/controllers/account_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 039080dad..5e9a0bc40 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -31,9 +31,9 @@ class AccountController < ApplicationController else authenticate_user end - #rescue AuthSourceException => e - # logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" - # render_error :message => e.message + rescue AuthSourceException => e + logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" + render_error :message => e.message end # Log out current user and redirect to welcome page