Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: manifests/issuesserver.pp

Issue 29323184: Issue 2783 - Establish cron-job to clean up Trac fake accounts (Closed)
Patch Set: Created Aug. 3, 2015, 2:19 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: manifests/issuesserver.pp
diff --git a/manifests/issuesserver.pp b/manifests/issuesserver.pp
index d956e1762e3849b73007113aba62bf8af8969c58..0bcec94b0319f57b5032a4bc4badcbae95a4e9f2 100644
--- a/manifests/issuesserver.pp
+++ b/manifests/issuesserver.pp
@@ -74,4 +74,20 @@ node 'issues1' {
require => Trac::Instance['issues'],
user => trac,
}
+
+ cron {'trac_account_cleanup':
+ command => "$mysql trac --execute ' \
+ DELETE session, session_attribute FROM session \
+ JOIN session_attribute AS session_data ON session.sid = session_data.sid \
+ AND session.authenticated = session_data.authenticated \
+ JOIN session_attribute ON session.sid = session_attribute.sid \
+ AND session.authenticated = session_attribute.authenticated \
+ WHERE session_data.name = \"email_verification_token\" AND \
+ session.last_visit < UNIX_TIMESTAMP(NOW() - INTERVAL 5 DAY)' >/dev/null",
+ ensure => present,
+ hour => 2,
+ minute => 0,
+ require => Trac::Instance['issues'],
+ user => trac,
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld