private void PopulateSiteProperties(MetabaseReader reader)
        {
            object data = reader.GetData(this.siteAboPath, MetabasePropertyType.ServerBindings);

            if (data != null)
            {
                string[] strArray = (string[])data;
                if (strArray.Length > 0)
                {
                    base.Bindings.Add(Uri.UriSchemeHttp, strArray);
                }
            }
            data = reader.GetData(this.siteAboPath, MetabasePropertyType.SecureBindings);
            if (data != null)
            {
                string[] strArray2 = (string[])data;
                if (strArray2.Length > 0)
                {
                    base.Bindings.Add(Uri.UriSchemeHttps, strArray2);
                }
            }
            foreach (string str in base.Bindings.Keys)
            {
                base.Protocols.Add(str);
            }
        }
Example #2
0
        void PopulateSiteProperties(MetabaseReader reader)
        {
            // 1. ServerBindings
            object propertyValue = reader.GetData(siteAboPath, MetabasePropertyType.ServerBindings);

            if (propertyValue != null)
            {
                string[] serverBindings = (string[])propertyValue;
                if (serverBindings.Length > 0)
                {
                    this.Bindings.Add(Uri.UriSchemeHttp, serverBindings);
                }
            }

            // 2. SecureBindings
            propertyValue = reader.GetData(siteAboPath, MetabasePropertyType.SecureBindings);
            if (propertyValue != null)
            {
                string[] secureBindings = (string[])propertyValue;
                if (secureBindings.Length > 0)
                {
                    this.Bindings.Add(Uri.UriSchemeHttps, secureBindings);
                }
            }

            foreach (string scheme in this.Bindings.Keys)
            {
                this.Protocols.Add(scheme);
            }
        }
        private void PopulateApplicationProperties(MetabaseReader reader)
        {
            int  num   = 0;
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = !base.Bindings.ContainsKey(Uri.UriSchemeHttps);
            bool flag4 = false;

            this.appTransportSettings = new HostedServiceTransportSettings();
            string appAboPath = this.appAboPath;
            object obj2       = null;

            while ((num < 4) && (appAboPath.Length >= this.siteAboPath.Length))
            {
                if (!flag && ((obj2 = reader.GetData(appAboPath, MetabasePropertyType.Realm)) != null))
                {
                    this.appTransportSettings.Realm = (string)obj2;
                    flag = true;
                    num++;
                }
                if (!flag2 && ((obj2 = reader.GetData(appAboPath, MetabasePropertyType.AuthFlags)) != null))
                {
                    this.appTransportSettings.AuthFlags = (AuthFlags)((uint)obj2);
                    flag2 = true;
                    num++;
                }
                if (!flag3 && ((obj2 = reader.GetData(appAboPath, MetabasePropertyType.AccessSslFlags)) != null))
                {
                    this.appTransportSettings.AccessSslFlags = (HttpAccessSslFlags)((uint)obj2);
                    flag3 = true;
                    num++;
                }
                if (!flag4 && ((obj2 = reader.GetData(appAboPath, MetabasePropertyType.AuthProviders)) != null))
                {
                    this.appTransportSettings.AuthProviders = ((string)obj2).Split(IISConstants.CommaSeparator, StringSplitOptions.RemoveEmptyEntries);
                    flag4 = true;
                    num++;
                }
                int length = appAboPath.LastIndexOf('/');
                appAboPath = appAboPath.Substring(0, length);
            }
            if ((this.appTransportSettings.AuthProviders == null) || (this.appTransportSettings.AuthProviders.Length == 0))
            {
                this.appTransportSettings.AuthProviders = MetabaseSettingsIis.DefaultAuthProviders;
            }
        }
 private object FindHierarchicalProperty(MetabaseReader reader, MetabasePropertyType propertyType, string startAboPath, string endAboPath, out string matchedPath)
 {
     matchedPath = null;
     while (endAboPath.Length >= startAboPath.Length)
     {
         object data = reader.GetData(endAboPath, propertyType);
         if (data != null)
         {
             matchedPath = endAboPath;
             return data;
         }
         int length = endAboPath.LastIndexOf('/');
         endAboPath = endAboPath.Substring(0, length);
     }
     return null;
 }
 private object FindHierarchicalProperty(MetabaseReader reader, MetabasePropertyType propertyType, string startAboPath, string endAboPath, out string matchedPath)
 {
     matchedPath = null;
     while (endAboPath.Length >= startAboPath.Length)
     {
         object data = reader.GetData(endAboPath, propertyType);
         if (data != null)
         {
             matchedPath = endAboPath;
             return(data);
         }
         int length = endAboPath.LastIndexOf('/');
         endAboPath = endAboPath.Substring(0, length);
     }
     return(null);
 }
