Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
e049e187
Commit
e049e187
authored
Feb 18, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2991 from raphendyr/username_change_disablation
Add option to disable username changing
parents
ea28519f
ba65f291
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
25 deletions
+34
-25
app/controllers/profiles_controller.rb
app/controllers/profiles_controller.rb
+3
-1
app/models/user.rb
app/models/user.rb
+4
-0
app/views/profiles/account.html.haml
app/views/profiles/account.html.haml
+25
-24
config/gitlab.yml.example
config/gitlab.yml.example
+1
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-0
No files found.
app/controllers/profiles_controller.rb
View file @
e049e187
...
@@ -51,7 +51,9 @@ class ProfilesController < ApplicationController
...
@@ -51,7 +51,9 @@ class ProfilesController < ApplicationController
end
end
def
update_username
def
update_username
if
@user
.
can_change_username?
@user
.
update_attributes
(
username:
params
[
:user
][
:username
])
@user
.
update_attributes
(
username:
params
[
:user
][
:username
])
end
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
js
format
.
js
...
...
app/models/user.rb
View file @
e049e187
...
@@ -234,6 +234,10 @@ class User < ActiveRecord::Base
...
@@ -234,6 +234,10 @@ class User < ActiveRecord::Base
keys
.
count
==
0
keys
.
count
==
0
end
end
def
can_change_username?
Gitlab
.
config
.
gitlab
.
username_changing_enabled
end
def
can_create_project?
def
can_create_project?
projects_limit
>
owned_projects
.
count
projects_limit
>
owned_projects
.
count
end
end
...
...
app/views/profiles/account.html.haml
View file @
e049e187
...
@@ -53,7 +53,8 @@
...
@@ -53,7 +53,8 @@
%fieldset
.update-username
-
if
current_user
.
can_change_username?
%fieldset
.update-username
%legend
%legend
Username
Username
%small
.cred.pull-right
%small
.cred.pull-right
...
...
config/gitlab.yml.example
View file @
e049e187
...
@@ -35,6 +35,7 @@ production: &base
...
@@ -35,6 +35,7 @@ production: &base
## Project settings
## Project settings
default_projects_limit: 10
default_projects_limit: 10
# signup_enabled: true # default: false - Account passwords are not sent via the email if signup is enabled.
# 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
gravatar:
gravatar:
...
...
config/initializers/1_settings.rb
View file @
e049e187
...
@@ -57,6 +57,7 @@ Settings.gitlab['support_email'] ||= Settings.gitlab.email_from
...
@@ -57,6 +57,7 @@ Settings.gitlab['support_email'] ||= Settings.gitlab.email_from
Settings
.
gitlab
[
'url'
]
||=
Settings
.
send
(
:build_gitlab_url
)
Settings
.
gitlab
[
'url'
]
||=
Settings
.
send
(
:build_gitlab_url
)
Settings
.
gitlab
[
'user'
]
||=
'git'
Settings
.
gitlab
[
'user'
]
||=
'git'
Settings
.
gitlab
[
'signup_enabled'
]
||=
false
Settings
.
gitlab
[
'signup_enabled'
]
||=
false
Settings
.
gitlab
[
'username_changing_enabled'
]
=
true
if
Settings
.
gitlab
[
'username_changing_enabled'
].
nil?
#
#
# Gravatar
# Gravatar
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment