ScottLott
Member
Hey Guys,
I've got an addon that injects user group IDs into the XenForo database.
Unfortunately, when secondary user group IDs are injected the user's permissions are ruined preventing them from having access to any part of the forum.
I've narrowed the problem down to the "permission_combination_id" on the XenForo user table. When this value isn't set correctly, the user looses their permissions. (They have access to nothing, they can't even view the forums home page)
The (current) solution is to rebuild the user cache. This takes the existing user group IDs from the primary user group and secondary user groups and recalculates the permission combination ID.
But I can't just rebuild the user cache every 10 minutes, this is something that needs to happen on the fly as each user has their group IDs updated.
Knowing this, I narrowed the code down to the XenForo_DataWriter class. Turns out there is a function in there called "rebuildPermissionCombinationId" that is ran to do the magic.
How would I call the "XenForo_DataWriter" class from a PHP script outside of XenForo? I'm also having trouble figuring out what variables need to be fed into XenForo_DataWriter for it to know which user to rebuild.
Thanks!
I've got an addon that injects user group IDs into the XenForo database.
Unfortunately, when secondary user group IDs are injected the user's permissions are ruined preventing them from having access to any part of the forum.
I've narrowed the problem down to the "permission_combination_id" on the XenForo user table. When this value isn't set correctly, the user looses their permissions. (They have access to nothing, they can't even view the forums home page)
The (current) solution is to rebuild the user cache. This takes the existing user group IDs from the primary user group and secondary user groups and recalculates the permission combination ID.
But I can't just rebuild the user cache every 10 minutes, this is something that needs to happen on the fly as each user has their group IDs updated.
Knowing this, I narrowed the code down to the XenForo_DataWriter class. Turns out there is a function in there called "rebuildPermissionCombinationId" that is ran to do the magic.
How would I call the "XenForo_DataWriter" class from a PHP script outside of XenForo? I'm also having trouble figuring out what variables need to be fed into XenForo_DataWriter for it to know which user to rebuild.
Thanks!