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.
This commit is contained in:
parent
04186e9797
commit
ba65f2910b
5 changed files with 34 additions and 25 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue