Getting Rid Of Email Requirement For Registration

Started by motumbo, November 24, 2005, 02:04:18 AM

Previous topic - Next topic

motumbo

I want to get rid of the requirement to provide an email address for forum registration.  Why?  Because I do, that's why.  I see no necessity for it.  People can put in fake emails like [email protected] anyway.  So requiring it seems pointless.  (It would be nice to have an option to disable the requirement  ;D)

Yeah, I know it's useful if someone forgets their password.  But they could just register another account, right?  And that doesn't matter if they used a fake email in the first place (as I often do).

I originally commented out the following code in Register.php (line 118 aprox):

if (empty($_POST['email']) ||
preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]+@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', stripslashes($_POST['email'])) == 0)
fatal_error(sprintf($txt[500], $_POST['user']), false);


That worked for the first blank email registration.  But then there is a query that checks to see if the email address is already used by a registered member.  That's where it fails.  (Besides, I'm not comfortable getting rid of the input checking (preg_match) because I have no idea what it does.)  I'm not sure what else could rely on the duplicate email checking query, so I figured I'd try another strategy.

I thought that I could test to see if $_POST['email'] was empty (blank or null), and if it was empty then randomly generate some letters and append to it '@mydomain.com' to create a fake email.  The problem is that I'm a PHP newbie and have no idea how to randomly generate letters to create a fake email!   :D

I tried something like the following, which did not work:

if (empty($_POST['email])) {
$newFakeEmail = substr(preg_replace('/\W/', '', md5(rand())), 0, 10);
$_POST['email'] == $newFakeEmail;
}


As I said, that didn't work.  I think $_POST['email'] is a super constant or something and not capable of being changed.  Is that right?

Does anyone have any advice how I can get around this email requirement for registration?  Any help will be appreciated!

I really don't know what I'm doing, anyway.    :-\

Dannii

In SMF your email is more unique than your username. You can log in by your email. I'm not sure how to get rid of it, but it's probably best to leave it there.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

motumbo

Quote from: eldacar on November 24, 2005, 02:46:44 AM
In SMF your email is more unique than your username. You can log in by your email. I'm not sure how to get rid of it, but it's probably best to leave it there.

Nah, I want the email requirement gone.  Most users aren't going to be aware that you can login by email, anyway.  Plus, as I mentioned, someone can just put in a fake email anyway, thus making a strict requirement for it essentially useless.


JayBachatero

That's why you enable member activation.  members get an activation link to activate their account.  Also there is an advantage to this.  If someone deletes their account and posts remain you can restore their account by using they e-mail address.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

motumbo

Quote from: JayBachatero on November 24, 2005, 11:50:06 PM
That's why you enable member activation.  members get an activation link to activate their account.  Also there is an advantage to this.  If someone deletes their account and posts remain you can restore their account by using they e-mail address.

I think for now I'll leave it since I'm going to set it up so unregistered guests can post.  No big deal.

However, if I were to make a feature request, I would suggest that an email requirement be optional with configuration in the administration panel.

Sure, there are advantages to having users submit email addresses.  However, it's the webmasters site and he should have the flexibility to decide what's best for his own site in that regard.  I personally use fake email addresses when I sign up to forums if possible.  I don't like email boxes full of spam and viruses!    ::)



Sheepy

Sounds to me that this can be combined with the feature/mod request of mandatory registration field.  Both dynamically decides what is needed at registration.

If yuou don't like spam and virus, you can always hide your email in forum.  Sadly, I'd like to inform you that a spam test showed that even if you register an email account but never give it out no matter what, you will still get spammed eventually.  It's that terriable - some spammers just try every combination of possible addresses.

Advertisement: