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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
1b4ba3eb
Commit
1b4ba3eb
authored
Feb 06, 2013
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add user delete option.
parent
0a20f7e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
app/controllers/registrations_controller.rb
app/controllers/registrations_controller.rb
+11
-0
app/views/profiles/account.html.haml
app/views/profiles/account.html.haml
+7
-1
No files found.
app/controllers/registrations_controller.rb
View file @
1b4ba3eb
class
RegistrationsController
<
Devise
::
RegistrationsController
before_filter
:signup_enabled?
def
destroy
if
current_user
.
owned_projects
.
count
>
0
redirect_to
account_profile_path
,
alert:
"Remove projects and groups before removing account."
and
return
end
current_user
.
destroy
respond_to
do
|
format
|
format
.
html
{
redirect_to
new_user_session_path
,
notice:
"Account successfully removed."
}
end
end
private
def
signup_enabled?
...
...
app/views/profiles/account.html.haml
View file @
1b4ba3eb
...
...
@@ -77,4 +77,10 @@
.input
=
f
.
submit
'Save username'
,
class:
"btn btn-save"
-
if
Gitlab
.
config
.
gitlab
.
signup_enabled
%fieldset
.update-username
%legend
Remove account
%small
.cred.pull-right
Before removing the account you must remove all projects!
=
link_to
'Delete account'
,
user_registration_path
,
confirm:
"REMOVE
#{
current_user
.
name
}
? Are you sure?"
,
method: :delete
,
class:
"btn btn-remove delete-key btn-small pull-right"
\ No newline at end of file
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