Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

bans of different durations

I would like to be able to have a system to ban people for different durations, with the bans automatically expiring.
If there were a mechanism to keep notes on the reason for the bans that would be wonderful.
I'm guessing there isn't an add-on for this.
Can anyone point me in the right direction to get started with developing this it would be greatly appreciated.

Best Answer

  • peregrineperegrine MVP
    Answer ✓

    the simple soulution would be to use the notes column in the ban table and assign names to groups there

    short is 30 days, medium is 60 days, long is 90 days.

    notes

    short
    med
    long

    then write a program that reads the table, convert the dates to seconds

    pseudo code
    
    case short
       if today - (insert date + 30 * 24 * 60 *60) 
       deleteban(id)
    
    case med
       if today - (insert date + 60 * 24 * 60 *60) 
    
    case long
     if today - (insert date + 90 * 24 * 60 *60) 
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Answers

  • peregrineperegrine MVP
    edited May 2012

    there is an option for notes on the reason in the 2.0.18.4 version.

    To develop an expiration - there is a date inserted in the ban table.

    what ever code you write could test whether the date inserted is 60 days old or what ever than it could remove the ban. You could also add a column to the ban table that would be a date offset based on the insert date, when that point is reached the ban would expire. I suppose you could write a little program the executes daily in cron to make the deletion in the ban table when the target is met. That's the extent of what I can suggest. There might be other ways, but this one possible solution.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    Answer ✓

    the simple soulution would be to use the notes column in the ban table and assign names to groups there

    short is 30 days, medium is 60 days, long is 90 days.

    notes

    short
    med
    long

    then write a program that reads the table, convert the dates to seconds

    pseudo code
    
    case short
       if today - (insert date + 30 * 24 * 60 *60) 
       deleteban(id)
    
    case med
       if today - (insert date + 60 * 24 * 60 *60) 
    
    case long
     if today - (insert date + 90 * 24 * 60 *60) 
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Okay I was not being totally clear.
    My mistake.
    What I wanted to do was keep a ban history so Moderators can look over previous bans.
    I think I will need a new table to manage this.
    Think I will get to grips with this framework before I start doing anything like that.

Sign In or Register to comment.