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
55617479
Commit
55617479
authored
Dec 10, 2020
by
Shem Gyll
Committed by
Achilleas Pipinellis
Dec 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change block users for inactivity to deactivate users instead: documentation
parent
5559a68e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md
...dministration/troubleshooting/gitlab_rails_cheat_sheet.md
+13
-1
No files found.
doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md
View file @
55617479
...
...
@@ -492,10 +492,22 @@ users.each do |user|
end
```
### Deactivate Users that have no recent activity
```
ruby
days_inactive
=
90
inactive_users
=
User
.
active
.
where
(
"last_activity_on <= ?"
,
days_inactive
.
days
.
ago
)
inactive_users
.
each
do
|
user
|
puts
"user '
#{
user
.
username
}
':
#{
user
.
last_activity_on
}
"
user
.
deactivate!
end
```
### Block Users that have no recent activity
```
ruby
days_inactive
=
6
0
days_inactive
=
9
0
inactive_users
=
User
.
active
.
where
(
"last_activity_on <= ?"
,
days_inactive
.
days
.
ago
)
inactive_users
.
each
do
|
user
|
...
...
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