Page 1 of 2

fake accounts created

Posted: Mon Sep 02, 2024 3:27 pm
by Valquiria
Hello everyone.

I have several fake customers in the database.

Is there an easy addon to delete customers?

Another question, can you find an SQL statement to delete them?

My fake clients are all of the type:
First Name: XXXXXXX
Last Name: XXXXXXXYY

The length of XXXXXXX can vary.

Example:
First Name: Donaldper
Last Name: DonaldperMT

Thank you very much for your help.
Valqui

Re: fake accounts created

Posted: Mon Sep 02, 2024 3:42 pm
by heatherbell
Valquiria wrote: Mon Sep 02, 2024 3:27 pm Is there an easy addon to delete customers?
No, other than delete them in Admin>Customers
Valquiria wrote: Mon Sep 02, 2024 3:27 pm Another question, can you find an SQL statement to delete them?
From your example, Last Name always begins with First Name although First Name length is variable.
If that is true:

Code: Select all

DELETE FROM customers
WHERE customers_lastname LIKE CONCAT(customers_firstname, '%');
Best to run a SELECT query first to check which rows will be affected:

Code: Select all

SELECT * FROM customers
WHERE customers_lastname LIKE CONCAT(customers_firstname, '%');
If that works and my time has saved your time, then Buy Me A Beverage :)

Re: fake accounts created

Posted: Mon Sep 02, 2024 6:13 pm
by raiwa
Address book table entries and customer data should be also deleted

Re: fake accounts created

Posted: Mon Sep 02, 2024 6:52 pm
by Valquiria
TY @heatherbell

TY @raiwa
Address book table entries and customer data should be also deleted

What would be the SQL statement to delete these fields using the SQL statement that heatherbell provided and works correctly?

BR

Valqui

Re: fake accounts created

Posted: Mon Sep 02, 2024 7:05 pm
by Valquiria
This SQL statement works even better :)
SELECT * FROM customers
WHERE customers_lastname LIKE CONCAT(customers_firstname, '__');

TY @heatherbell

I would need to find the SQL statement that deletes the data that @raiwa mentions

Re: fake accounts created

Posted: Tue Sep 03, 2024 7:52 am
by heatherbell
Valquiria wrote: Mon Sep 02, 2024 7:05 pm I would need to find the SQL statement that deletes the data
Assuming customers have been deleted from customers table, then customers_id no longer exists in customers table.
Therefore, to clean address_book table:

Code: Select all

SELECT * FROM address_book
WHERE customers_id NOT IN (SELECT customers_id FROM customers);
and therefore to clean customers_info:

Code: Select all

SELECT * FROM customers_info
WHERE customers_info_id NOT IN (SELECT customers_id FROM customers);
Not tested. Always backup data before changing data.
And if my time saves your time, then Buy Me A Beverage otherwise, naturally, my coffee cup and generosity runs dry :)

Re: fake accounts created

Posted: Tue Mar 11, 2025 10:13 am
by Philo2005
I have installed Google Recaptcha V2. However, fake accounts are now being created daily.

How can I prevent fake accounts from being created?

Re: fake accounts created

Posted: Tue Mar 11, 2025 10:17 am
by burt
Try a Maths Captcha ?

IE, the user is asked "Are you Human? What is 8 + 3".
If they get the answer wrong, the account is not created.

app.php/addons/free_addon/maths_captcha
This might not work on your version of Phoenix, but it could easily be recoded.

Re: fake accounts created

Posted: Tue Mar 11, 2025 9:09 pm
by Philo2005
burt wrote: Tue Mar 11, 2025 6:59 pm
Philo2005 wrote: Tue Mar 11, 2025 6:56 pm Burt, please check:
is the addon (app.php/addons/supporters_code/s02e04_email_verify) working for 1 0 7 15?
Thank you

Re: fake accounts created

Posted: Tue Mar 11, 2025 9:56 pm
by burt
You can try it as you could simply upload it (in 90 seconds) and see if it works on your (very old!) version.

For anyone else to do it, means downloading the ancient Phoenix version, installing, setting up the addon then testing it. And then running on the same PHP version as you have, and so on. Certainly a lot more than 90 seconds work! Obviously happy to do that if the addon needs attention and the time is covered, but not just to test an addon and waste 30 minutes doing so. Sorry.