*

abuzarkandwal

  • ****
  • 112 posts
spam posts
« on: June 19, 2021, 12:20:14 PM »
how to allow only gmail and yahoo user to register on my website how to ban other

Marked as best answer by frosticek on June 20, 2021, 12:35:36 PM
*

oneloveb

  • ****
  • 112 posts
Re: spam posts
« Reply #1 on: June 20, 2021, 11:18:31 AM »
function cust_restrict_mail_providers() {

    $authorized_providers = array(
        'gmail.com',
        'yahoo.com',
        'hotmail.com'
    );
    $current_provider = preg_replace('/^.*@(.*)$/i', '$1', Params::getParam('s_email'));

    if (!in_array($current_provider, $authorized_providers)) {
        osc_add_flash_error_message( _m('Your current email is not allowed'));
        osc_redirect_to(osc_register_account_url());
exit;
    }
« Last Edit: June 20, 2021, 03:02:05 PM by oneloveb »

*

mocody

  • ****
  • 139 posts
  • Only Marketing matters
Re: spam posts
« Reply #2 on: June 20, 2021, 12:56:21 PM »
where to add this code, please.

*

oneloveb

  • ****
  • 112 posts
Re: spam posts
« Reply #3 on: June 20, 2021, 02:40:11 PM »
Bottom of function.php

*

mocody

  • ****
  • 139 posts
  • Only Marketing matters
Re: spam posts
« Reply #4 on: June 20, 2021, 07:23:20 PM »
@oneloveb
I needed that,
Thank you

*

oneloveb

  • ****
  • 112 posts
Re: spam posts
« Reply #5 on: June 21, 2021, 01:07:04 PM »
@mocody
You're Welome