// Token: 0x0600021F RID: 543 RVA: 0x0000CAE0 File Offset: 0x0000ACE0
        public static bool TryGetEasServerFromConfig(ADRecipient user, string userAgent, out string easServerName)
        {
            OrganizationRelationship organizationRelationship = null;

            easServerName = null;
            if (user == null)
            {
                ExTraceGlobals.FrameworkTracer.TraceError(0L, "[MobileRedirectOptimization] User object is null. Proceeding with <Redirect>.");
                return(false);
            }
            ExTraceGlobals.FrameworkTracer.TraceDebug <string, string>(0L, "[MobileRedirectOptimization] Attempting to retrieve EAS settings with OrganizationRelationship for user {0}, user agent {1}.", MobileRedirectOptimization.SafeGetEmailAddressStringFromADUser(user), userAgent ?? string.Empty);
            string text = FaultInjection.TraceTest <string>((FaultInjection.LIDs) 3866504509U);

            if (text == null)
            {
                if (MobileRedirectOptimization.settings.Member.Enabled)
                {
                    if (MobileRedirectOptimization.settings.Member.UserAgentEnabled(userAgent))
                    {
                        organizationRelationship = MobileRedirectOptimization.GetOrganizationRelationship(user, null);
                    }
                    else
                    {
                        ExTraceGlobals.FrameworkTracer.TraceDebug <string>(0L, "[MobileRedirectOptimization] Redirect bypass is disabled for user agent {0}. Proceeding with <Redirect>.", userAgent ?? string.Empty);
                    }
                }
                else
                {
                    ExTraceGlobals.FrameworkTracer.TraceDebug(0L, "[MobileRedirectOptimization] Redirect bypass is disabled globally. Proceeding with <Redirect>.");
                }
            }
            else
            {
                organizationRelationship = MobileRedirectOptimization.GetOrganizationRelationship(user, text);
            }
            if (organizationRelationship != null)
            {
                if (organizationRelationship.Enabled)
                {
                    easServerName = MobileRedirectOptimization.GetEasServerFromOrgRelationship(user, organizationRelationship);
                }
                else
                {
                    ExTraceGlobals.FrameworkTracer.TraceDebug <string>(0L, "[MobileRedirectOptimization] OrganizationRelationship is disabled for user {0}. Proceeding with <Redirect>.", MobileRedirectOptimization.SafeGetEmailAddressStringFromADUser(user));
                }
            }
            else
            {
                ExTraceGlobals.FrameworkTracer.TraceError <string>(0L, "[MobileRedirectOptimization] OrganizationRelationship retrieval failed for user {0}. Proceeding with <Redirect>.", MobileRedirectOptimization.SafeGetEmailAddressStringFromADUser(user));
            }
            return(easServerName != null);
        }
Пример #2
0
        internal static bool IsRedirectFaultInjectionEnabledOnRequest(bool canFollowRedirect)
        {
            string text = FaultInjection.TraceTest <string>((FaultInjection.LIDs) 2535861565U);

            return(text != null && !canFollowRedirect && VariantConfiguration.InvariantNoFlightingSnapshot.Autodiscover.RedirectOutlookClient.Enabled);
        }