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

XF 1.1 Warnings script to re-ban users?

Discussion in 'Troubleshooting and Problems' started by realwx, Feb 17, 2013.

  1. realwx

    realwx Member

    We just ran a vBulletin infraction importer I built, however I can't find anywhere that goes through and actively "refreshes" the warning cache to ban people already banned in regards to what's defined in warning actions (e.g. 6 points: in a usergroup, 100 points: banned entirely). Any way to do this?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    There is no such utility in the software. Warning actions are only applied at the time of the warning.

    You will need a custom script to run this function on all users:

    XenForo_Model_Warning::userWarningPointsChanged

    Basically foreach through every userid and call this function. In the case of newly imported users the $oldPoints would always be 0.

    This function is normally called by the user datawriter. If your importer is setting the warning_points in the user datawriter (which it should be in order to update the counter after importing warning records) then this function should already be called.
     
  3. Ralle

    Ralle Active Member

    Sorry for revive, I just wrote my own addon because I needed this too.
     

    Attached Files:

    Jake Bunce likes this.

Share This Page