gitlabhq/app/controllers/profile_controller.rb

38 lines
788 B
Ruby
Raw Normal View History

2011-10-08 23:36:38 +02:00
class ProfileController < ApplicationController
2011-11-02 16:21:17 +01:00
layout "profile"
2011-10-08 23:36:38 +02:00
def show
@user = current_user
end
def design
@user = current_user
end
def update
@user = current_user
@user.update_attributes(params[:user])
redirect_to :back
end
2011-10-08 23:36:38 +02:00
def password
@user = current_user
end
def password_update
params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"}
2011-10-08 23:36:38 +02:00
@user = current_user
if @user.update_attributes(params[:user])
flash[:notice] = "Password was successfully updated. Please login with it"
redirect_to new_user_session_path
else
render :action => "password"
end
end
2011-11-15 14:08:20 +01:00
def reset_private_token
current_user.reset_authentication_token!
redirect_to profile_password_path
end
2011-10-08 23:36:38 +02:00
end