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
|
||||
@user.update_attributes(username: params[:user][:username])
|
||||
if Gitlab.config.gitlab.username_changing_enabled
|
||||
@user.update_attributes(username: params[:user][:username])
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -53,28 +53,29 @@
|
|||
|
||||
|
||||
|
||||
%fieldset.update-username
|
||||
%legend
|
||||
Username
|
||||
%small.cred.right
|
||||
Changing your username can have unintended side effects!
|
||||
= form_for @user, url: update_username_profile_path, method: :put, remote: true do |f|
|
||||
.padded
|
||||
= f.label :username
|
||||
.input
|
||||
= f.text_field :username, required: true
|
||||
|
||||
%span.loading-gif.hide= image_tag "ajax_loader.gif"
|
||||
%span.update-success.cgreen.hide
|
||||
%i.icon-ok
|
||||
Saved
|
||||
%span.update-failed.cred.hide
|
||||
%i.icon-remove
|
||||
Failed
|
||||
%ul.cred
|
||||
%li It will change web url for personal projects.
|
||||
%li It will change the git path to repositories for personal projects.
|
||||
.input
|
||||
= f.submit 'Save username', class: "btn save-btn"
|
||||
- if Gitlab.config.gitlab.username_changing_enabled
|
||||
%fieldset.update-username
|
||||
%legend
|
||||
Username
|
||||
%small.cred.right
|
||||
Changing your username can have unintended side effects!
|
||||
= form_for @user, url: update_username_profile_path, method: :put, remote: true do |f|
|
||||
.padded
|
||||
= f.label :username
|
||||
.input
|
||||
= f.text_field :username, required: true
|
||||
|
||||
%span.loading-gif.hide= image_tag "ajax_loader.gif"
|
||||
%span.update-success.cgreen.hide
|
||||
%i.icon-ok
|
||||
Saved
|
||||
%span.update-failed.cred.hide
|
||||
%i.icon-remove
|
||||
Failed
|
||||
%ul.cred
|
||||
%li It will change web url for personal projects.
|
||||
%li It will change the git path to repositories for personal projects.
|
||||
.input
|
||||
= f.submit 'Save username', class: "btn save-btn"
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue