2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2018-03-28 11:03:13 +00:00
|
|
|
class Issue1905ExchangeLoginFromRemoteId < ActiveRecord::Migration[5.1]
|
|
|
|
def change
|
|
|
|
|
|
|
|
# return if it's a new setup
|
2020-08-03 08:35:43 +00:00
|
|
|
return if !Setting.exists?(name: 'system_init_done')
|
2018-03-28 11:03:13 +00:00
|
|
|
|
|
|
|
config = Import::Exchange.config
|
|
|
|
return if config.blank?
|
|
|
|
return if config[:attributes].blank?
|
|
|
|
return if config[:attributes][:item_id].blank?
|
|
|
|
return if config[:attributes][:item_id] != 'login'
|
|
|
|
|
|
|
|
config[:attributes].delete(:item_id)
|
|
|
|
|
|
|
|
Import::Exchange.config = config
|
|
|
|
end
|
|
|
|
end
|