XF 2.1 User group promotion (demotion), assistance needed

beerForo

Well-known member
This is what I am looking to do.

When someone registers, they are added to a secondary group.
When they make post #1 they are removed from this secondary group.
The whole time, they are in Registered as the parent.

I can't figure out the way, but am told it is possible.

Thanks!
 
The cron runs theoretically every minute, IF every minute there is a guest/user on your site to trigger the cron. So, let's say I register and leave in 20 seconds before the cron has run. And nobody else is there on the site right then. Maybe the next guest would come in 20 mins, only then the cron would get triggered. That could be the reason why sometimes the promotion happens not immediately.

And check when the postings were made. Like were they immediately before the 1 minute passed? That could be the other loohole.

I haven't tested it, but a month ago a new addon was published. See: https://xenforo.com/community/resources/usergrouppromotion.7549/

Maybe @JohnLogar's addon would solve the problem. Reading the description it puts immediately after the registration people to a secondary usergroup, which is what you need and want.
 
Not sure what you mean. As far as I know, the XF crons only run when someone visits a page. So theoretically a cron set to run every minute will not run every minute, if there is nobody loading a page.
Yep that's what I thought. You might show 50 users logged in, but if none of them load a page the cron won't run. Does this apply to unregistered visitors and crawlers too? Or just logged in members?
 
Yep that's what I thought. You might show 50 users logged in, but if none of them load a page the cron won't run. Does this apply to unregistered visitors and crawlers too? Or just logged in members?
I don't know the answer. I believe it makes no difference between registered and unregistered, not sure about bots though.
 
I'm going to try unchecking the Valid user state. This way when they are awaiting email confirmation it will work and after as well, maybe that's the loophole.

This actually worked! In the logs it shows them accepting the terms and the group change at the exact same time.

Today at 4:17 AM
Secondary user groups (group name)
Accepted terms and rules Feb 6, 2020 at 4:17 AM
Accepted privacy policy Feb 6, 2020 at 4:17 AM

And when they make post #1 it shows the removal.

Not sure I need the add-on but will keep an eye on.
 
  • Like
Reactions: sbj
Top Bottom