2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2021-04-26 12:17:44 +00:00
|
|
|
class UpdateSessionTimeoutDefaults < ActiveRecord::Migration[5.2]
|
|
|
|
def change
|
|
|
|
return if !Setting.exists?(name: 'system_init_done')
|
|
|
|
|
|
|
|
defaults = Setting.get('session_timeout')
|
|
|
|
%w[default admin ticket.agent ticket.customer].each do |key|
|
|
|
|
next if defaults[key].to_i != 172_800
|
|
|
|
|
|
|
|
defaults[key] = 4.weeks.seconds
|
|
|
|
end
|
|
|
|
|
|
|
|
Setting.set('session_timeout', defaults)
|
|
|
|
end
|
|
|
|
end
|