* replaced :controller => '' broken statements by :controller => 'welcome'
* request_uri method no more used git-svn-id: http://redmine.rubyforge.org/svn/trunk@175 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
2789b08dd0
commit
4e03668eec
@ -52,14 +52,14 @@ class AccountController < ApplicationController
|
|||||||
# Log out current user and redirect to welcome page
|
# Log out current user and redirect to welcome page
|
||||||
def logout
|
def logout
|
||||||
self.logged_in_user = nil
|
self.logged_in_user = nil
|
||||||
redirect_to :controller => ''
|
redirect_to :controller => 'welcome'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Enable user to choose a new password
|
# Enable user to choose a new password
|
||||||
def lost_password
|
def lost_password
|
||||||
if params[:token]
|
if params[:token]
|
||||||
@token = Token.find_by_action_and_value("recovery", params[:token])
|
@token = Token.find_by_action_and_value("recovery", params[:token])
|
||||||
redirect_to :controller => '' and return unless @token and !@token.expired?
|
redirect_to :controller => 'welcome' and return unless @token and !@token.expired?
|
||||||
@user = @token.user
|
@user = @token.user
|
||||||
if request.post?
|
if request.post?
|
||||||
@user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
|
@user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
|
||||||
@ -95,12 +95,12 @@ class AccountController < ApplicationController
|
|||||||
|
|
||||||
# User self-registration
|
# User self-registration
|
||||||
def register
|
def register
|
||||||
redirect_to :controller => '' and return unless Setting.self_registration?
|
redirect_to :controller => 'welcome' and return unless Setting.self_registration?
|
||||||
if params[:token]
|
if params[:token]
|
||||||
token = Token.find_by_action_and_value("register", params[:token])
|
token = Token.find_by_action_and_value("register", params[:token])
|
||||||
redirect_to :controller => '' and return unless token and !token.expired?
|
redirect_to :controller => 'welcome' and return unless token and !token.expired?
|
||||||
user = token.user
|
user = token.user
|
||||||
redirect_to :controller => '' and return unless user.status == User::STATUS_REGISTERED
|
redirect_to :controller => 'welcome' and return unless user.status == User::STATUS_REGISTERED
|
||||||
user.status = User::STATUS_ACTIVE
|
user.status = User::STATUS_ACTIVE
|
||||||
if user.save
|
if user.save
|
||||||
token.destroy
|
token.destroy
|
||||||
@ -125,7 +125,7 @@ class AccountController < ApplicationController
|
|||||||
Mailer.set_language_if_valid(@user.language)
|
Mailer.set_language_if_valid(@user.language)
|
||||||
Mailer.deliver_register(token)
|
Mailer.deliver_register(token)
|
||||||
flash[:notice] = l(:notice_account_register_done)
|
flash[:notice] = l(:notice_account_register_done)
|
||||||
redirect_to :controller => ''
|
redirect_to :controller => 'welcome' and return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -92,16 +92,16 @@ class ApplicationController < ActionController::Base
|
|||||||
# store current uri in session.
|
# store current uri in session.
|
||||||
# return to this location by calling redirect_back_or_default
|
# return to this location by calling redirect_back_or_default
|
||||||
def store_location
|
def store_location
|
||||||
session[:return_to] = request.request_uri
|
session[:return_to_params] = params
|
||||||
end
|
end
|
||||||
|
|
||||||
# move to the last store_location call or to the passed default one
|
# move to the last store_location call or to the passed default one
|
||||||
def redirect_back_or_default(default)
|
def redirect_back_or_default(default)
|
||||||
if session[:return_to].nil?
|
if session[:return_to_params].nil?
|
||||||
redirect_to default
|
redirect_to default
|
||||||
else
|
else
|
||||||
redirect_to_url session[:return_to]
|
redirect_to session[:return_to_params]
|
||||||
session[:return_to] = nil
|
session[:return_to_params] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ xml.instruct!
|
|||||||
xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
|
xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
|
||||||
xml.channel do
|
xml.channel do
|
||||||
xml.title "#{Setting.app_title}: #{l(:label_news_latest)}"
|
xml.title "#{Setting.app_title}: #{l(:label_news_latest)}"
|
||||||
xml.link url_for(:controller => '', :only_path => false)
|
xml.link url_for(:controller => 'welcome', :only_path => false)
|
||||||
xml.pubDate CGI.rfc1123_date(@news.first.created_on)
|
xml.pubDate CGI.rfc1123_date(@news.first.created_on)
|
||||||
xml.description l(:label_news_latest)
|
xml.description l(:label_news_latest)
|
||||||
@news.each do |news|
|
@news.each do |news|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
<div id="navigation">
|
<div id="navigation">
|
||||||
<ul>
|
<ul>
|
||||||
<li><%= link_to l(:label_home), { :controller => '' }, :class => "icon icon-home" %></li>
|
<li><%= link_to l(:label_home), { :controller => 'welcome' }, :class => "icon icon-home" %></li>
|
||||||
<li><%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => "icon icon-mypage" %></li>
|
<li><%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => "icon icon-mypage" %></li>
|
||||||
<li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "icon icon-projects" %></li>
|
<li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "icon icon-projects" %></li>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user