WebsiteMembership Plugin - Non Generated Password
5 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: February 11, 2010 (RSS)
By chrisl - February 9, 2010
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?
Re: [chrisl] WebsiteMembership Plugin - Non Generated Password
By Chris - February 11, 2010
The existing process has the advantage of making sure that users have supplied real email addresses. If they specify a fake email, they won't receive their temporary password.
If you want to change things, it'll require some coding...
The password is generated by this line in sample_signup.php:
$_REQUEST['password'] = substr(md5(uniqid(rand(), true)), 15); // example output: c5560251ef0b3eef9
If you remove that line and add an <input> in your form for "password", users will be able to supply their own passwords. You'd also want to add some validation checks to make sure people type in a password. You may want to add a "Password again" feature too to make sure people don't mistype their password.
If you want to prevent the email from being sent, simply remove this line:
_websiteLogin_sendSignupMessage();
You'll also want to update the "thanks" message to reflect that no email has been sent.
I hope this helps. Please let me know if you have any questions.
Chris
Re: [chris] WebsiteMembership Plugin - Non Generated Password
By chrisl - February 11, 2010
Re: [chrisl] WebsiteMembership Plugin - Non Generated Password
By Chris - February 11, 2010 - edited: February 11, 2010
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. :)
Chris
Re: [chris] WebsiteMembership Plugin - Non Generated Password
By chrisl - February 11, 2010