1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Users Not Downgraded After "Upgrade" Subscription Expires

Discussion in 'Troubleshooting and Problems' started by DeltaHF, Feb 15, 2014.

  1. DeltaHF

    DeltaHF Well-Known Member

    I imported my forum from vB 3.8 using the Big Board Importer a few months ago. I implemented user upgrades on XenForo by placing upgraded users into an appropriate secondary usergroup.

    It's working well, but users are not being downgraded (removed from that secondary usergroup) when their subscriptions expire. They are no longer listed in the Users / User Upgrades / Active Users listing in the Admin CP, but their accounts remain unchanged.

    How can I get this working properly, and how can I find (and downgrade) users whose subscriptions may have already expired? (Note: I'm still running XenForo 1.2.2.)
     
  2. Mike

    Mike XenForo Developer Staff Member

    You placed them into the groups manually? That would likely be why then. When they were added to the upgrade, the user group change wouldn't have been associated with it. It should work correctly for any user that was upgraded via the system though (as in, the upgrade applied the group change). There could be an issue with that importer -- I'm not sure how it imported the upgrades and if it maintained the user group change tracking that is necessary.

    Unfortunately, as such, I think the only way is to remove them manually. You can find users that are in the group and cross reference with the list of users that should be in the group. I don't think there's another way.
     
  3. Jim Boy

    Jim Boy Well-Known Member

    I've got a similar issue, I need to remove around 400 users from a secondary usergroup that is a user upgrade group. The issue arose thanks to an upgrade from VB and a manual removal will take several hours

    What I am thinking of doing is an insert of the users into the xf_user_ugrade_active table with an end_date that is in the past and then let the relevant cron job handle the graceful removal of the usergroup from the user.

    My question would be 'is this safe'?
     
  4. Mike

    Mike XenForo Developer Staff Member

    The short answer is no, that's not sufficient. At the least, there is a record that also needs to be inserted into xf_user_group_change to list the group(s) that were temporarily added and associate it with the upgrade.
     
  5. Jim Boy

    Jim Boy Well-Known Member

    OK, so if I also insert a corresponding xf_user_group_change record with a changekey of 'userUpgrade-N" (N being the user-ugrade-id) for each user record, is that is all I need?

    I'm quite comfortable in doing this, but is there a better alternative other than manual?
     
  6. Mike

    Mike XenForo Developer Staff Member

    I believe that is sufficient, though I could really only recommend doing it via XenForo's UI (rather than manually in the DB).
     
  7. Jim Boy

    Jim Boy Well-Known Member

    That would be good if XenForo's UI accepted multiple users for manual upgrades, I'll do a quick test run on my test system, if that works I'll proceed via the db insert method, much as I agree with you that it isn't ideal.

    ta
     
  8. DeltaHF

    DeltaHF Well-Known Member

    @Jim Boy, I'm not confident in my understanding of XenForo's data structures, so I wrote a quick little script to help me handle this problem manually. It just gets a list of users from xf_user_upgrade_expired with an end_date after the date of my vB/XF conversion, checks their usergroup IDs to see if they're still "premium", and then spits out that list for me to review (with links to their profile in the Admin CP so I can change their status as needed).

    I'm just going to run this script once a month through the end of the year.
     
  9. Jim Boy

    Jim Boy Well-Known Member

    yeah, that would work although it is time consuming. I run a sql query that is something like "select user_id from xf_user u where secondary_group_ids like '%56%' and not exists (select * from xf_user_upgrade_active a where u.user_id=a.user_id and user_upgrade_id=13)"

    where '56' is the usergroup id in question and 13 is the premium upgrade id that puts the users into the usergroup 56
     

Share This Page