diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 5c64ad332..1e16d19be 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -27,7 +27,7 @@ class AccountController < ApplicationController if request.get? @login = params[:login] || true if User.current.logged? - redirect_to home_url + redirect_to user_path(User.current) else render :layout => 'login' end @@ -58,7 +58,7 @@ class AccountController < ApplicationController # Lets user choose a new password def lost_password - (redirect_to(home_url); return) unless Setting.lost_password? + (redirect_to(signin_path); return) unless Setting.lost_password? if params[:token] @token = Token.find_token("recovery", params[:token].to_s) if @token.nil? || @token.expired? @@ -110,7 +110,7 @@ class AccountController < ApplicationController # User self-registration def register - (redirect_to(home_url); return) unless Setting.self_registration? || session[:auth_source_registration] + (redirect_to(signin_path); return) unless Setting.self_registration? || session[:auth_source_registration] if request.get? session[:auth_source_registration] = nil @user = User.new(:language => current_language.to_s) @@ -187,11 +187,11 @@ class AccountController < ApplicationController # Token based account activation def activate - (redirect_to(home_url); return) unless Setting.self_registration? && params[:token].present? + (redirect_to(signin_path); return) unless Setting.self_registration? && params[:token].present? token = Token.find_token('register', params[:token].to_s) - (redirect_to(home_url); return) unless token and !token.expired? + (redirect_to(signin_path); return) unless token and !token.expired? user = token.user - (redirect_to(home_url); return) unless user.registered? + (redirect_to(signin_path); return) unless user.registered? user.activate if user.save token.destroy @@ -278,7 +278,7 @@ class AccountController < ApplicationController user = User.find_or_initialize_by_identity_url(identity_url) if user.new_record? # Self-registration off - (redirect_to(home_url); return) unless Setting.self_registration? + (redirect_to(signin_path); return) unless Setting.self_registration? # Create on the fly user.login = registration['nickname'] unless registration['nickname'].nil? diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 4124472e1..9728ddf11 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -174,7 +174,7 @@ class MyController < ApplicationController logout_user flash.now[:notice] = l(:notice_account_deleted) end - redirect_to home_url + redirect_to signin_path end end diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb index e47cfc2ff..bedb2541f 100644 --- a/app/controllers/softapplications_controller.rb +++ b/app/controllers/softapplications_controller.rb @@ -207,7 +207,7 @@ class SoftapplicationsController < ApplicationController @softapplication.destroy respond_to do |format| - format.html { redirect_to home_url } + format.html { redirect_to signin_path } format.json { head :no_content } end end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 6b14db9bb..809f78ddc 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -27,7 +27,8 @@ class WelcomeController < ApplicationController def index # 企业版定制: params[:project]为传过来的参数 - + redirect_to signin_path + return unless params[:organization].nil? @organization = Organization.find params[:organization] # @organization_projects = Project.joins(:project_status).joins("LEFT JOIN project_scores ON projects.id = project_scores.project_id").where("projects.organization_id = ?", @organization.id).order("score DESC").limit(10).all @@ -171,7 +172,7 @@ class WelcomeController < ApplicationController redirect_to users_search_url(:name => search_condition, :search_by => search_by, :role => :student) else #redirect_to home_path, :alert => l(:label_sumbit_empty) - (redirect_to home_url, :notice => l(:label_sumbit_empty);return) #if params[:name].blank? + (redirect_to signin_path, :notice => l(:label_sumbit_empty);return) #if params[:name].blank? end } end