From 4ee181b5d6516590958ef7772adfabbe77810044 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 27 Jun 2017 11:30:27 +0200 Subject: [PATCH] Fixed issue #1211 - LDAP users that are lost don't get reflected into Zammad. --- .../app/controllers/_integration/ldap.coffee | 6 +- .../integration/ldap_last_import.jst.eco | 4 +- .../views/integration/ldap_summary.jst.eco | 4 +- lib/import/base_resource.rb | 16 +- lib/import/ldap/user.rb | 36 +- lib/import/ldap/user_factory.rb | 60 ++- lib/import/model_resource.rb | 12 +- lib/import/statistical_factory.rb | 11 +- spec/lib/import/ldap/user_factory_spec.rb | 381 ++++++++++++++++-- spec/lib/import/statistical_factory_spec.rb | 110 ++--- 10 files changed, 528 insertions(+), 112 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_integration/ldap.coffee b/app/assets/javascripts/app/controllers/_integration/ldap.coffee index dc0bbbdef..282d2785c 100644 --- a/app/assets/javascripts/app/controllers/_integration/ldap.coffee +++ b/app/assets/javascripts/app/controllers/_integration/ldap.coffee @@ -124,7 +124,7 @@ class Form extends App.Controller if _.isEmpty(job) @lastImport.html('') return - countDone = job.result.created + job.result.updated + job.result.unchanged + job.result.skipped + job.result.failed + countDone = job.result.created + job.result.updated + job.result.unchanged + job.result.skipped + job.result.failed + job.result.deactivated if !job.result.roles job.result.roles = {} for role_id, statistic of job.result.role_ids @@ -545,6 +545,8 @@ class ConnectionWizard extends App.WizardModal total += job.result.unchanged if job.result.updated total += job.result.updated + if job.result.deactivated + total += job.result.deactivated @$('.js-progress progress').attr('value', total) @$('.js-progress progress').attr('max', job.result.sum) if job.finished_at @@ -566,7 +568,7 @@ class ConnectionWizard extends App.WizardModal for role_id, statistic of job.result.role_ids role = App.Role.find(role_id) job.result.roles[role.displayName()] = statistic - countDone = job.result.created + job.result.updated + job.result.unchanged + job.result.skipped + countDone = job.result.created + job.result.updated + job.result.unchanged + job.result.skipped + job.result.deactivated @showSlide('js-try') el = $(App.view('integration/ldap_summary')(job: job, countDone: countDone)) @el.find('.js-summary').html(el) diff --git a/app/assets/javascripts/app/views/integration/ldap_last_import.jst.eco b/app/assets/javascripts/app/views/integration/ldap_last_import.jst.eco index 2fb84f854..75c44a713 100644 --- a/app/assets/javascripts/app/views/integration/ldap_last_import.jst.eco +++ b/app/assets/javascripts/app/views/integration/ldap_last_import.jst.eco @@ -33,13 +33,13 @@