Example #6
0
        object FindHierarchicalProperty(MetabaseReader reader, MetabasePropertyType propertyType, string startAboPath, string endAboPath, out string matchedPath)
        {
            matchedPath = null;
            while (endAboPath.Length >= startAboPath.Length)
            {
                object propertyValue = reader.GetData(endAboPath, propertyType);
                if (propertyValue != null)
                {
                    matchedPath = endAboPath;
                    return(propertyValue);
                }

                // Continue the search in the parent
                int index = endAboPath.LastIndexOf(IISConstants.AboPathDelimiter);
                endAboPath = endAboPath.Substring(0, index);
            }

            return(null);
        }
        object FindHierarchicalProperty(MetabaseReader reader, MetabasePropertyType propertyType, string startAboPath, string endAboPath, out string matchedPath)
        {
            matchedPath = null;
            while (endAboPath.Length >= startAboPath.Length)
            {
                object propertyValue = reader.GetData(endAboPath, propertyType);
                if (propertyValue != null)
                {
                    matchedPath = endAboPath;
                    return propertyValue;
                }

                // Continue the search in the parent
                int index = endAboPath.LastIndexOf(IISConstants.AboPathDelimiter);
                endAboPath = endAboPath.Substring(0, index);
            }

            return null;
        }
        void PopulateApplicationProperties(MetabaseReader reader)
        {
            int foundCount = 0;
            bool foundRealm = false;
            bool foundAuthFlags = false;
            bool foundAccessSslFlags = !Bindings.ContainsKey(Uri.UriSchemeHttps);
            bool foundAuthProviders = false;

            appTransportSettings = new HostedServiceTransportSettings();

            string endAboPath = appAboPath;
            object propertyValue = null;
            while (foundCount < 4 && endAboPath.Length >= siteAboPath.Length)
            {
                // Realm
                if (!foundRealm && ((propertyValue = reader.GetData(endAboPath, MetabasePropertyType.Realm))
                    != null))
                {
                    appTransportSettings.Realm = (string)propertyValue;
                    foundRealm = true;
                    foundCount++;
                }

                // AuthFlags
                if (!foundAuthFlags && ((propertyValue = reader.GetData(endAboPath, MetabasePropertyType.AuthFlags))
                    != null))
                {
                    appTransportSettings.AuthFlags = (AuthFlags)(uint)propertyValue;
                    foundAuthFlags = true;
                    foundCount++;
                }

                // AccessSslFlags
                if (!foundAccessSslFlags && ((propertyValue = reader.GetData(endAboPath, MetabasePropertyType.AccessSslFlags))
                    != null))
                {
                    appTransportSettings.AccessSslFlags = (HttpAccessSslFlags)(uint)propertyValue;
                    foundAccessSslFlags = true;
                    foundCount++;
                }

                // NTAuthProviders
                if (!foundAuthProviders && ((propertyValue = reader.GetData(endAboPath, MetabasePropertyType.AuthProviders))
                    != null))
                {
                    string providersString = (string)propertyValue;
                    appTransportSettings.AuthProviders = providersString.Split(IISConstants.CommaSeparator, StringSplitOptions.RemoveEmptyEntries);
                    foundAuthProviders = true;
                    foundCount++;
                }

                // Continue the search in the parent path
                int index = endAboPath.LastIndexOf(IISConstants.AboPathDelimiter);
                endAboPath = endAboPath.Substring(0, index);
            }

            if (appTransportSettings.AuthProviders == null || appTransportSettings.AuthProviders.Length == 0)
            {
                appTransportSettings.AuthProviders = DefaultAuthProviders;
            }
        }
        void PopulateSiteProperties(MetabaseReader reader)
        {
            // 1. ServerBindings
            object propertyValue = reader.GetData(siteAboPath, MetabasePropertyType.ServerBindings);
            if (propertyValue != null)
            {
                string[] serverBindings = (string[])propertyValue;
                if (serverBindings.Length > 0)
                {
                    this.Bindings.Add(Uri.UriSchemeHttp, serverBindings);
                }
            }

            // 2. SecureBindings
            propertyValue = reader.GetData(siteAboPath, MetabasePropertyType.SecureBindings);
            if (propertyValue != null)
            {
                string[] secureBindings = (string[])propertyValue;
                if (secureBindings.Length > 0)
                {
                    this.Bindings.Add(Uri.UriSchemeHttps, secureBindings);
                }
            }

            foreach (string scheme in this.Bindings.Keys)
            {
                this.Protocols.Add(scheme);
            }
        }
