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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Kantojärvi <jaakko@n-1.fi>2013-01-31 00:14:34 +0400
committerJaakko Kantojärvi <jaakko@n-1.fi>2013-02-14 19:58:56 +0400
commitba65f2910b1285217326028655de057a702572af (patch)
tree391cce80e2111d77a2695e99a518746ffe75a0f5 /app/controllers/profiles_controller.rb
parent04186e9797209ff5a9b2fd4025d458a6e2223f62 (diff)
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.rb4
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