protected void btnChangePassword_Click(object sender, EventArgs e)
{
string UserName = HttpContext.Current.User.Identity.Name;
DotNetNuke.Entities.Users.UserInfo userInfo = DotNetNuke.Entities.Users.UserController.GetUserByName(PortalId, UserName);
DotNetNuke.Security.Membership.MembershipProvider membershipProvider = DotNetNuke.Security.Membership.MembershipProvider.Instance();
if (membershipProvider.PasswordFormat == DotNetNuke.Security.Membership.PasswordFormat.Encrypted)
{
string oldPassword = DotNetNuke.Entities.Users.UserController.GetPassword(ref userInfo, userInfo.Membership.PasswordAnswer);
if (oldPassword == txtOldPassword.Text)
{
string newPassword = txtNewPassword.Text.Trim();//DotNetNuke.Entities.Users.UserController.GeneratePassword(membershipProvider.MinPasswordLength);
DotNetNuke.Entities.Users.UserController.ChangePassword(userInfo, oldPassword, newPassword);
txtOldPassword.Text = "";
txtNewPassword.Text = "";
txtOldPassword.Focus();
lblmsg.Text = "Password changed successfully.";
}
else
{
lblmsg.Text = "OldPassword did not match.";
}
}
}
Hi, Firoz,
ReplyDeleteNice post,thanks for sharing this information.Looking forward similar posts .
Dotnetnuke developers
I love you
ReplyDeletethis is really nice to read..informative post is very good to read..thanks a lot!
ReplyDeletejiofi 2 settings
This is a great post, thanks for the info!
ReplyDeleteDotNetNuke
There's definitely a great deal to find out about this topic. I love all of the points you've made. This was an extremely wonderful article. Thanks for supplying this info. Check out this article for more info about DotNetNuke Development - A Cost Effective Option For Enterprise.
ReplyDeleteGood Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleteDotNet Nuke training in
Electronic City
Great post, keep on sharing such amazing posts!JioFiLocalHtml
ReplyDelete