cookies.delete :autologin
Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) if User.current.logged?
self.logged_user = nil
- redirect_to :controller => 'welcome'
+ redirect_to home_url
end
# Enable user to choose a new password
def lost_password
- redirect_to :controller => 'welcome' and return unless Setting.lost_password?
+ redirect_to(home_url) && return unless Setting.lost_password?
if params[:token]
@token = Token.find_by_action_and_value("recovery", params[:token])
- redirect_to :controller => 'welcome' and return unless @token and !@token.expired?
+ redirect_to(home_url) && return unless @token and !@token.expired?
@user = @token.user
if request.post?
@user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
# User self-registration
def register
- redirect_to :controller => 'welcome' and return unless Setting.self_registration?
+ redirect_to(home_url) && return unless Setting.self_registration?
if params[:token]
token = Token.find_by_action_and_value("register", params[:token])
- redirect_to :controller => 'welcome' and return unless token and !token.expired?
+ redirect_to(home_url) && return unless token and !token.expired?
user = token.user
- redirect_to :controller => 'welcome' and return unless user.status == User::STATUS_REGISTERED
+ redirect_to(home_url) && return unless user.status == User::STATUS_REGISTERED
user.status = User::STATUS_ACTIVE
if user.save
token.destroy
<%= link_to(l(:label_register), :controller => 'account',:action => 'register') if Setting.self_registration? %>
<% end %>
</div>
- <%= link_to l(:label_home), { :controller => 'welcome' } %>
+ <%= link_to l(:label_home), home_url %>
<%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'} if User.current.logged? %>
<%= link_to l(:label_project_plural), { :controller => 'projects' } %>
<%= link_to l(:label_administration), { :controller => 'admin' } if User.current.admin? %>
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
- # You can have the root of your site routed by hooking up ''
- # -- just remember to delete public/index.html.
- map.connect '', :controller => "welcome"
+ map.home '', :controller => 'welcome'
map.connect 'wiki/:id/:page/:action', :controller => 'wiki', :page => nil\r
map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'\r