In my MemberType I have a True/False datatype called Active.
On my MemberLogin user control page my asp.net member login control looks like
<asp:Login ID="lgMember" OnLoggingIn="Login1_LoggedIn" CssClass="login" VisibleWhenLoggedIn="false" DestinationPageUrl="/Members.aspx"
LabelStyle-VerticalAlign="middle" LabelStyle-CssClass="LoginLabel" TextBoxStyle-Width="100px" UserNameLabelText="Login"
PasswordLabelText="Password" TitleText="" DisplayRememberMe="false" runat="server" />
In the codebehind my Login1_LoggedIn event looks like.
protected void Login1_LoggedIn(object sender, EventArgs e)
{
//get member
Member m = Member.GetMemberByName(((Login)sender).UserName.ToString(), false).First();
if (m.getProperty("Active").Value.ToString() != "1")
{
FormsAuthentication.SignOut();
HttpContext.Current.Response.Redirect(umbraco.library.NiceUrl(1091));
}
}
This will redirect the user to a page explaining their membership hasn't been enabled yet.
No comments:
Post a Comment