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
db8f4c06
Commit
db8f4c06
authored
Jul 10, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a button to Admin::Users#show to disable 2FA for that user
parent
800df45d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
CHANGELOG
CHANGELOG
+1
-0
app/views/admin/users/show.html.haml
app/views/admin/users/show.html.haml
+1
-0
spec/features/admin/admin_disables_two_factor_spec.rb
spec/features/admin/admin_disables_two_factor_spec.rb
+33
-0
No files found.
CHANGELOG
View file @
db8f4c06
...
...
@@ -43,6 +43,7 @@ v 7.13.0 (unreleased)
- Redesign project page. Show README as default instead of activity. Move project activity to separate page
- Make left menu more hierarchical and less contextual by adding back item at top
- A fork can’t have a visibility level that is greater than the original project.
- Allow administrators to disable 2FA for a specific user
v 7.12.2
- Correctly show anonymous authorized applications under Profile > Applications.
...
...
app/views/admin/users/show.html.haml
View file @
db8f4c06
...
...
@@ -43,6 +43,7 @@
%strong
{
class:
@user
.
two_factor_enabled?
?
'cgreen'
:
'cred'
}
-
if
@user
.
two_factor_enabled?
Enabled
=
link_to
'Disable'
,
disable_two_factor_admin_user_path
(
@user
),
data:
{
confirm:
'Are you sure?'
},
method: :patch
,
class:
'btn btn-xs btn-remove pull-right'
,
title:
'Disable Two-factor Authentication'
-
else
Disabled
...
...
spec/features/admin/admin_disables_two_factor_spec.rb
0 → 100644
View file @
db8f4c06
require
'rails_helper'
feature
'Admin disables 2FA for a user'
,
feature:
true
do
scenario
'successfully'
,
js:
true
do
login_as
(
:admin
)
user
=
create
(
:user
,
:two_factor
)
edit_user
(
user
)
page
.
within
(
'.two-factor-status'
)
do
click_link
'Disable'
end
page
.
within
(
'.two-factor-status'
)
do
expect
(
page
).
to
have_content
'Disabled'
expect
(
page
).
not_to
have_button
'Disable'
end
end
scenario
'for a user without 2FA enabled'
do
login_as
(
:admin
)
user
=
create
(
:user
)
edit_user
(
user
)
page
.
within
(
'.two-factor-status'
)
do
expect
(
page
).
not_to
have_button
'Disable'
end
end
def
edit_user
(
user
)
visit
admin_user_path
(
user
)
end
end
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