Esempio n. 1
0
        // Token: 0x060005BD RID: 1469 RVA: 0x000159B4 File Offset: 0x00013BB4
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            ADRecipient adrecipient = (ADRecipient)base.PrepareDataObject();

            if (adrecipient.IsChanged(ADRecipientSchema.PrimarySmtpAddress) && adrecipient.PrimarySmtpAddress != adrecipient.OriginalPrimarySmtpAddress && adrecipient.EmailAddressPolicyEnabled)
            {
                this.WriteWarning(Strings.WarningCannotSetPrimarySmtpAddressWhenEapEnabled);
            }
            if (RecipientTaskHelper.IsMailEnabledRecipientType(adrecipient.RecipientType) && !adrecipient.EmailAddressPolicyEnabled && adrecipient.WindowsEmailAddress != adrecipient.OriginalWindowsEmailAddress && adrecipient.PrimarySmtpAddress == adrecipient.OriginalPrimarySmtpAddress)
            {
                adrecipient.PrimarySmtpAddress = adrecipient.WindowsEmailAddress;
            }
            if (adrecipient.RecipientType == RecipientType.MailUser && (RecipientTypeDetails)adrecipient[ADRecipientSchema.RecipientTypeDetailsValue] == RecipientTypeDetails.None)
            {
                adrecipient.RecipientTypeDetails = RecipientTypeDetails.MailUser;
            }
            RecipientTaskHelper.RemoveEmptyValueFromEmailAddresses(adrecipient);
            TaskLogger.LogExit();
            return(adrecipient);
        }
Esempio n. 2
0
        // Token: 0x060005C3 RID: 1475 RVA: 0x00015CAC File Offset: 0x00013EAC
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter();
            OrganizationId currentOrganizationId = base.CurrentOrganizationId;
            TDataObject    dataObject            = this.DataObject;

            if (!currentOrganizationId.Equals(dataObject.OrganizationId))
            {
                this.CurrentOrgState = new LazilyInitialized <SharedTenantConfigurationState>(delegate()
                {
                    TDataObject dataObject17 = this.DataObject;
                    return(SharedConfiguration.GetSharedConfigurationState(dataObject17.OrganizationId));
                });
            }
            ADRecipient adrecipient = this.DataObject;
            bool        flag        = adrecipient != null && adrecipient.RecipientSoftDeletedStatus > 0;

            if (RecipientTaskHelper.IsMailEnabledRecipientType(this.DesiredRecipientType) && !flag)
            {
                if (!base.IsProvisioningLayerAvailable)
                {
                    base.WriteError(new InvalidOperationException(Strings.ErrorNoProvisioningHandlerAvailable), (ErrorCategory)1001, null);
                }
                TDataObject dataObject2 = this.DataObject;
                if (dataObject2.IsModified(ADRecipientSchema.EmailAddresses))
                {
                    TDataObject dataObject3 = this.DataObject;
                    if (dataObject3.EmailAddresses.Count > 0)
                    {
                        if (VariantConfiguration.InvariantNoFlightingSnapshot.Global.MultiTenancy.Enabled && this.ShouldCheckAcceptedDomains())
                        {
                            IDirectorySession     configurationSession  = this.ConfigurationSession;
                            TDataObject           dataObject4           = this.DataObject;
                            IConfigurationSession configurationSession2 = (IConfigurationSession)TaskHelper.UnderscopeSessionToOrganization(configurationSession, dataObject4.OrganizationId, true);
                            IConfigurationSession cfgSession            = configurationSession2;
                            TDataObject           dataObject5           = this.DataObject;
                            RecipientTaskHelper.ValidateSmtpAddress(cfgSession, dataObject5.EmailAddresses, this.DataObject, new Task.ErrorLoggerDelegate(base.WriteError), base.ProvisioningCache);
                        }
                        ADObjectId        rootOrgContainerId = base.RootOrgContainerId;
                        TDataObject       dataObject6        = this.DataObject;
                        ADSessionSettings sessionSettings    = ADSessionSettings.FromOrganizationIdWithoutRbacScopes(rootOrgContainerId, dataObject6.OrganizationId, base.ExecutingUserOrganizationId, false);
                        IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, true, ConsistencyMode.PartiallyConsistent, string.IsNullOrEmpty(base.DomainController) ? null : base.NetCredential, sessionSettings, 557, "InternalProcessRecord", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\SetAdObjectTask.cs");
                        IRecipientSession tenantCatalogSession            = tenantOrRootOrgRecipientSession;
                        TDataObject       dataObject7 = this.DataObject;
                        RecipientTaskHelper.ValidateEmailAddressErrorOut(tenantCatalogSession, dataObject7.EmailAddresses, this.DataObject, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerReThrowDelegate(this.WriteError));
                    }
                }
            }
            TDataObject dataObject8 = this.DataObject;

            if (dataObject8.IsChanged(ADObjectSchema.Id))
            {
                IDirectorySession tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(base.DomainController, true, ConsistencyMode.PartiallyConsistent, null, base.OrgWideSessionSettings, ConfigScopes.TenantSubTree, 579, "InternalProcessRecord", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\SetAdObjectTask.cs");
                tenantOrTopologyConfigurationSession.UseConfigNC = ((IDirectorySession)base.DataSession).UseConfigNC;
                TDataObject dataObject9 = this.DataObject;
                ADObjectId  parent      = dataObject9.Id.Parent;
                ADRawEntry  adrawEntry  = tenantOrTopologyConfigurationSession.ReadADRawEntry(parent, new PropertyDefinition[]
                {
                    ADObjectSchema.ExchangeVersion
                });
                ExchangeObjectVersion exchangeObjectVersion = (ExchangeObjectVersion)adrawEntry[ADObjectSchema.ExchangeVersion];
                TDataObject           dataObject10          = this.DataObject;
                if (dataObject10.ExchangeVersion.IsOlderThan(exchangeObjectVersion))
                {
                    TDataObject dataObject11 = this.DataObject;
                    string      name         = dataObject11.Name;
                    TDataObject dataObject12 = this.DataObject;
                    base.WriteError(new TaskException(Strings.ErrorParentHasNewerVersion(name, dataObject12.ExchangeVersion.ToString(), exchangeObjectVersion.ToString())), (ErrorCategory)1004, null);
                }
            }
            TDataObject dataObject13 = this.DataObject;

            if (dataObject13.RecipientType != this.DesiredRecipientType && this.DesiredRecipientType != RecipientType.Invalid)
            {
                TDataObject   dataObject14 = this.DataObject;
                string        id           = dataObject14.Identity.ToString();
                string        oldType      = this.DesiredRecipientType.ToString();
                TDataObject   dataObject15 = this.DataObject;
                Exception     exception    = new InvalidOperationException(Strings.ErrorSetTaskChangeRecipientType(id, oldType, dataObject15.RecipientType.ToString()));
                ErrorCategory category     = (ErrorCategory)1000;
                TDataObject   dataObject16 = this.DataObject;
                base.WriteError(exception, category, dataObject16.Identity);
            }
            base.InternalProcessRecord();
            TaskLogger.LogExit();
        }