예제 #1
0
        // Token: 0x0600606F RID: 24687 RVA: 0x00147B24 File Offset: 0x00145D24
        public virtual void Provision(ADProvisioningPolicy templatePolicy, IConfigurable writablePresentationObject)
        {
            if (templatePolicy == null)
            {
                throw new ArgumentNullException("templatePolicy");
            }
            if (writablePresentationObject == null)
            {
                throw new ArgumentNullException("writablePresentationObject");
            }
            if (!base.TargetObjectTypes.Contains(writablePresentationObject.GetType()))
            {
                throw new ArgumentOutOfRangeException("writablePresentationObject");
            }
            if (!(writablePresentationObject is ADObject))
            {
                throw new ArgumentOutOfRangeException("writablePresentationObject");
            }
            object obj = templatePolicy[base.PolicyProperty];

            if (!this.IsNullOrUnlimited(obj) && !this.IsNullOrEmptyMvp(obj))
            {
                if (base.ValueConverter != null)
                {
                    obj = base.ValueConverter(obj);
                }
                ((ADObject)writablePresentationObject)[base.ObjectProperty] = obj;
                return;
            }
        }
        // Token: 0x0600607A RID: 24698 RVA: 0x00147E54 File Offset: 0x00146054
        public override ProvisioningValidationError[] Validate(ADProvisioningPolicy enforcementPolicy, IConfigurable readOnlyPresentationObject)
        {
            base.Validate(enforcementPolicy, readOnlyPresentationObject);
            ADObject adobject;

            if (readOnlyPresentationObject is ADPublicFolder)
            {
                adobject = (ADPublicFolder)readOnlyPresentationObject;
            }
            else
            {
                adobject = (MailEnabledRecipient)readOnlyPresentationObject;
            }
            Unlimited <int> fromValue = (Unlimited <int>)enforcementPolicy[base.CountQuotaProperty];

            if (!fromValue.IsUnlimited && (T)fromValue >= 0)
            {
                int  num = (T)fromValue;
                bool flag;
                if (num == 0)
                {
                    flag = true;
                }
                else
                {
                    string domainController = null;
                    if (base.Context != null && base.Context.UserSpecifiedParameters != null && base.Context.UserSpecifiedParameters.Contains("DomainController"))
                    {
                        object obj = base.Context.UserSpecifiedParameters["DomainController"];
                        if (obj != null)
                        {
                            domainController = obj.ToString();
                        }
                    }
                    ADSessionSettings     sessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopes(ADSystemConfigurationSession.GetRootOrgContainerIdForLocalForest(), adobject.OrganizationId, null, false);
                    IConfigurationSession tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(domainController, true, ConsistencyMode.FullyConsistent, sessionSettings, 178, "Validate", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\Provisioning\\RecipientResourceCountQuota.cs");
                    flag = SystemAddressListMemberCount.IsQuotaExceded(tenantOrTopologyConfigurationSession, adobject.OrganizationId, base.SystemAddressListName, num);
                }
                if (flag)
                {
                    string          policyId = string.Format("{0}: {1}", enforcementPolicy.Identity.ToString(), base.CountQuotaProperty.Name);
                    LocalizedString description;
                    if (adobject.OrganizationalUnitRoot == null)
                    {
                        description = DirectoryStrings.ErrorExceededHosterResourceCountQuota(policyId, (readOnlyPresentationObject.GetType() == typeof(ADPublicFolder)) ? "MailPublicFolder" : ProvisioningHelper.GetProvisioningObjectTag(readOnlyPresentationObject.GetType()), num);
                    }
                    else
                    {
                        description = DirectoryStrings.ErrorExceededMultiTenantResourceCountQuota(policyId, (readOnlyPresentationObject.GetType() == typeof(ADPublicFolder)) ? "MailPublicFolder" : ProvisioningHelper.GetProvisioningObjectTag(readOnlyPresentationObject.GetType()), adobject.OrganizationalUnitRoot.Name, num);
                    }
                    return(new ProvisioningValidationError[]
                    {
                        new ProvisioningValidationError(description, ExchangeErrorCategory.ServerOperation, null)
                    });
                }
            }
            return(null);
        }
 // Token: 0x06006076 RID: 24694 RVA: 0x00147CFB File Offset: 0x00145EFB
 public virtual ProvisioningValidationError[] Validate(ADProvisioningPolicy enforcementPolicy, IConfigurable readOnlyPresentationObject)
 {
     if (enforcementPolicy == null)
     {
         throw new ArgumentNullException("enforcementPolicy");
     }
     if (readOnlyPresentationObject == null)
     {
         throw new ArgumentNullException("readOnlyPresentationObject");
     }
     if (!base.TargetObjectTypes.Contains(readOnlyPresentationObject.GetType()))
     {
         throw new ArgumentOutOfRangeException("readOnlyPresentationObject");
     }
     return(null);
 }