MyBB Community Forums

Full Version: Beta testers needed - Auto Ban Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I saw this idea yesterday and decided it was worth a shot. So I started developing one such plugin in which I faced some issues of parsing out days in this thread but thanks to Yaldaram and pavemen's help which helped me getting the idea about it.

So this is pretty much ready. This runs a hook globally but only adds one query and doesn't affect MySQL server load more than 1%, so its pretty much good.

Now what this would do mainly is ban the user who is awaiting activation and has not verified their email after x days. (value of days can be set from settings) For example, a user registered on 20 November and in settings, maximum days to wait till banning a user is 3 and today is 24 November, he would be automatically banned. It also has option to turn its functionality on or off from the settings itself.

I've tested this over localhost and it works fine for me. Be careful to set days accurately otherwise it might ban the freshly registered accounts.

Download:
[attachment=24858]

Would be awaiting for comments and suggestions. Smile

Regards.
Good to see you're making efforts Unadkat but the drawback of this plugin would be that if you've e.g. 100 users online then it'll run 100 queries on each page, since you're using global_end hook. If I were you I'll make this script as part of the "Task", when I need to do this banning (Not auto though) I'll simply run the task and proceed.
So basically, you made a plugin that performs the same task as MyBB's built-in user pruning system?
@euantor: yeah, kinda, wanted to test things out if they go well, I'd make another thing based upon this small task.

@Yaldaram: Am not sure, task one looks too wavy.
Actually User pruning "deletes" the users, this plugin will ban those users.

@crazy4cs: Using Task is much more convenient.
Well, I'd try to see how task would come along, because I worked very less with tasks, lets see. And yeah, I also forgot to add, like Yaldaram said, that prunes (deletes) the user, this one moves/bans them.
(2011-11-30, 01:48 PM)crazy4cs Wrote: [ -> ]@euantor: yeah, kinda, wanted to test things out if they go well, I'd make another thing based upon this small task.

@Yaldaram: Am not sure, task one looks too wavy.

(2011-11-30, 01:51 PM)Yaldaram Wrote: [ -> ]Actually User pruning "deletes" the users, this plugin will ban those users.

@crazy4cs: Using Task is much more convenient.

Fair enough. I agree with yaldaram though, run a task once a day or something to perform the check. Having this many queries added to each and every single page isn't efficient at all. You could even just adapt the user pruning task to ban people instead of delete them.
Quote:Fair enough. I agree with yaldaram though, run a task once a day or something to perform the check. Having this many queries added to each and every single page isn't efficient at all. You could even just adapt the user pruning task to ban people instead of delete them.
Alright, I'd try in 0.2 to see how task comes along. And also, I don't believe you can easily modify and replace pruning with moving users/banning them ?
(2011-11-30, 01:55 PM)crazy4cs Wrote: [ -> ]
Quote:Fair enough. I agree with yaldaram though, run a task once a day or something to perform the check. Having this many queries added to each and every single page isn't efficient at all. You could even just adapt the user pruning task to ban people instead of delete them.
Alright, I'd try in 0.2 to see how task comes along. And also, I don't believe you can easily modify and replace pruning with moving users/banning them ?

Sure you can. Just look at how the /inc/tasks/userpruning.php task works and base your own task off of it Smile
Okay, I'd try to implement task thing, I might need help though, never worked much with tasks.
Pages: 1 2