Skip to content

Commit

Permalink
add server-side member NoValueSelected to test "None"
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvand committed Apr 15, 2024
1 parent 4e2896b commit 3345186
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Yvand.LDAPCPSE/TEMPLATE/ADMIN/LDAPCPSE/GlobalSettings.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,7 @@
<li>
<label title="This liste is based on the claim types registered in your SharePoint trust">
<wssawc:EncodedLiteral runat="server" Text="Claim type &#9432;" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting' /><em>*</em></label>
<asp:DropDownList ID="DdlGroupClaimType" runat="server">
<asp:ListItem Selected="True" Value="None"></asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DdlGroupClaimType" runat="server" />
</li>
<li>
<label for="<%= TxtGroupLdapClass.ClientID %>">LDAP object class <em>*</em></label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public partial class GlobalSettingsUserControl : LDAPCPSEUserControl
public new string UserIdentifierEncodedValuePrefix = String.Empty; // This must be a member to be accessible from marup code, it cannot be a property
public new string GroupIdentifierEncodedValuePrefix = String.Empty; // This must be a member to be accessible from marup code, it cannot be a property

readonly string NoValueSelected = "None";
readonly string TextConnectionSuccessful = "Connection successful.";
readonly string TextSummaryPersistedObjectInformation = "Found configuration '{0}' v{1} (Persisted Object ID: '{2}')";
readonly string TextSharePointDomain = "Connect to SharePoint domain";
Expand Down Expand Up @@ -149,6 +150,8 @@ private void PopulateFields()
this.TxtUserIdAdditionalLdapFilter.Text = Settings.ClaimTypes.UserIdentifierConfig.DirectoryObjectAdditionalFilter;

// Group identifier settings
this.DdlGroupClaimType.Items.Add(NoValueSelected);
this.DdlGroupClaimType.Items[0].Selected = true;
var possibleGroupClaimTypes = Utils.GetNonWellKnownUserClaimTypesFromTrust(base.ClaimsProviderName);
foreach (string possibleGroupClaimType in possibleGroupClaimTypes)
{
Expand Down Expand Up @@ -229,7 +232,7 @@ protected bool UpdateConfiguration(bool commitChanges)
Settings.ClaimTypes.SetAdditionalLdapFilterForEntity(this.TxtUserIdAdditionalLdapFilter.Text, DirectoryObjectType.User);

// Group identifier settings
if (!String.Equals(this.DdlGroupClaimType.SelectedValue, "None", StringComparison.OrdinalIgnoreCase))
if (!String.Equals(this.DdlGroupClaimType.SelectedValue, NoValueSelected, StringComparison.OrdinalIgnoreCase))
{
ClaimTypeConfig groupIdConfig = Settings.ClaimTypes.GroupIdentifierConfig;
bool newGroupConfigObject = false;
Expand Down

0 comments on commit 3345186

Please sign in to comment.