WebsiteMembership Plugin - Non Generated Password

By chrisl - February 9, 2010

Hi

Love this plugin and would encourage others to use.

Right now I have it set with the email being the username and the program sending a password over to user. QUESTION: A few members are getting confused with the process (don't get me started) so is it possible to have the user fill in the signup.php with both the username and password thereby avoiding the email part of the process?
cj

Re: [chris] WebsiteMembership Plugin - Non Generated Password

By chrisl - February 11, 2010

Yes I see the logic in the way it is designed. I will not amend it. The statement $_REQUEST['password'] = substr(md5(uniqid(rand(), true)), 15); // example output: c5560251ef0b3eef9 - is the "15" the command that generates the length of the password (trying to simplify it for our members)? So if you replace 15 with say 5 it would generate a shorter password?
cj

Re: [chrisl] WebsiteMembership Plugin - Non Generated Password

By Chris - February 11, 2010 - edited: February 11, 2010

Hi chrisl,

Almost. The 15 skips the first 15 characters of the 32 characters returned by md5(), resulting in a 17 character string. To get 5 characters, try this:

$_REQUEST['password'] = substr(md5(uniqid(rand(), true)), 0, 5); // example output: c5560

That's a great solution. :)
All the best,
Chris

Re: [chris] WebsiteMembership Plugin - Non Generated Password

By chrisl - February 11, 2010

Outstanding. Works like a charm.
cj