ldap.rb 722 B

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
  2. require 'ldap'
  3. require 'ldap/group'
  4. module Import
  5. class Ldap < Import::IntegrationBase
  6. # Provides the name that is used in texts visible to the user.
  7. #
  8. # @example
  9. # Import::Ldap.display_name
  10. # #=> "LDAP"
  11. #
  12. # return [String]
  13. def self.display_name
  14. identifier.upcase
  15. end
  16. private
  17. def start_import
  18. Import::Ldap::UserFactory.reset_statistics
  19. Import::Ldap::UserFactory.import(
  20. config: @import_job.payload,
  21. dry_run: @import_job.dry_run,
  22. import_job: @import_job
  23. )
  24. @import_job.result = Import::Ldap::UserFactory.statistics
  25. end
  26. end
  27. end