YAFLogo

cbsportal
  • cbsportal
  • 55.6% (Neutral)
  • YAF Forumling Topic Starter YAF Version: 2.3.0.2
3 years 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: 4.0.1 BETA
3 years 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

Originally Posted by: cbsportal 

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
3 years 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: 4.0.1 BETA
3 years 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
3 years 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: 4.0.1 BETA
3 years ago
i updated  the code above!
cbsportal
  • cbsportal
  • 55.6% (Neutral)
  • YAF Forumling Topic Starter YAF Version: 2.3.0.2
3 years 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: 4.0.1 BETA
3 years ago
That text is the password!
cbsportal
  • cbsportal
  • 55.6% (Neutral)
  • YAF Forumling Topic Starter YAF Version: 2.3.0.2
3 years ago
thank you so much