ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Allowing multiple member accounts to use the same email address

January 19, 2011 4:45pm

Subscribe [6]
  • #1 / Jan 19, 2011 4:45pm

    Mindstorm Media

    2 posts

    I noticed that version 2.1.2 removed the “allow duplicate email address in member accounts” feature.

    Is there an extension or hack that can restore this feature?

  • #2 / Jan 29, 2011 12:21am

    rgbink

    63 posts

    Nothing on this after 9 days?

    Have a sort of inverse issue: need to be able to assign more than 1 email address to each user account.
    Is there a way to currently do this?

    EDIT: Just noticed this is in general discussion. In that case OP seems to want to wait. 😉

  • #3 / Feb 07, 2011 9:59am

    timoteus

    25 posts

    Hi,
    I would also need this feature back!
    It’s not present in v 2.1.4 beta. is there a hidden config-var to get it back?

  • #4 / Feb 07, 2011 1:34pm

    I found two functions in the core files that can be commented out to skip checking for duplicate email addresses.

    In the file: /system/expressionengine/libraries/Validate.php
    Comment out the following code (lines 423-428):

    /** -------------------------------------
    /**  Duplicate emails?
    /** -------------------------------------*/
    
    $query = $this->EE->db->query("SELECT COUNT(*) as count FROM exp_members WHERE email = '".$this->EE->db->escape_str($this->email)."'");
    
    if ($query->row('count')  > 0)
    {
        $this->errors[] = $this->EE->lang->line('email_taken');
    }

    In file /system/expressionengine/libraries/EE_Form_validation.php
    Comment out the following code (lines 394-401):

    // Duplicate emails?
    
    $this->CI->db->where('email', $str);
    $count = $this->CI->db->count_all_results('members');
    
    if ($count > 0)
    {                            
        $this->set_message('valid_user_email', $this->CI->lang->line('email_taken'));      
        return FALSE;
    }

    There are security risks for sure. Use at your own risk, and happy hacking.

  • #5 / Jan 19, 2012 10:46am

    Eastwood Design

    605 posts

    I tried the above hack and it does not work.

    I can click the button to register.  Although I do not get any errors, I am just redirected to the home page and the member is NOT registered.

    ee: v2.3.1 and Solspace User

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases