##// END OF EJS Templates
Added a named route for the home page....
Jean-Philippe Lang -
r749:650888c73b73
parent child
Show More
@@ -63,15 +63,15 class AccountController < ApplicationController
63 cookies.delete :autologin
63 cookies.delete :autologin
64 Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) if User.current.logged?
64 Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) if User.current.logged?
65 self.logged_user = nil
65 self.logged_user = nil
66 redirect_to :controller => 'welcome'
66 redirect_to home_url
67 end
67 end
68
68
69 # Enable user to choose a new password
69 # Enable user to choose a new password
70 def lost_password
70 def lost_password
71 redirect_to :controller => 'welcome' and return unless Setting.lost_password?
71 redirect_to(home_url) && return unless Setting.lost_password?
72 if params[:token]
72 if params[:token]
73 @token = Token.find_by_action_and_value("recovery", params[:token])
73 @token = Token.find_by_action_and_value("recovery", params[:token])
74 redirect_to :controller => 'welcome' and return unless @token and !@token.expired?
74 redirect_to(home_url) && return unless @token and !@token.expired?
75 @user = @token.user
75 @user = @token.user
76 if request.post?
76 if request.post?
77 @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
77 @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
@@ -105,12 +105,12 class AccountController < ApplicationController
105
105
106 # User self-registration
106 # User self-registration
107 def register
107 def register
108 redirect_to :controller => 'welcome' and return unless Setting.self_registration?
108 redirect_to(home_url) && return unless Setting.self_registration?
109 if params[:token]
109 if params[:token]
110 token = Token.find_by_action_and_value("register", params[:token])
110 token = Token.find_by_action_and_value("register", params[:token])
111 redirect_to :controller => 'welcome' and return unless token and !token.expired?
111 redirect_to(home_url) && return unless token and !token.expired?
112 user = token.user
112 user = token.user
113 redirect_to :controller => 'welcome' and return unless user.status == User::STATUS_REGISTERED
113 redirect_to(home_url) && return unless user.status == User::STATUS_REGISTERED
114 user.status = User::STATUS_ACTIVE
114 user.status = User::STATUS_ACTIVE
115 if user.save
115 if user.save
116 token.destroy
116 token.destroy
@@ -30,7 +30,7
30 <%= link_to(l(:label_register), :controller => 'account',:action => 'register') if Setting.self_registration? %>
30 <%= link_to(l(:label_register), :controller => 'account',:action => 'register') if Setting.self_registration? %>
31 <% end %>
31 <% end %>
32 </div>
32 </div>
33 <%= link_to l(:label_home), { :controller => 'welcome' } %>
33 <%= link_to l(:label_home), home_url %>
34 <%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'} if User.current.logged? %>
34 <%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'} if User.current.logged? %>
35 <%= link_to l(:label_project_plural), { :controller => 'projects' } %>
35 <%= link_to l(:label_project_plural), { :controller => 'projects' } %>
36 <%= link_to l(:label_administration), { :controller => 'admin' } if User.current.admin? %>
36 <%= link_to l(:label_administration), { :controller => 'admin' } if User.current.admin? %>
@@ -6,9 +6,7 ActionController::Routing::Routes.draw do |map|
6 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
6 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
7 # Keep in mind you can assign values other than :controller and :action
7 # Keep in mind you can assign values other than :controller and :action
8
8
9 # You can have the root of your site routed by hooking up ''
9 map.home '', :controller => 'welcome'
10 # -- just remember to delete public/index.html.
11 map.connect '', :controller => "welcome"
12
10
13 map.connect 'wiki/:id/:page/:action', :controller => 'wiki', :page => nil
11 map.connect 'wiki/:id/:page/:action', :controller => 'wiki', :page => nil
14 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
12 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
General Comments 0
You need to be logged in to leave comments. Login now