Mercurial > hg > soundsoftware-site
diff app/controllers/account_controller.rb @ 909:cbb26bc654de redmine-1.3
Update to Redmine 1.3-stable branch (Redmine SVN rev 8964)
author | Chris Cannam |
---|---|
date | Fri, 24 Feb 2012 19:09:32 +0000 |
parents | 0579821a129a |
children | 5e80956cc792 433d4f72a19b |
line wrap: on
line diff
--- a/app/controllers/account_controller.rb Fri Feb 24 18:36:29 2012 +0000 +++ b/app/controllers/account_controller.rb Fri Feb 24 19:09:32 2012 +0000 @@ -1,24 +1,24 @@ # Redmine - project management software -# Copyright (C) 2006-2009 Jean-Philippe Lang +# Copyright (C) 2006-2011 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class AccountController < ApplicationController helper :custom_fields - include CustomFieldsHelper - + include CustomFieldsHelper + # prevents login action to be filtered by check_if_login_required application scope filter skip_before_filter :check_if_login_required @@ -36,7 +36,7 @@ logout_user redirect_to home_url end - + # Enable user to choose a new password def lost_password redirect_to(home_url) && return unless Setting.lost_password? @@ -51,7 +51,7 @@ flash[:notice] = l(:notice_account_password_updated) redirect_to :action => 'login' return - end + end end render :template => "account/password_recovery" return @@ -73,7 +73,7 @@ end end end - + # User self-registration def register redirect_to(home_url) && return unless Setting.self_registration? || session[:auth_source_registration] @@ -109,7 +109,7 @@ end end end - + # Token based account activation def activate redirect_to(home_url) && return unless Setting.self_registration? && params[:token] @@ -124,9 +124,9 @@ end redirect_to :action => 'login' end - + private - + def logout_user if User.current.logged? cookies.delete :autologin @@ -134,7 +134,7 @@ self.logged_user = nil end end - + def authenticate_user if Setting.openid? && using_open_id? open_id_authenticate(params[:openid_url]) @@ -156,7 +156,6 @@ end end - def open_id_authenticate(openid_url) authenticate_with_open_id(openid_url, :required => [:nickname, :fullname, :email], :return_to => signin_url) do |result, identity_url, registration| if result.successful? @@ -185,7 +184,7 @@ register_manually_by_administrator(user) do onthefly_creation_failed(user) end - end + end else # Existing record if user.active? @@ -197,7 +196,7 @@ end end end - + def successful_authentication(user) # Valid user self.logged_user = user @@ -208,7 +207,7 @@ call_hook(:controller_account_success_authentication_after, {:user => user }) redirect_back_or_default :controller => 'my', :action => 'page' end - + def set_autologin_cookie(user) token = Token.create(:user => user, :action => 'autologin') cookie_name = Redmine::Configuration['autologin_cookie_name'] || 'autologin' @@ -247,7 +246,7 @@ yield if block_given? end end - + # Automatically register a user # # Pass a block for behavior when a user fails to save @@ -263,7 +262,7 @@ yield if block_given? end end - + # Manual activation by the administrator # # Pass a block for behavior when a user fails to save