Welcome to mirror list, hosted at ThFree Co, Russian Federation.

profile_controller.rb « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 232bddb7dd2702bc2132913ef6bddfa2e28758c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class ProfileController < ApplicationController
  layout "profile"
  def show
    @user = current_user
  end

  def social_update
    @user = current_user
    @user.update_attributes(params[:user])
    redirect_to [:profile]
  end

  def password
    @user = current_user
  end

  def password_update
    params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"}
    @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

  def reset_private_token
    current_user.reset_authentication_token!
    redirect_to profile_password_path
  end
end