fake accounts created

Open to all! Ask other shopowners for help.
Valquiria
Member
Posts: 11
Joined: Tue Apr 27, 2021 1:08 am
Phoenix Version:
Has thanked: 7 times

fake accounts created

Post 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


Join The Code Co-op to get access to your library in the Code Co-op Forum
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: fake accounts created

Post 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 :)
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: fake accounts created

Post by raiwa »

Address book table entries and customer data should be also deleted
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
Valquiria
Member
Posts: 11
Joined: Tue Apr 27, 2021 1:08 am
Phoenix Version:
Has thanked: 7 times

Re: fake accounts created

Post 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
Valquiria
Member
Posts: 11
Joined: Tue Apr 27, 2021 1:08 am
Phoenix Version:
Has thanked: 7 times

Re: fake accounts created

Post 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
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: fake accounts created

Post 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 :)
Philo2005
Member
Posts: 49
Joined: Fri Mar 26, 2021 7:20 am
Phoenix Version: v1.0.8.0
Has thanked: 28 times
Been thanked: 3 times

Re: fake accounts created

Post 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?
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: fake accounts created

Post 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.
I am not here to build for you.
I am here to build with you. Let's help each other.
Philo2005
Member
Posts: 49
Joined: Fri Mar 26, 2021 7:20 am
Phoenix Version: v1.0.8.0
Has thanked: 28 times
Been thanked: 3 times

Re: fake accounts created

Post 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
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: fake accounts created

Post 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.
I am not here to build for you.
I am here to build with you. Let's help each other.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply