We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32098
    • 31 Posts
    I have got the Register snippet up and working. People are getting registered to the intended usergroup nicely, but I notice that the snippet is allowing the same email to be used multiple times.

    When I look at the Register snippet I see this:

    /* ensure if allow_multiple_emails setting is false, prevent duplicate emails */
       if (!$modx->getOption('allow_multiple_emails',null,false)) {
            $emailTaken = $modx->getObject('modUserProfile',array('email' => $fields[$emailField]));
            if ($emailTaken) {
                $login->validator->errors[$emailField] = $modx->lexicon('register.email_taken',array('email' => $fields[$emailField]));
            }
        }


    But in the Register (Login) documentation I can’t see anything that specifies how to make sure multiple emails are not allowed.

    Any ideas?

    Thanks.
      • 32098
      • 31 Posts
      Sorting something completely unrelated in the system settings in the manager area and noticed that there is the option there to disallow multiple emails for users.

      Silly me.