BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
registrations_controller.rb
app/controllers/registrations_controller.rb
+11
-0
account.html.haml
app/views/profiles/account.html.haml
+8
-1
No files found.
app/controllers/registrations_controller.rb
View file @
1b4ba3eb
class
RegistrationsController
<
Devise
::
RegistrationsController
class
RegistrationsController
<
Devise
::
RegistrationsController
before_filter
:signup_enabled?
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
private
def
signup_enabled?
def
signup_enabled?
...
...
app/views/profiles/account.html.haml
View file @
1b4ba3eb
...
@@ -77,4 +77,10 @@
...
@@ -77,4 +77,10 @@
.input
.input
=
f
.
submit
'Save username'
,
class:
"btn btn-save"
=
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