diff --git a/src/Dynamicweb.DataIntegration.Providers.UserProvider.csproj b/src/Dynamicweb.DataIntegration.Providers.UserProvider.csproj index 098c757..78b1365 100644 --- a/src/Dynamicweb.DataIntegration.Providers.UserProvider.csproj +++ b/src/Dynamicweb.DataIntegration.Providers.UserProvider.csproj @@ -1,6 +1,6 @@  - 10.5.0 + 10.6.0 1.0.0.0 User Provider User Provider @@ -23,7 +23,7 @@ snupkg - + diff --git a/src/UserDestinationWriter.cs b/src/UserDestinationWriter.cs index d525da3..7930914 100644 --- a/src/UserDestinationWriter.cs +++ b/src/UserDestinationWriter.cs @@ -64,14 +64,6 @@ internal class UserDestinationWriter : BaseSqlWriter private List MappingsWithUpdateUsersByCustomerNumberMode = new List(); private TableCollection _schemaTables = null; - /// - /// Return rows affected - /// - internal int RowsAffected - { - get; private set; - } - public UserDestinationWriter(Job job, SqlConnection connection, bool removeMissingUsers, bool generateUserPasswords, bool encryptUserPasswords, bool removeMissingGroups, bool UseEmailForUsername, string userKeyField, string mailSubject, string senderEmail, string emailTemplate, bool allowEmail, string destinationGroup, bool deleteOnlyFromGroupsThatAreImportedTo, ILogger logger, diff --git a/src/UserProvider.cs b/src/UserProvider.cs index 015c726..cb94cf1 100644 --- a/src/UserProvider.cs +++ b/src/UserProvider.cs @@ -5,8 +5,6 @@ using Dynamicweb.Extensibility.AddIns; using Dynamicweb.Extensibility.Editors; using Dynamicweb.Logging; -using Dynamicweb.Security.Permissions; -using Dynamicweb.Security.UserManagement; using Dynamicweb.Security.UserManagement.Common.SystemFields; using Microsoft.CodeAnalysis; using System; @@ -255,6 +253,7 @@ public UserProvider() UserKeyField = "Auto"; DiscardDuplicates = false; } + public override Schema GetOriginalSourceSchema() { List tablestToKeep = new() { "AccessUser", "AccessUserAddress", "AccessUserSecondaryRelation" }; @@ -706,8 +705,10 @@ public override bool RunJob(Job job) while (!reader.IsDone()) { sourceRow = reader.GetNext(); - ProcessInputRow(mapping, sourceRow); - Writer.Write(sourceRow, mapping, discardDuplicates); + if (ProcessInputRow(sourceRow, mapping)) + { + Writer.Write(sourceRow, mapping, discardDuplicates); + } } } } @@ -720,6 +721,7 @@ public override bool RunJob(Job job) sqlTransaction.Commit(); Writer.SendUserPasswords(); MoveRepositoriesIndexToJob(job); + TotalRowsAffected += Writer.RowsAffected; } catch (Exception ex) { @@ -748,6 +750,9 @@ public override bool RunJob(Job job) if (sqlTransaction != null) sqlTransaction.Rollback(); + + TotalRowsAffected = 0; + return false; } finally