1

Is there a way to remove the validation for unique email addresses.

I got a customer with a lot of members that must be imported into EE. But a lot of members doesn`t have a email address and a lot of duplicated email addresses are present.

1

The simplest thing to do would be to create a fake email address for each member. The easiest way I can think of to do this would be via a small PHP script (might even be possible in Excel) that iterates a counter and inserts "user*n*@fakemail.com" into the relevant "slots" of your data source. Then import that into ExpressionEngine.

2
  • 3
    If you do this, use example.com rather than anything else, since example.com is a reserved domain name that no-one is allowed to own. Apr 17 '13 at 14:25
  • I can't believe I didn't know that. Top tip!
    – foamcow
    Apr 17 '13 at 16:47
0

I don't think, EE provides such a feature as email is mandatory field for member registration but it can be achieved by hack into EE's library file .

If you look within /system/expressionengine/libraries/Validate.php around line number 365 there is a function validate_email().

Within this function, you can comment the code which is checking for duplicate and empty email which are within the if conditions:

if ($this->email == '')
{
......
}

if ( ! valid_email($this->email))
{
.....
}

if ($type == 'new')
{
....
....
}

Its your preference if you would like to use hack because applying this hack duplicate and empty email will not be checked for all member registration process.

0

You could try importing members directly into your database. After fiddling around with Laisvunas' Social Sign On add-on it turns out that an e-mail being unique isn't really necessary. You'll have to keep something unique, however, at least their username. You'll also have to bear this stuff in mind in regards to how members might be logging in... this eliminates their email address as a means of logging in as it is no longer unique.

The tricky part with this is then updating other tables (see below) to match the member's new member_id (in other words you wouldn't be able to just do an import, it would have to be scripted in part at least).

A quick google for required fields/tables for importing members directly into your EE database (matches what I find in relative add-ons):

I want to import my members. What is the minimum information that I need to populate in the database?

  • group_id - the ID number for the member group this user belongs to

  • username

  • screen_name - can be identical to the username

  • password - can be MD5 or SHA1

  • unique_id - a random 32 character string, used for session cookies.

  • ip_address

  • join_date - Unix time stamp correlated to GMT time.

  • email

There are two additional tables that must contain a row for each member, correlated with the member_id of the member:

  • exp_member_data

  • exp_member_homepage

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.