PDA

View Full Version : Better activation e-mail system then jointime


MattR
Sun 27th May '01, 1:46pm
I would like it for all of my users to have a valid e-mail address. Seems pretty simple because vB e-mails them a URL that they need to click to get in. However what happens if a user then goes into their cp and changes their e-mail to a bogus value?

Nothing.

So what I propose (and what I went and implemented on my forums):
if you set "validate e-mails" to ON in the CP then upon user signup don't ask them for a password.
When you insert their information into the DB then generate a password (e.g. 6 to 10 characters, random letters and numbers which aren't ambiguous, no 1 or I etc.) and e-mail THAT to them instead.

That way the user is already "active" in that vB doesn't need to do anything else; once the e-mail arrives the password is in it and then they log in. Simple and doesn't require an UPDATE user SET usergroupid = X when (if) the user clicks on the link.

This method also removes the problematic "I couldn't click on the link" from some of our less computer-savvy users.

After they are registered if the user then tries to change their e-mail address let them know this will reset their password to a random one (again 6-10 chars, etc.) and then mail it to their new account.

We need this mainly to ensure that if we want to e-mail a user we have an address that we know they at least checked ONCE :) -- if they violate the CS I send them a PM and an E-mail but PMs aren't always checked that often.

SteveK
Mon 28th May '01, 11:09pm
This seems like a better way to handle this. Can you write this up as a mod for us all to implement if we want?

Thanks

bira
Mon 28th May '01, 11:15pm
*cough*

http://vbulletin.com/forum/showthread.php?s=&threadid=15987

MattR
Mon 28th May '01, 11:21pm
It's a slightly different "hack" but yes along those lines. If a user changes their e-mail address mid-way from what I can tell your hack doesn't re-email them their password and such. As I said I already wrote it so I don't need a hack but it would be nice to include this as a standard in 2.0 so I don't have to keep applying the hack over and over (etc.).

bira
Mon 28th May '01, 11:28pm
Yes it does, Matt.

Register on my bulletin board for a test

http://www.atlasf1.com/bb/index.php

MattR
Mon 28th May '01, 11:32pm
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in /usr/www/atlasf1/htdocs/www.atlasf1.com/bb/admin/db_mysql.php on line 40

There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.


:confused: :( But I'll take your word for it! :)

bira
Mon 28th May '01, 11:40pm
heh, I just shut down MySQL to run myisamchk. Try now :)

MattR
Tue 29th May '01, 12:43am
Looks good; exactly what I hacked into vB1.x!

I suggest that you strip out some characters to make it easier for people to type in (e.g. o, O, 0, 1, l, etc.). I used a password generator from Zend.com which is like this:


// set password length
$pw_length = 8;

// set ASCII range for random character generation
$lower_ascii_bound = 50; // "2"
$upper_ascii_bound = 122; // "z"

// Exclude special characters and some confusing alphanumerics
// o,O,0,I,1,l etc
$notuse = array( 58, 59, 60, 61, 62, 63, 64, 73, 79, 91, 92, 93, 94, 95, 96, 108, 111 );

while( $i < $pw_length ) {
mt_srand( (double)microtime( ) * 1000000 );
// random limits within ASCII table
$randnum = mt_rand( $lower_ascii_bound, $upper_ascii_bound );
if( !in_array( $randnum, $notuse ) ) {
$password = $password . chr( $randnum );
$i++;
} // end if
} // end while
echo "Your password is $password";

MattR
Tue 29th May '01, 12:46am
Just downloaded the code; I see you have an acceptable chars list; I would suggest just removing some chars which could look confusing for users who might not be able to diferentiate between 1, I, l etc.

bira
Tue 29th May '01, 12:50am
thanks Matt (and for the suggestion too!) :)

MattR
Tue 29th May '01, 12:51am
So can we get this pushed into 2.1 perhaps? :)

bira
Tue 29th May '01, 12:55am
Matt I included it in the suggestions for next version (http://vbulletin.com/forum/showthread.php?s=&threadid=17767) thread.

I hope they accept it. I've always been a vocal opposer to the activation link method for many, may reasons.

MattR
Tue 29th May '01, 12:58am
Originally posted by bira
Matt I included it in the suggestions for next version (http://vbulletin.com/forum/showthread.php?s=&threadid=17767) thread.

I hope they accept it. I've always been a vocal opposer to the activation link method for many, may reasons.

YAY! Here's hoping they accept it! :)