BigW Consortium Gitlab

profile_controller.rb 755 Bytes
Newer Older
gitlabhq committed
1
class ProfileController < ApplicationController
gitlabhq committed
2
  layout "profile"
gitlabhq committed
3 4 5 6
  def show
    @user = current_user
  end

7 8 9 10 11 12
  def social_update
    @user = current_user
    @user.update_attributes(params[:user])
    redirect_to [:profile]
  end

gitlabhq committed
13 14 15 16 17
  def password
    @user = current_user
  end

  def password_update
Nihad Abbasov committed
18
    params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"}
gitlabhq committed
19 20 21 22 23 24 25 26 27
    @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
28 29 30 31 32

  def reset_private_token
    current_user.reset_authentication_token!
    redirect_to profile_password_path
  end
gitlabhq committed
33
end