|
|
@ -131,7 +131,7 @@ class MyController < ApplicationController
|
|
|
|
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
|
|
|
|
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
|
|
|
|
set_language_if_valid @user.language
|
|
|
|
set_language_if_valid @user.language
|
|
|
|
flash.now[:notice] = l(:notice_account_updated)
|
|
|
|
flash.now[:notice] = l(:notice_account_updated)
|
|
|
|
redirect_to user_path(@user)
|
|
|
|
redirect_to user_url(@user)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
else
|
|
|
|
else
|
|
|
|
# 确保文件被删除
|
|
|
|
# 确保文件被删除
|
|
|
@ -152,7 +152,7 @@ class MyController < ApplicationController
|
|
|
|
def destroy
|
|
|
|
def destroy
|
|
|
|
@user = User.current
|
|
|
|
@user = User.current
|
|
|
|
unless @user.own_account_deletable?
|
|
|
|
unless @user.own_account_deletable?
|
|
|
|
redirect_to my_account_path
|
|
|
|
redirect_to my_account_url
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -162,7 +162,7 @@ class MyController < ApplicationController
|
|
|
|
logout_user
|
|
|
|
logout_user
|
|
|
|
flash.now[:notice] = l(:notice_account_deleted)
|
|
|
|
flash.now[:notice] = l(:notice_account_deleted)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
redirect_to home_path
|
|
|
|
redirect_to home_url
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -171,7 +171,7 @@ class MyController < ApplicationController
|
|
|
|
@user = User.current
|
|
|
|
@user = User.current
|
|
|
|
unless @user.change_password_allowed?
|
|
|
|
unless @user.change_password_allowed?
|
|
|
|
flash.now[:error] = l(:notice_can_t_change_password)
|
|
|
|
flash.now[:error] = l(:notice_can_t_change_password)
|
|
|
|
redirect_to my_account_path
|
|
|
|
redirect_to my_account_url
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if request.post?
|
|
|
|
if request.post?
|
|
|
@ -180,7 +180,7 @@ class MyController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
if @user.save
|
|
|
|
if @user.save
|
|
|
|
flash.now[:notice] = l(:notice_account_password_updated)
|
|
|
|
flash.now[:notice] = l(:notice_account_password_updated)
|
|
|
|
redirect_to my_account_path
|
|
|
|
redirect_to my_account_url
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
else
|
|
|
|
flash.now[:error] = l(:notice_account_wrong_password)
|
|
|
|
flash.now[:error] = l(:notice_account_wrong_password)
|
|
|
@ -198,7 +198,7 @@ class MyController < ApplicationController
|
|
|
|
User.current.rss_key
|
|
|
|
User.current.rss_key
|
|
|
|
flash[:notice] = l(:notice_feeds_access_key_reseted)
|
|
|
|
flash[:notice] = l(:notice_feeds_access_key_reseted)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
redirect_to my_account_path
|
|
|
|
redirect_to my_account_url
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# Create a new API key
|
|
|
|
# Create a new API key
|
|
|
@ -211,7 +211,7 @@ class MyController < ApplicationController
|
|
|
|
User.current.api_key
|
|
|
|
User.current.api_key
|
|
|
|
flash[:notice] = l(:notice_api_access_key_reseted)
|
|
|
|
flash[:notice] = l(:notice_api_access_key_reseted)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
redirect_to my_account_path
|
|
|
|
redirect_to my_account_url
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# User's page layout configuration
|
|
|
|
# User's page layout configuration
|
|
|
@ -241,7 +241,7 @@ class MyController < ApplicationController
|
|
|
|
@user.pref[:my_page_layout] = layout
|
|
|
|
@user.pref[:my_page_layout] = layout
|
|
|
|
@user.pref.save
|
|
|
|
@user.pref.save
|
|
|
|
end
|
|
|
|
end
|
|
|
|
redirect_to my_page_layout_path
|
|
|
|
redirect_to my_page_layout_url
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# Remove a block to user's page
|
|
|
|
# Remove a block to user's page
|
|
|
@ -254,7 +254,7 @@ class MyController < ApplicationController
|
|
|
|
%w(top left right).each {|f| (layout[f] ||= []).delete block }
|
|
|
|
%w(top left right).each {|f| (layout[f] ||= []).delete block }
|
|
|
|
@user.pref[:my_page_layout] = layout
|
|
|
|
@user.pref[:my_page_layout] = layout
|
|
|
|
@user.pref.save
|
|
|
|
@user.pref.save
|
|
|
|
redirect_to my_page_layout_path
|
|
|
|
redirect_to my_page_layout_url
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# Change blocks order on user's page
|
|
|
|
# Change blocks order on user's page
|
|
|
|