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
Boxiang Sun
gitlab-ce
Commits
cd46f4c3
Commit
cd46f4c3
authored
Oct 08, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add output and confirmation to gitlab:two_factor:disable_for_all_users
parent
5a28a5b7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
lib/tasks/gitlab/two_factor.rake
lib/tasks/gitlab/two_factor.rake
+15
-2
No files found.
lib/tasks/gitlab/two_factor.rake
View file @
cd46f4c3
...
...
@@ -2,8 +2,21 @@ namespace :gitlab do
namespace
:two_factor
do
desc
"GitLab | Disable Two-factor authentication (2FA) for all users"
task
disable_for_all_users: :environment
do
User
.
with_two_factor
.
find_each
do
|
user
|
user
.
disable_two_factor!
scope
=
User
.
with_two_factor
count
=
scope
.
count
if
count
>
0
puts
"This will disable 2FA for
#{
count
.
to_s
.
red
}
users..."
begin
ask_to_continue
scope
.
find_each
(
&
:disable_two_factor!
)
puts
"Successfully disabled 2FA for
#{
count
}
users."
.
green
rescue
Gitlab
::
TaskAbortedByUserError
puts
"Quitting..."
.
red
end
else
puts
"There are currently no users with 2FA enabled."
.
yellow
end
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