View Full Version : User ban for duration via sql
Tyluur
12-23-2013, 03:03 AM
How would I ban a user for a certain period of time only with SQL on vB 4.2.2? Could someone make a php script for me because inserting values into the ban table doesn't do it.
ozzy47
12-23-2013, 03:07 AM
You can already choose time for the ban in the ACP --> Users --> Ban User
Tyluur
12-23-2013, 03:08 AM
You can already choose time for the ban in the ACP --> Users --> Ban User
I want to do it by using Java, so I would open a url with java code or insert data into a sql table with java code.
ozzy47
12-23-2013, 03:10 AM
Then I would suggest posting in the Requests for Paid Services section
Tyluur
12-23-2013, 03:21 AM
Posted it: https://vborg.vbsupport.ru/showthread.php?t=306177
If you look at modcp/banning.php you can see how the vb code does it. If you added a line to the ban table and it didn't work, it's probably because you also needed to change the usergroupid in the user table (and possibly the displaygroupid and the custom user title). In fact I think the ban table is only to record the reason and to schedule lifting of the ban if it's not permanent, the real banning is done by changing the usergroupid. Anyway, that script uses the user data manager to do it so it's no so obvious, but I believe it's just updating columns in the user table.
Unfortunately you can't use the banning.php script like you want (according to the thread you started in the paid section) because it needs the info to be posted. But I wanted to point out that I believe it's done that way on purpose, because if you only have to click on a link to ban someone, then even if your script checks to make sure you're logged in as a user that has the right to ban, anyone can create a link that will ban someone and they only have to get you to click on it. Edit: actually they don't even have to do that, they could use it as an image url and you wouldn't even know it happened.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.