Beispiel #1
0
        // Token: 0x06000393 RID: 915 RVA: 0x00016338 File Offset: 0x00014538
        private static void AddSettingToResponse(DomainResponse domainResponse, DomainStringSetting setting, string settingName)
        {
            if (setting != null)
            {
                domainResponse.DomainSettings.Add(setting);
                return;
            }
            DomainSettingError domainSettingError = new DomainSettingError();

            domainSettingError.SettingName  = settingName;
            domainSettingError.ErrorCode    = ErrorCode.SettingIsNotAvailable;
            domainSettingError.ErrorMessage = string.Format(Strings.SettingIsNotAvailable, settingName);
            domainResponse.DomainSettingErrors.Add(domainSettingError);
        }
Beispiel #2
0
 // Token: 0x06000397 RID: 919 RVA: 0x00016598 File Offset: 0x00014798
 private void ExecuteGetDomainSettingsCommand(IPrincipal callingPrincipal, GetDomainSettingsCallContext callContext)
 {
     this.CheckIdentity(callingPrincipal);
     if (callContext.RequestedSettings.Contains(DomainConfigurationSettingName.ExternalEwsUrl) && callContext.Domains != null && callContext.Domains.Count > 0)
     {
         Uri uri;
         int currentExchangeMajorVersion;
         if (Common.SkipServiceTopologyInDatacenter())
         {
             uri = FrontEndLocator.GetDatacenterFrontEndWebServicesUrl();
             currentExchangeMajorVersion = Server.CurrentExchangeMajorVersion;
         }
         else
         {
             uri = GetDomainSettingsRequestMessage.GetRandomCasExternalServiceUri <WebServicesService>(callContext.RequestedVersion, out currentExchangeMajorVersion);
         }
         DomainStringSetting setting  = null;
         DomainStringSetting setting2 = null;
         if (null != uri)
         {
             setting = new DomainStringSetting
             {
                 Name  = GetDomainSettingsRequestMessage.externalEwsUrlSettingName,
                 Value = uri.AbsoluteUri
             };
         }
         bool flag = callContext.RequestedSettings.Contains(DomainConfigurationSettingName.ExternalEwsVersion);
         if (flag)
         {
             ServerVersion serverVersion = new ServerVersion(currentExchangeMajorVersion);
             setting2 = new DomainStringSetting
             {
                 Name  = GetDomainSettingsRequestMessage.externalEwsVersionSettingName,
                 Value = string.Format(CultureInfo.InvariantCulture, "{0:d}.{1:d2}.{2:d4}.{3:d3}", new object[]
                 {
                     serverVersion.Major,
                     serverVersion.Minor,
                     serverVersion.Build,
                     serverVersion.Revision
                 })
             };
         }
         using (IEnumerator <string> enumerator = callContext.Domains.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 string         text           = enumerator.Current;
                 DomainResponse domainResponse = new DomainResponse();
                 domainResponse.ErrorCode           = ErrorCode.NoError;
                 domainResponse.ErrorMessage        = Strings.NoError;
                 domainResponse.DomainSettingErrors = new DomainSettingErrorCollection();
                 domainResponse.DomainSettings      = new DomainSettingCollection();
                 GetDomainSettingsRequestMessage.AddSettingToResponse(domainResponse, setting, GetDomainSettingsRequestMessage.externalEwsUrlSettingName);
                 if (flag)
                 {
                     GetDomainSettingsRequestMessage.AddSettingToResponse(domainResponse, setting2, GetDomainSettingsRequestMessage.externalEwsVersionSettingName);
                 }
                 callContext.Response.DomainResponses.Add(domainResponse);
             }
             return;
         }
     }
     callContext.Response.ErrorCode    = ErrorCode.InvalidRequest;
     callContext.Response.ErrorMessage = Strings.InvalidRequest;
 }