trabajo-afectivo/db/migrate/20211028072158_maintenance_remove_active_ldap_sessions.rb

13 lines
386 B
Ruby
Raw Permalink Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class MaintenanceRemoveActiveLdapSessions < ActiveRecord::Migration[6.0]
def change
return if !Setting.exists?(name: 'system_init_done')
# Only relevant for when ldap integration is used.
return if !Setting.get('ldap_integration')
ActiveRecord::SessionStore::Session.destroy_all
end
end