Пример #1
0
 public void UpdateRegionalSettings(RegionalSettingsConfiguration settings)
 {
     this.DateFormat  = settings.DateFormat;
     this.TimeFormat  = settings.TimeFormat;
     base.UserCulture = RoleBasedStringMapping.GetRoleBasedCultureInfo(settings.UserCulture, base.RbacConfiguration.RoleTypes);
     this.UpdateUserTimeZone(settings.TimeZone);
 }
Пример #2
0
        public override void RequestReceived()
        {
            this.ThrowIfUserIsMailboxButNoMyBaseOptions();
            this.RedirectIfUserEsoSelf();
            this.RedirectIfTargetTenantSpecifiedForRegularAdmin();
            bool        flag        = !this.HasRegionalSettings;
            HttpContext httpContext = HttpContext.Current;

            DiagnosticsBehavior.CheckSystemProbeCookie(httpContext);
            string text = HttpContext.Current.Request.QueryString["mkt"];

            if (string.IsNullOrEmpty(text))
            {
                text = HttpContext.Current.Request.QueryString["mkt2"];
            }
            if (this.HasRegionalSettings && !string.IsNullOrEmpty(text))
            {
                try
                {
                    CultureInfo cultureInfoByIetfLanguageTag = CultureInfo.GetCultureInfoByIetfLanguageTag(text);
                    if (Culture.IsSupportedCulture(cultureInfoByIetfLanguageTag) && base.UserCulture.LCID != RoleBasedStringMapping.GetRoleBasedCultureInfo(cultureInfoByIetfLanguageTag, base.RbacConfiguration.RoleTypes).LCID)
                    {
                        flag = true;
                    }
                }
                catch (ArgumentException)
                {
                }
            }
            if (flag)
            {
                this.InitializeRegionalSettings();
                if (!this.HasRegionalSettings)
                {
                    if (!(httpContext.Request.HttpMethod == "GET"))
                    {
                        throw new RegionalSettingsNotConfiguredException(base.ExecutingUserId);
                    }
                    base.RbacConfiguration.ExecutingUserLanguagesChanged = true;
                    string url = string.Format(EcpUrl.OwaVDir + "languageselection.aspx?url={0}", HttpUtility.UrlEncode(EcpUrl.ProcessUrl(httpContext.GetRequestUrlPathAndQuery())));
                    httpContext.Response.Redirect(url, true);
                }
            }
            base.RequestReceived();
        }