hi i am working on Umbraco(6.1.2) membership system ive made login ,registration, and authentication page after registeration user is redirected to authentication page with token_id
now i want to set this user approved for this purpose i write the following code but there is some error check it
Approve User Umbraco membership
hi i am working on Umbraco(6.1.2) membership system
ive made login ,registration, and authentication page
after registeration user is redirected to authentication page with token_id
now i want to set this user approved for this purpose i write the following code
but there is some error check it
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";
}
}
else
{
lblMessage.Text = "User not found";
}
control is return to else condition from this condition "if (!thisUser.IsApproved)"
and also if i reverse the condition it gets into if block and executes all commands without errors but still not mark user as approved
plz help me
If you don't mind using the Umbraco API this blog might help: http://www.nibble.be/?p=66
Jeroen
This blog might help: http://www.nibble.be/?p=66
Jeroen
Yea i would use the final url Jeroen posted. Has the umbraco API now been phased out? does it not use the ASP.net membership provider?
In a nut shell,
Get the user
Create a profile base
Get the approved property (this will be a checkbox)
Do your work
Set the property or return an error / message
save profile base
return
Hope this helps. Charlie :)
Charles
i am using umbracomembershipprovider not using ASP.net membershipprovider
Hello,
The member api will get a new version, but the old api is still the best thing for now. The obsolete attributes have even been removed again in the latest version of Umbraco: https://github.com/umbraco/Umbraco-CMS/commit/7c6aee17e90d4b59a29cbcabf915475510c072c7
New member api: http://issues.umbraco.org/issue/U4-1659
So this documentation is still good: http://our.umbraco.org/wiki/reference/api-cheatsheet/working-with-members
Jeroen
Hmm somehow the links aren't clickable. They are in this topic: http://our.umbraco.org/forum/developers/api-questions/42337-How-to-create-members-and-assign-to-roles-using-API-in-Umbraco-6x#comment153737
Jeroen
Sorry just what i read? So can you still use the Umbraco member api Jeroen? Charlie :)
Yes the Umbraco member api is still the best thing to use.
Jeroen
Ok, thanks :). Should i use that to access custom member properties? I read somewhere you had to do it thought profile base and not the api?
is working on a reply...