Membership settings

Topics: Developer Discussion
May 5, 2008 at 1:48 PM
We just started using the site (have not made it live yet, still configuring version 2) and I have a couple questions related to the memberships section. 1) Is there a way to require memberships to be approved before allowing people access to the site? 2) Can the display of the e-mail address be set to only display for members? (I know version 3 has an option to hide e-mail.) 3) How hard is it to add controls for date joined, last date dues payed (or track dues) and have the ability to create reports for admins to see who's accounts are expired?

May 20, 2008 at 3:09 PM
Edited May 20, 2008 at 3:09 PM
1) Version 3 has controls for administrators to change the settings to require admin approval, email verification or both. I'd suggest checking out the source code to get a better understanding of how they implemented it.

2) For any control you only want members to be able to see on an individual page:



Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
YourControl.Visible = False
If Page.User.Identity.IsAuthenticated = True Then
YourControl.Visible = True
End If
End Sub

To restrict viewing to individual role groups:

YourControl.Visible = False
If Page.User.IsInRole ("YourRoleName") Then
YourControl.Visible  = True

To control viewing of the page entirely, in the Web.Config file set authorization to deny any user who's identity isn't verified.
<location path ="YourPage.aspx">
<deny users="?"/>