Jump to content

simple password reminder


Marty Walker
 Share

Recommended Posts

I know there's a few topics on 'forgot password' but I'm after something simple.

In this case the site owner will setup users in the PW admin and there'll be a login form to allow them to get access to some of the site content. All I really need is a way for a user to punch in their username and to then be emailed their password - I'm not looking for a reset. Any ideas on how to do this?

Thanks

Marty

Link to comment
Share on other sites

Hey Marty, the password is encrypted, which is why this isn't really possible. I guess you could hook into user save and make a copy of the password in a plain text field that could then be emailed, but I am sure everyone would agree that this is not a good idea :)

  • Like 1
Link to comment
Share on other sites

Hey Marty,

But doesn't that module send a new password - I don't think it can send the user an existing password. Not sure how it would help in your case, but maybe I am missing the point.

I am sure what you want to do is quite easy to accomplish, I just think that it might be better to explain to the client why it's not a good idea. Not many sites allow password recovery these days.

EDIT: A password reminder might be a reasonable solution though, rather than sending their actual password. That could easily be stored as a custom field in the user template and emailed out on request.

Link to comment
Share on other sites

That's right Antti's module does send a new password. And that solution is ok too. :) All I need is some way to communicate a password to the user - either their old password or a new one. If it can happen without getting the site administrator involved then great.

-Marty

Link to comment
Share on other sites

Hey adrian,

Right that doesn't sound like best practice at all.

I found this from Antti: http://processwire.com/talk/topic/2145-module-send-user-credentials/?hl=%2Bpassword+%2Breset

Being the PHP noob that I am I know there's a way to tie this to a form but I know not how :)

-Marty

Usage is dead simple:

<?php

// any check where you see if user has posted form and you start processing the form
if ($input->post) {
  $username = $sanitizer->username($input->post->username);
  $u = $users->get("name=$username"); // Of course you could get the user by email or any other information
  $u->of(false);
  $u->send_password = 1; // send_password = whatever you have named your new field
  $u->save();
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...