コード例 #1
0
        private void InitializeAugmentation()
        {
            IEnumerable <ClaimTypeConfig> potentialGroupClaimTypes = PersistedObject.ClaimTypes.Where(x => x.EntityType == DirectoryObjectType.Group && !x.UseMainClaimTypeOfDirectoryObject);

            if (potentialGroupClaimTypes == null || potentialGroupClaimTypes.Count() == 0)
            {
                LabelErrorMessage.Text = TextErrorNoGroupClaimType;
                return;
            }

            foreach (var potentialGroup in potentialGroupClaimTypes)
            {
                DdlClaimTypes.Items.Add(potentialGroup.ClaimType);
            }

            ChkEnableAugmentation.Checked = PersistedObject.EnableAugmentation;

            if (!String.IsNullOrEmpty(PersistedObject.MainGroupClaimType) && DdlClaimTypes.Items.FindByValue(PersistedObject.MainGroupClaimType) != null)
            {
                DdlClaimTypes.SelectedValue = PersistedObject.MainGroupClaimType;
            }

            // Initialize grid for LDAP connections
            var spDomainCoco = PersistedObject.LDAPConnectionsProp.FirstOrDefault(x => x.UseSPServerConnectionToAD);

            if (spDomainCoco != null)
            {
                spDomainCoco.LDAPPath = TextSharePointDomain;
            }

            GridLdapConnections.DataSource   = PersistedObject.LDAPConnectionsProp;
            GridLdapConnections.DataKeyNames = new string[] { "Identifier" };
            GridLdapConnections.DataBind();
        }
コード例 #2
0
ファイル: GlobalSettings.ascx.cs プロジェクト: wtawtaw/LDAPCP
        private void InitializeAugmentation()
        {
            IEnumerable <AttributeHelper> potentialGroupClaimTypes = PersistedObject.AttributesListProp.Where(x => x.ClaimEntityType == SPClaimEntityTypes.FormsRole || x.ClaimEntityType == SPClaimEntityTypes.SecurityGroup);

            if (potentialGroupClaimTypes == null || potentialGroupClaimTypes.Count() == 0)
            {
                LabelErrorMessage.Text = TextErrorNoGroupClaimType;
                return;
            }

            foreach (var potentialGroup in potentialGroupClaimTypes)
            {
                DdlClaimTypes.Items.Add(potentialGroup.ClaimType);
            }

            ChkEnableAugmentation.Checked = PersistedObject.AugmentationEnabledProp;

            if (!String.IsNullOrEmpty(PersistedObject.AugmentationClaimTypeProp) && DdlClaimTypes.Items.FindByValue(PersistedObject.AugmentationClaimTypeProp) != null)
            {
                DdlClaimTypes.SelectedValue = PersistedObject.AugmentationClaimTypeProp;
            }

            // Initialize grid for LDAP connections
            var spDomainCoco = PersistedObject.LDAPConnectionsProp.FirstOrDefault(x => x.UserServerDirectoryEntry);

            if (spDomainCoco != null)
            {
                spDomainCoco.Path = TextSharePointDomain;
            }

            GridLdapConnections.DataSource   = PersistedObject.LDAPConnectionsProp;
            GridLdapConnections.DataKeyNames = new string[] { "IdProp" };
            GridLdapConnections.DataBind();
        }