2017-05-05 08:58:05 +00:00
|
|
|
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2017-04-19 10:09:54 +00:00
|
|
|
require 'ldap'
|
|
|
|
require 'ldap/group'
|
|
|
|
|
|
|
|
module Import
|
2017-08-14 11:56:23 +00:00
|
|
|
class Ldap < Import::IntegrationBase
|
2017-05-05 08:58:05 +00:00
|
|
|
|
2017-08-14 11:56:23 +00:00
|
|
|
# Provides the name that is used in texts visible to the user.
|
2017-05-05 08:58:05 +00:00
|
|
|
#
|
|
|
|
# @example
|
2017-08-14 11:56:23 +00:00
|
|
|
# Import::Ldap.display_name
|
|
|
|
# #=> "LDAP"
|
2017-05-05 08:58:05 +00:00
|
|
|
#
|
2017-08-14 11:56:23 +00:00
|
|
|
# return [String]
|
|
|
|
def self.display_name
|
|
|
|
identifier.upcase
|
2017-05-11 15:18:03 +00:00
|
|
|
end
|
|
|
|
|
2017-04-19 10:09:54 +00:00
|
|
|
private
|
|
|
|
|
|
|
|
def start_import
|
|
|
|
Import::Ldap::UserFactory.reset_statistics
|
|
|
|
|
|
|
|
Import::Ldap::UserFactory.import(
|
|
|
|
config: @import_job.payload,
|
|
|
|
dry_run: @import_job.dry_run,
|
|
|
|
import_job: @import_job
|
|
|
|
)
|
|
|
|
|
|
|
|
@import_job.result = Import::Ldap::UserFactory.statistics
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|