@@ -52,14 +52,14 class AccountController < ApplicationController | |||||
52 | # Log out current user and redirect to welcome page |
|
52 | # Log out current user and redirect to welcome page | |
53 | def logout |
|
53 | def logout | |
54 | self.logged_in_user = nil |
|
54 | self.logged_in_user = nil | |
55 | redirect_to :controller => '' |
|
55 | redirect_to :controller => 'welcome' | |
56 | end |
|
56 | end | |
57 |
|
57 | |||
58 | # Enable user to choose a new password |
|
58 | # Enable user to choose a new password | |
59 | def lost_password |
|
59 | def lost_password | |
60 | if params[:token] |
|
60 | if params[:token] | |
61 | @token = Token.find_by_action_and_value("recovery", params[:token]) |
|
61 | @token = Token.find_by_action_and_value("recovery", params[:token]) | |
62 | redirect_to :controller => '' and return unless @token and !@token.expired? |
|
62 | redirect_to :controller => 'welcome' and return unless @token and !@token.expired? | |
63 | @user = @token.user |
|
63 | @user = @token.user | |
64 | if request.post? |
|
64 | if request.post? | |
65 | @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation] |
|
65 | @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation] | |
@@ -95,12 +95,12 class AccountController < ApplicationController | |||||
95 |
|
95 | |||
96 | # User self-registration |
|
96 | # User self-registration | |
97 | def register |
|
97 | def register | |
98 | redirect_to :controller => '' and return unless Setting.self_registration? |
|
98 | redirect_to :controller => 'welcome' and return unless Setting.self_registration? | |
99 | if params[:token] |
|
99 | if params[:token] | |
100 | token = Token.find_by_action_and_value("register", params[:token]) |
|
100 | token = Token.find_by_action_and_value("register", params[:token]) | |
101 | redirect_to :controller => '' and return unless token and !token.expired? |
|
101 | redirect_to :controller => 'welcome' and return unless token and !token.expired? | |
102 | user = token.user |
|
102 | user = token.user | |
103 | redirect_to :controller => '' and return unless user.status == User::STATUS_REGISTERED |
|
103 | redirect_to :controller => 'welcome' and return unless user.status == User::STATUS_REGISTERED | |
104 | user.status = User::STATUS_ACTIVE |
|
104 | user.status = User::STATUS_ACTIVE | |
105 | if user.save |
|
105 | if user.save | |
106 | token.destroy |
|
106 | token.destroy | |
@@ -125,7 +125,7 class AccountController < ApplicationController | |||||
125 | Mailer.set_language_if_valid(@user.language) |
|
125 | Mailer.set_language_if_valid(@user.language) | |
126 | Mailer.deliver_register(token) |
|
126 | Mailer.deliver_register(token) | |
127 | flash[:notice] = l(:notice_account_register_done) |
|
127 | flash[:notice] = l(:notice_account_register_done) | |
128 | redirect_to :controller => '' |
|
128 | redirect_to :controller => 'welcome' and return | |
129 | end |
|
129 | end | |
130 | end |
|
130 | end | |
131 | end |
|
131 | end |
@@ -92,16 +92,16 class ApplicationController < ActionController::Base | |||||
92 | # store current uri in session. |
|
92 | # store current uri in session. | |
93 | # return to this location by calling redirect_back_or_default |
|
93 | # return to this location by calling redirect_back_or_default | |
94 | def store_location |
|
94 | def store_location | |
95 |
session[:return_to] = |
|
95 | session[:return_to_params] = params | |
96 | end |
|
96 | end | |
97 |
|
97 | |||
98 | # move to the last store_location call or to the passed default one |
|
98 | # move to the last store_location call or to the passed default one | |
99 | def redirect_back_or_default(default) |
|
99 | def redirect_back_or_default(default) | |
100 | if session[:return_to].nil? |
|
100 | if session[:return_to_params].nil? | |
101 | redirect_to default |
|
101 | redirect_to default | |
102 | else |
|
102 | else | |
103 |
redirect_to |
|
103 | redirect_to session[:return_to_params] | |
104 | session[:return_to] = nil |
|
104 | session[:return_to_params] = nil | |
105 | end |
|
105 | end | |
106 | end |
|
106 | end | |
107 |
|
107 |
@@ -2,7 +2,7 xml.instruct! | |||||
2 | xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do |
|
2 | xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do | |
3 | xml.channel do |
|
3 | xml.channel do | |
4 | xml.title "#{Setting.app_title}: #{l(:label_news_latest)}" |
|
4 | xml.title "#{Setting.app_title}: #{l(:label_news_latest)}" | |
5 | xml.link url_for(:controller => '', :only_path => false) |
|
5 | xml.link url_for(:controller => 'welcome', :only_path => false) | |
6 | xml.pubDate CGI.rfc1123_date(@news.first.created_on) |
|
6 | xml.pubDate CGI.rfc1123_date(@news.first.created_on) | |
7 | xml.description l(:label_news_latest) |
|
7 | xml.description l(:label_news_latest) | |
8 | @news.each do |news| |
|
8 | @news.each do |news| |
@@ -33,7 +33,7 | |||||
33 |
|
33 | |||
34 | <div id="navigation"> |
|
34 | <div id="navigation"> | |
35 | <ul> |
|
35 | <ul> | |
36 | <li><%= link_to l(:label_home), { :controller => '' }, :class => "icon icon-home" %></li> |
|
36 | <li><%= link_to l(:label_home), { :controller => 'welcome' }, :class => "icon icon-home" %></li> | |
37 | <li><%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => "icon icon-mypage" %></li> |
|
37 | <li><%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => "icon icon-mypage" %></li> | |
38 | <li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "icon icon-projects" %></li> |
|
38 | <li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "icon icon-projects" %></li> | |
39 |
|
39 |
General Comments 0
You need to be logged in to leave comments.
Login now