20170629000001_exchange_integration.rb 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. class ExchangeIntegration < ActiveRecord::Migration[4.2]
  2. def up
  3. # return if it's a new setup
  4. return if !Setting.find_by(name: 'system_init_done')
  5. Setting.set('import_backends', ['Import::Ldap', 'Import::Exchange'])
  6. Setting.create_if_not_exists(
  7. title: 'Exchange config',
  8. name: 'exchange_config',
  9. area: 'Integration::Exchange',
  10. description: 'Defines the Exchange config.',
  11. options: {},
  12. state: {},
  13. preferences: {
  14. prio: 2,
  15. permission: ['admin.integration'],
  16. },
  17. frontend: false,
  18. )
  19. Setting.create_if_not_exists(
  20. title: 'Exchange integration',
  21. name: 'exchange_integration',
  22. area: 'Integration::Switch',
  23. description: 'Defines if Exchange is enabled or not.',
  24. options: {
  25. form: [
  26. {
  27. display: '',
  28. null: true,
  29. name: 'exchange_integration',
  30. tag: 'boolean',
  31. options: {
  32. true => 'yes',
  33. false => 'no',
  34. },
  35. },
  36. ],
  37. },
  38. state: false,
  39. preferences: {
  40. prio: 1,
  41. authentication: true,
  42. permission: ['admin.integration'],
  43. },
  44. frontend: true
  45. )
  46. end
  47. end