gitlabhq/app/controllers/profile_controller.rb

44 lines
795 B
Ruby
Raw Normal View History

2011-10-08 23:36:38 +02:00
class ProfileController < ApplicationController
2012-07-31 07:32:49 +02:00
before_filter :user
2011-10-08 23:36:38 +02:00
def show
end
def design
end
def update
@user.update_attributes(params[:user])
redirect_to :back
end
def token
end
2011-10-08 23:36:38 +02:00
def password_update
params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"}
2011-10-08 23:36:38 +02:00
if @user.update_attributes(params[:user])
flash[:notice] = "Password was successfully updated. Please login with it"
redirect_to new_user_session_path
else
render 'account'
2011-10-08 23:36:38 +02:00
end
end
2011-11-15 14:08:20 +01:00
def reset_private_token
current_user.reset_authentication_token!
2012-09-14 18:13:25 +02:00
redirect_to profile_account_path
2011-11-15 14:08:20 +01:00
end
2012-07-31 07:32:49 +02:00
2012-09-14 18:13:25 +02:00
def history
@events = current_user.recent_events.page(params[:page]).per(20)
end
private
2012-07-31 07:32:49 +02:00
def user
@user = current_user
end
2011-10-08 23:36:38 +02:00
end