Modifying the account upgrades Downgrade functionality


Active member
I'll try to keep this short and clear, but bare with me as it might get a bit messy.

Basically what I'm trying to do is alter the functionality of the account upgrades Downgrade 'process', manual and the cron, so that it also removes other secondary groups that weren't originally associated with the upgrade, or only removes the groups if the user has them (not sure how complex we can get with this).

For example, Fred purchases the Server Admin account upgrade and this puts him in groups "Server Admin", "Active" and "Level 1". Over time, Fred earns new privileges by doing well, so our staff manually appends "Level 2" group to his forum account. This now gives him level 2 server admin powers (which is controlled by a custom plugin on our game servers, which queries the XF database for the users Steam ID and what groups he/she is in, in order to determine what flags/privileges to grant).

The issue with this though, is if the upgrade expires they will still have the "Level 2" group, and thus still have the level 2 powers in-game if they ever re-purchased or purchased a different plan.

So what I need to do is modify the downgrade function to also remove them from the "Level 2" group, in addition to whatever groups the upgrade originally granted.

I'm hoping that users will be able to perform downgrades themselves, and then sign up on new plans without any risk of extra unpaid powers being associated with their account from left-over groups that the upgrade didn't grant, as my quick mock-up / example shows below:

Make sense? I hope I explained it well enough, sorry if it wasn't very concise. It's difficult to explain something when you've got a custom element involved, in my case I'm using XF account upgrades to control Server Admin and Donator subscriptions to my game servers.

If anyone could provide any insight or help on how I might ago about this it would be greatly appreciated. Looking at XF's existing php code when I'm not a programmer only goes so far... :oops: