A
A
Alexey Nazarov2015-10-29 03:49:28
Joomla
Alexey Nazarov, 2015-10-29 03:49:28

Is it possible to disable registration from certain emails?

29eb8f7feb3c4d09a2893fb96de6a248.PNG
Hello. Every day, 50-100 spam users are registered with addresses like @sharklasers.com, @makemoneypower.com, @daviescapemay.com, @o2.pl. There are ways to somehow prohibit the registration of users, e-mail. whose mail contains these domains? Site on Joomla 2.5.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey S., 2015-10-29
@atomicin

Something like this: we edit the
file /components/com_users/models/registration.php
beginning (I have line 310):

// Merge in the registration data.
    foreach ($temp as $k => $v) {
      $data[$k] = $v;
    }

here we add it:
$blocked=' @sharklasers.com @makemoneypower.com @daviescapemay.com @o2.pl';
    preg_match('/^.*(\@.*)$/', $data['email1'], $e_m);
    if (strpos($blocked,$e_m[1]) >0) $data['email1']='[email protected]';

That is, any email from these sites will change to [email protected], and upon registration, a message will be displayed that such an email is already in the database, a
continuation of the original code:
// Prepare the data for the user object.
    $data['email']		= $data['email1'];
    $data['password']	= $data['password1'];
    $useractivation = $params->get('useractivation');

93ff362c8f3f4a9ea9aa84e0f75bb690.PNG

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question