Example #10
0
        void PopulateApplicationProperties(MetabaseReader reader)
        {
            int  foundCount          = 0;
            bool foundRealm          = false;
            bool foundAuthFlags      = false;
            bool foundAccessSslFlags = !Bindings.ContainsKey(Uri.UriSchemeHttps);
            bool foundAuthProviders  = false;

            appTransportSettings = new HostedServiceTransportSettings();

            string endAboPath    = appAboPath;
            object propertyValue = null;

            while (foundCount < 4 && endAboPath.Length >= siteAboPath.Length)
            {
                // Realm
                if (!foundRealm && ((propertyValue = reader.GetData(endAboPath, MetabasePropertyType.Realm))
                                    != null))
                {
                    appTransportSettings.Realm = (string)propertyValue;
                    foundRealm = true;
                    foundCount++;
                }

                // AuthFlags
                if (!foundAuthFlags && ((propertyValue = reader.GetData(endAboPath, MetabasePropertyType.AuthFlags))
                                        != null))
                {
                    appTransportSettings.AuthFlags = (AuthFlags)(uint)propertyValue;
                    foundAuthFlags = true;
                    foundCount++;
                }

                // AccessSslFlags
                if (!foundAccessSslFlags && ((propertyValue = reader.GetData(endAboPath, MetabasePropertyType.AccessSslFlags))
                                             != null))
                {
                    appTransportSettings.AccessSslFlags = (HttpAccessSslFlags)(uint)propertyValue;
                    foundAccessSslFlags = true;
                    foundCount++;
                }

                // NTAuthProviders
                if (!foundAuthProviders && ((propertyValue = reader.GetData(endAboPath, MetabasePropertyType.AuthProviders))
                                            != null))
                {
                    string providersString = (string)propertyValue;
                    appTransportSettings.AuthProviders = providersString.Split(IISConstants.CommaSeparator, StringSplitOptions.RemoveEmptyEntries);
                    foundAuthProviders = true;
                    foundCount++;
                }

                // Continue the search in the parent path
                int index = endAboPath.LastIndexOf(IISConstants.AboPathDelimiter);
                endAboPath = endAboPath.Substring(0, index);
            }

            if (appTransportSettings.AuthProviders == null || appTransportSettings.AuthProviders.Length == 0)
            {
                appTransportSettings.AuthProviders = DefaultAuthProviders;
            }
        }
 private void PopulateSiteProperties(MetabaseReader reader)
 {
     object data = reader.GetData(this.siteAboPath, MetabasePropertyType.ServerBindings);
     if (data != null)
     {
         string[] strArray = (string[]) data;
         if (strArray.Length > 0)
         {
             base.Bindings.Add(Uri.UriSchemeHttp, strArray);
         }
     }
     data = reader.GetData(this.siteAboPath, MetabasePropertyType.SecureBindings);
     if (data != null)
     {
         string[] strArray2 = (string[]) data;
         if (strArray2.Length > 0)
         {
             base.Bindings.Add(Uri.UriSchemeHttps, strArray2);
         }
     }
     foreach (string str in base.Bindings.Keys)
     {
         base.Protocols.Add(str);
     }
 }
 private void PopulateApplicationProperties(MetabaseReader reader)
 {
     int num = 0;
     bool flag = false;
     bool flag2 = false;
     bool flag3 = !base.Bindings.ContainsKey(Uri.UriSchemeHttps);
     bool flag4 = false;
     this.appTransportSettings = new HostedServiceTransportSettings();
     string appAboPath = this.appAboPath;
     object obj2 = null;
     while ((num < 4) && (appAboPath.Length >= this.siteAboPath.Length))
     {
         if (!flag && ((obj2 = reader.GetData(appAboPath, MetabasePropertyType.Realm)) != null))
         {
             this.appTransportSettings.Realm = (string) obj2;
             flag = true;
             num++;
         }
         if (!flag2 && ((obj2 = reader.GetData(appAboPath, MetabasePropertyType.AuthFlags)) != null))
         {
             this.appTransportSettings.AuthFlags = (AuthFlags) ((uint) obj2);
             flag2 = true;
             num++;
         }
         if (!flag3 && ((obj2 = reader.GetData(appAboPath, MetabasePropertyType.AccessSslFlags)) != null))
         {
             this.appTransportSettings.AccessSslFlags = (HttpAccessSslFlags) ((uint) obj2);
             flag3 = true;
             num++;
         }
         if (!flag4 && ((obj2 = reader.GetData(appAboPath, MetabasePropertyType.AuthProviders)) != null))
         {
             this.appTransportSettings.AuthProviders = ((string) obj2).Split(IISConstants.CommaSeparator, StringSplitOptions.RemoveEmptyEntries);
             flag4 = true;
             num++;
         }
         int length = appAboPath.LastIndexOf('/');
         appAboPath = appAboPath.Substring(0, length);
     }
     if ((this.appTransportSettings.AuthProviders == null) || (this.appTransportSettings.AuthProviders.Length == 0))
     {
         this.appTransportSettings.AuthProviders = MetabaseSettingsIis.DefaultAuthProviders;
     }
 }