Support

Admin Tools

#40948 How to block an user?

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
5.1
PHP version
8.3
Admin Tools version
latest

Latest post by nicholas on Saturday, 20 July 2024 06:33 CDT

machadoug

I'm creating a plugin to avoid spam user registration for our website. I want your opinion on whether I should block spammers/spambots via AdminTools even though they usually change IP addresses very often. If you recommend this approach, please provide instructions on how I can accomplish it. Is there a developer API?

Thank you in advance,

 

Douglas

Douglas Machado

 

nicholas
Akeeba Staff
Manager

If someone solved the issue of spam registrations with 100% accuracy (no false positives, no false negatives) they'd have also solved the spamming problem. Whoever does that is an instant billionaire. Of course, it's an unsolvable issue which is why nobody has done that.

The problem with spam registrations is that they do not come from the same IP address, and it's not the same user. The only way you know it's likely to be a spam registration is because these user accounts do not get activated. This is why we have the Delete Inactive Users scheduled task type. You can automatically delete users if they have not been activated for a period you specify (7 days is safe).

However, you cannot tell in advance if a user registration is spam. The best you can do is use Joomla's CAPTCHA on the registration page, but it can be easily defeated.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

machadoug

I agree and I don't think we'll block all spam registrations and messages. However, I've identified a pattern for most of the spam registrations and messages this particular site gets and I'd like to target those to avoid captcha.

Anyway, I gave the Scheduled tasks a try, but they don't seem to be working via /cli/joomla.php. I set the tasks to run every minute (for testing purposes)

When running the Cron 

/usr/bin/ea-php83 /path/to/joomla/cli/joomla.php scheduler:run --all --vvv

I get the following output:

Content-type: text/html; charset=UTF-8

I tried with and without the verbose and tried with the id=7 as well.

 

It works properly using Web Cron, but your documentation says it's better to use Cron. My Webcron line (it was failing without the --user-agent)

wget -qO- --user-agent="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" "https://mysite.com/component/ajax/?plugin=RunSchedulerWebcron&group=system&format=json&hash=myhash"

That being said, it doesn't seem to be a problem with any of the Admin Tools Tasks because I have tried with core tasks and it doesn't matter how many tasks I have enabled. Only one or none I get the same results. I know this is not an Admin Tools problem, but if you know how to fix it I'd appreciate it if you could share your knowledge.

This site was migrated from Joomla 3 to 5. Database tables are up to date.

Have a great weekend.

Douglas Machado

 

nicholas
Akeeba Staff
Manager

About the CLI, based on the output it appears that /usr/bin/ea-php83 is the PHP CGI/FastCGI executable. On a cPanel server I control that is also the case. The path to the CLI executable is /usr/local/bin/ea-php83.

The web-based pseudo-CRON URL seems right. Go to System, Scheduled Tasks, Options, Web Cron, and make sure Web Cron is enabled and the hash matches what is listed inside the Webcron Link (Base).

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!