diff options
author | Jaakko Kantojärvi <jaakko@n-1.fi> | 2013-01-30 22:14:34 +0200 |
---|---|---|
committer | Jaakko Kantojärvi <jaakko@n-1.fi> | 2013-02-14 17:58:56 +0200 |
commit | ba65f2910b1285217326028655de057a702572af (patch) | |
tree | 391cce80e2111d77a2695e99a518746ffe75a0f5 /app/controllers/profiles_controller.rb | |
parent | 04186e9797209ff5a9b2fd4025d458a6e2223f62 (diff) | |
download | gitlab-ce-ba65f2910b1285217326028655de057a702572af.tar.gz |
Add option to disable username changing
This option allows to disable users from changing their username.
This is very usefull in environments using strong internal authentication methods like ldap, pam or shibboleth.
You can allow users to change theyr username in these environments, but then new users (users loging in first time) is blocked from gitlab is her username exists.
Diffstat (limited to 'app/controllers/profiles_controller.rb')
-rw-r--r-- | app/controllers/profiles_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index 1d1efb16f04..051a6664519 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -51,7 +51,9 @@ class ProfilesController < ApplicationController end def update_username - @user.update_attributes(username: params[:user][:username]) + if @user.can_change_username? + @user.update_attributes(username: params[:user][:username]) + end respond_to do |format| format.js |