Firstly:
a
BIG BIG BIG thanks goes to
Susan Ottwell for helping me with this in the
IRC Chatroom.
Now... to the point.
Ever wanted to have users sign up to your website but want to authenticate their email address they typed in? Then the attached file is for you.
Create a chunk for your registration form
WITHOUT any password fields. Then use the
[tt]&tpl[/tt] parameter in the
[tt][[WebSignup]][/tt] snippet to reference your chunk.
Copy
websignup.inc.php in the attached
.zip file and extract it to
/assets/snippets/weblogin/ overwriting the original.
That’s it. When a user registers, they are sent an email with their selected username and a randomly generated password. They can only login if the email address they provided upon registration is valid. (Don’t forget to give them access to the
[tt][[WebChangePwd]][/tt] snippet somewhere so they can change that horrendous password.
The changes to the file (that Susan so kindly pointed out to me) are that the "
[tt]// verify password[/tt]" bit is moved so it is directly above the "
[tt]// check password[/tt]" bit. Then both bits are wrapped in an [tt]if[/tt] statement. If the password is not set in the form, then it uses the
[tt]webLoginGeneratePassword()[/tt] function instead.
There is a [tt]FileComparisonReport.html[/tt] (as usual with me) to outline the differences between our modded file (left) and the original that shipped with MODx 0.9.1 (right).
A feature request has been made in FlySpray