嗨,我正在开发 Umbraco(6.1.2) 会员系统,在注册用户被重定向到带有 token_id 的身份验证页面后,我进行了登录、注册和身份验证页面
现在我想为此目的设置此用户批准我编写以下代码但有一些错误检查它
string uname = Request.QueryString["a"];
string uguid = Request.QueryString["b"];
MembershipUser thisUser = Membership.GetUser(uname);
if (thisUser != null)
{
if (!thisUser.IsApproved)
{
MemberProfile mp = MemberProfile.GetUserProfile(uname);
if (mp != null)
{
if (mp.AuthGuid == uguid)
{
thisUser.IsApproved = true;
Membership.UpdateUser(thisUser);
lblMessage.Text = "Thank you for confirming your email address";
}
else
{
lblMessage.Text = "Error confirming your email address";
}
}
else
{
lblMessage.Text = "Error confirming your email address";
}
}
else
{
lblMessage.Text = "Email address is already confirmed";
}
}
控制从这个条件“if (!thisUser.IsApproved)”返回到 else 条件
并且如果我反转它进入 if 块的条件并执行所有命令而没有错误但仍然没有将用户标记为已批准
请帮帮我
Refrence:在激活之前对新成员进行身份验证