Lost Password Email...
 
Notifications
Clear all

Lost Password Emails

6 Posts
3 Users
0 Reactions
1,615 Views
(@lyndsie)
Posts: 1263
Member Moderator
Topic starter
 

I've searched, but was unable to find anyone addressing this topic.

We have a HUGE problem with duplicate (or triplicate, quadruplicate) accounts at the archive I manage.  (dracoandginny.com, not my test site)  My estimates put the duplicate accounts in the thousands, even though I go through the action log on a daily basis and delete several per day (it's fairly obvious when the same IP address requests a new password and then immediately afterward registers for a new account).  I've also deleted somewhere in the neighborhood of 4000 unused accounts, with another couple thousand that I know are unused but haven't cleared yet.  With currently ~13200 accounts, this is a problem for features that require the entire members list to load, such as admin editing of stories, etc.  I'm currently working on a module to try to analyze and find duplicate accounts (via identical passwords, similar emails, etc.) but I'd like to try a small preventative measure if I could.

I also get 5-10 emails a week about people who are unable to access their account, and tell me that even though they received the new password email, the password doesn't work.  That's just the conscientious souls who actually bother to email.  Most don't.  The problem is not, in fact, that the passwords are wrong, it's that they don't know their usernames.

So, the point of this?  Does anyone know how to add the username to the password generation email?  I've tried, but I can't figure it out for the life of me, and I'm banging my head against the wall.  If this is added, I think it would cut down on the number of duplicate accounts created.

I just want it to say, basically:

Dear [username],

Your password has been reset and here it is blah blah....

So basically the same, just with their username in there.  I thought this would be easy, but I'm stumped.  Maybe it is easy, and I'm missing something.  Help?


 
Posted : 03/02/2009 1:40 pm
(@jacynthe)
Posts: 242
Estimable Member
 

well the message in itself is being determined from the language file so en.php or whichever language you are using on your site. And seeing as to how the password is not even using a variable as $password but rather %s .. I'm not entirely sure how you'd include the membername in there sadly enough. I'm at work right now so I can't spend too much time digging into that but if anything else, I could try when I get home tonight.


Jacynthe

Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP:  5.3.3
MySQL: 5.0.91-community

 
Posted : 03/02/2009 2:00 pm
(@lyndsie)
Posts: 1263
Member Moderator
Topic starter
 

Thanks!  I tried a bunch of stuff in en.php, but couldn't get it to work.  I could definitely use another set of eyes.

The new registration email definitely puts the username in there.  I think at one point I tried leveraging that but also failed. : (


 
Posted : 03/02/2009 3:17 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
 

The language file.

The original is something like this:

define ("_NEWPWDMSG", "Hello, you appear to have requested a new password for $sitename. Your new password is:nnPassword: %snnIt is recommended that you log in and change the password to something easier for you to remember.");

Change it to something using these variables... for example:

Hello %1$s [username]
Your password is %2$s [password]

Then in the user/lostpassword.php find this:

$mailtext = sprintf(_NEWPWDMSG, $pass);

Change it to:

$mailtext = sprintf(_NEWPWDMSG, $penname, $pass);

OK. This is untested, and I'm not at all comfortable with sprintf()... (particularly unsure of what $penname is being used in the lostpassword.php file) so you might want to use this on your test site first. If it doesn't work, play around with it or let me know. πŸ˜›


archive: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 03/02/2009 3:20 pm
(@jacynthe)
Posts: 242
Estimable Member
 

Okay, I tested this and here's the way you would need to change the en.php file.


Hello %1$s, you appear to have requested a new password for $sitename. Your new password is:nnPassword: %2$snnIt is recommended that you log in and change the password to something easier for you to remember.");

And Jenny's code in the lostpassword.php file does the trick. The email I got was:

Hello Jacynthe, you appear to have requested a new password for The Library of Congress. Your new password is: Password: ******** It is recommended that you log in and change the password to something easier for you to remember.

Of course, you could change the format to have it be something like:


Hello,nn You appear to have requested a new password for $sitename. Your login information is as follow:nnUsername: %1$snnNew password: %2$snnIt is recommended that you log in and change the password to something easier for you to remember.");

Jacynthe

Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP:  5.3.3
MySQL: 5.0.91-community

 
Posted : 03/02/2009 8:40 pm
(@lyndsie)
Posts: 1263
Member Moderator
Topic starter
 

Thanks guys!  When I was trying I think I got the en.php part, but don't think I got the lostpassword.php part quite right.  YAY for help. : )

Now, if you think of an easy way to delete a couple thousand accounts, let me know.  : P


 
Posted : 04/02/2009 12:55 am
Share: