Add option to disable username changing
This commit is contained in:
parent
72e2a49819
commit
de7012c4fb
4 changed files with 29 additions and 24 deletions
|
@ -51,7 +51,9 @@ class ProfilesController < ApplicationController
|
|||
end
|
||||
|
||||
def update_username
|
||||
if Gitlab.config.gitlab.username_changing_enabled
|
||||
@user.update_attributes(username: params[:user][:username])
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -53,7 +53,8 @@
|
|||
|
||||
|
||||
|
||||
%fieldset.update-username
|
||||
- if Gitlab.config.gitlab.username_changing_enabled
|
||||
%fieldset.update-username
|
||||
%legend
|
||||
Username
|
||||
%small.cred.right
|
||||
|
|
|
@ -35,6 +35,7 @@ gitlab:
|
|||
## Project settings
|
||||
default_projects_limit: 10
|
||||
# signup_enabled: true # default: false - Account passwords are not sent via the email if signup is enabled.
|
||||
# username_changing_enabled: false # default: true - User can change her username/namespace
|
||||
|
||||
## Gravatar
|
||||
gravatar:
|
||||
|
|
|
@ -53,6 +53,7 @@ Settings.gitlab['support_email'] ||= Settings.gitlab.email_from
|
|||
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
|
||||
Settings.gitlab['user'] ||= 'gitlab'
|
||||
Settings.gitlab['signup_enabled'] ||= false
|
||||
Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
|
||||
|
||||
Settings['gravatar'] ||= Settingslogic.new({})
|
||||
Settings.gravatar['enabled'] = true if Settings.gravatar['enabled'].nil?
|
||||
|
|
Loading…
Reference in a new issue