XF 1.3 User bans aren't automatically getting lifted

Hello,
We are having an issue in our test environment (where are are testing our upgrade to Xenforo 1.3.4 from 1.3) where banned users aren't automatically becoming un-banned after their ban deadline. The date in the admin control panel and in the database shows that the ban should have ended at midnight but it does not. The user is still shown as banned in the xf_user table and get the banned message when they login.

We have custom code and plugins that might be interfering with this. My main question is how is the un-banning handled and when/how is the xf_user table updated? Thanks!
 
The cron that unbans users (Delete Expired Bans) runs at 45 minutes past the hour (unless this was changed by you at any point).
For this to work, there must be at least one person browsing the forums.

When the cron runs, it calls function deleteExpiredUserBans() in class XenForo_Model_Banning
When the ban is removed (and the user is_banned flag is reset) it calls function removeUserGroupChange() in class XenForo_Model_User which removes the user from the banned user group.

So, if your ban says it will be lifted at midnight, it will actually only lift once the cron runs which is at 45 minutes past midnight (or as soon as someone views your forum).
If the ban has not lifted at 46 past the hour then you will want to see if any of your add-ons are extending or overwriting the above mentioned functions.
 
Thanks so much for the reply, that cleared a lot of things up. So I found that manually running the cron job results in a successful clearing of old bans. But it still doesn't work when run "automatically". I manually set the job to run a minute in the future and then waited for it to be past that time but the old bans were not removed. Not sure if this is something that's been seen before on test environments. What could the difference be between running it manually and letting it run automatically?
 
At least one person (in this case, you, as its a test forum) must be browsing the forum (ie viewing different threads) in order for the cron to be triggered.
 
At least one person (in this case, you, as its a test forum) must be browsing the forum (ie viewing different threads) in order for the cron to be triggered.

Hm. Not sure what's happening then. I was browsing the forums and even had another developer on the same box but it still didn't seem to run. Any place I can check logs of what cron jobs ran or errors that happened?
 
You can see the dates for the next run in the crons. If they're in the past, then there's an issue. Run the file health check and make sure everything is running as expected there, disable add-ons, and check the browser console for any errors.
 
Back
Top Bottom