Example #1
0
 protected override void InternalValidate()
 {
     this.latencyContext = ProvisioningPerformanceHelper.StartLatencyDetection(this);
     base.InternalValidate();
     base.VerifyIsWithinScopes((IRecipientSession)base.DataSession, this.DataObject, true, new DataAccessTask <ADUser> .ADObjectOutOfScopeString(Strings.ErrorCannotChangeMailboxOutOfWriteScope));
     if (this.DataObject.IsModified(ADMailboxRecipientSchema.ExchangeGuid) && this.DataObject.ExchangeGuid != Guid.Empty && this.DataObject.IsModified(ADUserSchema.ArchiveGuid) && this.DataObject.ArchiveGuid != Guid.Empty && this.DataObject.ExchangeGuid == this.DataObject.ArchiveGuid)
     {
         base.WriteError(new RecipientTaskException(Strings.ErrorInvalidParameterValue("ExchangeGuid", this.DataObject.ExchangeGuid.ToString())), ExchangeErrorCategory.Client, this.DataObject.Identity);
     }
     if (this.DataObject.IsModified(ADMailboxRecipientSchema.ExchangeGuid) && this.DataObject.ExchangeGuid != Guid.Empty && !this.DataObject.IsSoftDeleted)
     {
         RecipientTaskHelper.IsExchangeGuidOrArchiveGuidUnique(this.DataObject, ADMailboxRecipientSchema.ExchangeGuid, this.DataObject.ExchangeGuid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client);
     }
     if (this.DataObject.IsModified(ADUserSchema.ArchiveGuid) && this.DataObject.ArchiveGuid != Guid.Empty)
     {
         RecipientTaskHelper.IsExchangeGuidOrArchiveGuidUnique(this.DataObject, ADUserSchema.ArchiveGuid, this.DataObject.ArchiveGuid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client);
     }
     if (ComplianceConfigImpl.JournalArchivingHardeningEnabled && this.DataObject.IsModified(ADRecipientSchema.EmailAddresses))
     {
         bool flag = false;
         foreach (ProxyAddress proxyAddress in this.DataObject.EmailAddresses)
         {
             if (proxyAddress.Prefix == ProxyAddressPrefix.JRNL)
             {
                 if (flag)
                 {
                     base.WriteError(new RecipientTaskException(Strings.ErrorMultipleJournalArchiveAddress), ExchangeErrorCategory.Client, this.DataObject.Identity);
                 }
                 flag = true;
             }
         }
     }
 }
 protected override void PrepareUserObject(ADUser user)
 {
     TaskLogger.LogEnter();
     base.PrepareUserObject(user);
     if (this.WindowsLiveID != null && this.WindowsLiveID.SmtpAddress != SmtpAddress.Empty)
     {
         user.EmailAddressPolicyEnabled = false;
         SmtpProxyAddress item = new SmtpProxyAddress(this.WindowsLiveID.SmtpAddress.ToString(), false);
         if (!user.EmailAddresses.Contains(item))
         {
             user.EmailAddresses.Add(item);
         }
     }
     if (user.ExchangeGuid == SoftDeletedTaskHelper.PredefinedExchangeGuid)
     {
         user.ExchangeGuid = user.PreviousExchangeGuid;
         if (!RecipientTaskHelper.IsExchangeGuidOrArchiveGuidUnique(user, ADMailboxRecipientSchema.ExchangeGuid, user.ExchangeGuid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client))
         {
             user.ExchangeGuid = Guid.Empty;
         }
         user.PreviousExchangeGuid = Guid.Empty;
     }
     SoftDeletedTaskHelper.UpdateShadowWhenSoftDeletedProperty((IRecipientSession)base.DataSession, this.ConfigurationSession, base.CurrentOrganizationId, this.DataObject);
     this.DataObject.RecipientSoftDeletedStatus = 0;
     this.DataObject.WhenSoftDeleted            = null;
     this.DataObject.InternalOnly = false;
     TaskLogger.LogExit();
 }
Example #3
0
 protected override void InternalValidate()
 {
     base.InternalValidate();
     if (this.DataObject.IsModified(ADUserSchema.ArchiveGuid) && this.ArchiveGuid != Guid.Empty)
     {
         RecipientTaskHelper.IsExchangeGuidOrArchiveGuidUnique(this.DataObject, ADUserSchema.ArchiveGuid, this.ArchiveGuid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client);
     }
 }
Example #4
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     this.latencyContext = ProvisioningPerformanceHelper.StartLatencyDetection(this);
     base.InternalValidate();
     if (this.DataObject.IsChanged(MailboxSchema.MasterAccountSid) && this.DataObject.IsChanged(MailboxSchema.LinkedMasterAccount))
     {
         base.WriteError(new RecipientTaskException(Strings.ErrorSyncMailboxWithMasterAccountSid(this.DataObject.MasterAccountSid.ToString(), this.DataObject.LinkedMasterAccount)), ExchangeErrorCategory.Client, this.DataObject.Identity);
     }
     if (!base.NeedChangeMailboxSubtype && this.DataObject.IsChanged(MailboxSchema.MasterAccountSid) && this.DataObject.MasterAccountSid == null)
     {
         base.WriteError(new RecipientTaskException(Strings.ErrorSyncMailboxWithMasterAccountSidNull), ExchangeErrorCategory.Client, this.DataObject.Identity);
     }
     if (this.DataObject.IsModified(ADUserSchema.ArchiveGuid) && this.ArchiveGuid != Guid.Empty)
     {
         RecipientTaskHelper.IsExchangeGuidOrArchiveGuidUnique(this.DataObject, ADUserSchema.ArchiveGuid, this.ArchiveGuid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client);
     }
     TaskLogger.LogExit();
 }