FIX 修复home主页链接错误问题
This commit is contained in:
parent
80b64f260d
commit
0cc06409c1
|
@ -447,8 +447,8 @@ class AccountController < ApplicationController
|
||||||
call_hook(:controller_account_success_authentication_after, {:user => user })
|
call_hook(:controller_account_success_authentication_after, {:user => user })
|
||||||
|
|
||||||
code = /\d*/
|
code = /\d*/
|
||||||
#根据home_url生产正则表达式
|
#根据homes_url生产正则表达式
|
||||||
eval("code = " + "/^" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index\\\/*.*)?\$/")
|
eval("code = " + "/^" + homes_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index\\\/*.*)?\$/")
|
||||||
if (code=~params[:back_url] || params[:back_url].to_s.include?('lost_password')) && last_login_on != ''
|
if (code=~params[:back_url] || params[:back_url].to_s.include?('lost_password')) && last_login_on != ''
|
||||||
redirect_to user_activities_path(user,host: Setting.host_user)
|
redirect_to user_activities_path(user,host: Setting.host_user)
|
||||||
elsif params[:back_url64]
|
elsif params[:back_url64]
|
||||||
|
|
|
@ -2,7 +2,7 @@ xml.instruct!
|
||||||
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
|
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
|
||||||
xml.title @title
|
xml.title @title
|
||||||
xml.link "rel" => "self", "href" => url_for(:format => 'atom', :key => User.current.rss_key, :only_path => false)
|
xml.link "rel" => "self", "href" => url_for(:format => 'atom', :key => User.current.rss_key, :only_path => false)
|
||||||
xml.link "rel" => "alternate", "href" => home_url(:only_path => false)
|
xml.link "rel" => "alternate", "href" => homes_url(:only_path => false)
|
||||||
xml.id url_for(:controller => 'welcome', :only_path => false)
|
xml.id url_for(:controller => 'welcome', :only_path => false)
|
||||||
xml.updated((@journals.first ? @journals.first.event_datetime : Time.now).xmlschema)
|
xml.updated((@journals.first ? @journals.first.event_datetime : Time.now).xmlschema)
|
||||||
xml.author { xml.name "#{Setting.app_title}" }
|
xml.author { xml.name "#{Setting.app_title}" }
|
||||||
|
|
|
@ -48,7 +48,7 @@ class AccountControllerOpenidTest < ActionController::TestCase
|
||||||
def test_login_with_invalid_openid_provider
|
def test_login_with_invalid_openid_provider
|
||||||
Setting.self_registration = '0'
|
Setting.self_registration = '0'
|
||||||
post :login, :openid_url => 'http;//openid.example.com/good_user'
|
post :login, :openid_url => 'http;//openid.example.com/good_user'
|
||||||
assert_redirected_to home_url
|
assert_redirected_to homes_url
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_login_with_openid_for_existing_non_active_user
|
def test_login_with_openid_for_existing_non_active_user
|
||||||
|
@ -78,7 +78,7 @@ class AccountControllerOpenidTest < ActionController::TestCase
|
||||||
def test_login_with_openid_with_new_user_and_self_registration_off
|
def test_login_with_openid_with_new_user_and_self_registration_off
|
||||||
Setting.self_registration = '0'
|
Setting.self_registration = '0'
|
||||||
post :login, :openid_url => 'http://openid.example.com/good_user'
|
post :login, :openid_url => 'http://openid.example.com/good_user'
|
||||||
assert_redirected_to home_url
|
assert_redirected_to homes_url
|
||||||
user = User.find_by_login('cool_user')
|
user = User.find_by_login('cool_user')
|
||||||
assert_nil user
|
assert_nil user
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue