2013-08-26 16:15:59 -04:00
|
|
|
require_dependency 'admin_user_index_query'
|
|
|
|
|
|
|
|
module Jobs
|
|
|
|
|
|
|
|
class PendingUsersReminder < Jobs::Scheduled
|
2014-02-05 18:14:41 -05:00
|
|
|
every 9.hours
|
2013-08-26 16:15:59 -04:00
|
|
|
|
|
|
|
def execute(args)
|
|
|
|
if SiteSetting.must_approve_users
|
|
|
|
count = AdminUserIndexQuery.new({query: 'pending'}).find_users_query.count
|
|
|
|
if count > 0
|
|
|
|
GroupMessage.create(Group[:moderators].name, :pending_users_reminder, {limit_once_per: false, message_params: {count: count}})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|