YAFLogo

cbsportal
  • cbsportal
  • 55.6% (Neutral)
  • YAF Forumling Topic Starter YAF Version: 2.3.0.2
a year ago
If the user forgets her password, I want to show her password in the page if she answers the reminder question correctly. I want to show the password in the same page, I do not want to be sent an e-mail. how can I do that?

YAF.NET Version: 2.3.0.2
Sponsor

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
a year ago
Originally Posted by: cbsportal 

If the user forgets her password, I want to show her password in the page if she answers the reminder question correctly. I want to show the password in the same page, I do not want to be sent an e-mail. how can I do that?

YAF.NET Version: 2.3.0.2



In that case Modify the method PasswordRecovery1_SendingMail in the file pages/recoverpassword.ascx.cs and instead of send the mail display it in the success template.
cbsportal
  • cbsportal
  • 55.6% (Neutral)
  • YAF Forumling Topic Starter YAF Version: 2.3.0.2
a year ago
Thank you for your answer, but I don't understand how to do it, can you explain in more detail?
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
a year ago
Okay i try.

Replace the line in the file Pages/recoverpassword.ascx...
 <YAF:LocalizedLabel ID="LocalizedLabel10" runat="server" LocalizedTag="PASSWORD_SENT" />

with
 <asp:Label ID="PasswordMessage" runat="server"></asp:Label>

and in the file recoverpassword.ascx.cs

Replace Line
passwordRetrieval.SendEmail(e.Message.To[0], subject, true);

with


 var passwordMessage =
                this.PasswordRecovery1.SuccessTemplateContainer
                    .FindControlAs<Label>("PasswordMessage");
passwordMessage.Text = password;

Recompile the Solution and done.
cbsportal
  • cbsportal
  • 55.6% (Neutral)
  • YAF Forumling Topic Starter YAF Version: 2.3.0.2
a year ago
I get this error,  I made the necessary changes in the Pages/recoverpassword.ascx file
 error.png You have insufficient rights to see the content.
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
a year ago
i updated  the code above!
cbsportal
  • cbsportal
  • 55.6% (Neutral)
  • YAF Forumling Topic Starter YAF Version: 2.3.0.2
a year ago
I made the changes, but random characters are constantly coming, characters change every time

 Adsız.png You have insufficient rights to see the content.
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
a year ago
That text is the password!
cbsportal
  • cbsportal
  • 55.6% (Neutral)
  • YAF Forumling Topic Starter YAF Version: 2.3.0.2
a year ago
thank you so much
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button