[release](Shiny banner goes here)SourceBans In Lua version 1.531 (Last Update: 25th December 2012)
I've been working for a while on getting an implementation of SourceBans going in GLua, so that the benefit of a nice global banning system can be had without the large downside of having to install MetaMod:Source and SourceMod.
The result is Sourcebans.lua!
This is two things in one:
Firstly, it is a complete replacement that a server owner can put in instead of the SourceMod version, and it will continue as normal.
Secondly, it is a tool developers can use to create in-game admin mods that completely integrate with SourceBans, allowing you to view bans in-game and use useful menus instead of the concommands.
For instance, Overv has done this with Evolve, which is now SourceBans compatible.For Server Owners
* Uninstall or disable Metamod by moving metamod.vdf from garrysmod/addons/ to garrysmod/addons/metamod/.
* Install MySQLOO. Get it [Here].
Place libmySQL.dll orangebox/ and gmsv_mysqloo.dll in orangebox/garrysmod/lua/includes/modules/
* Install SourceBans.lua. Get it [Here].
Download the file and place it in garrysmod/lua/includes/modules/ next to gmsv_mysqlloo.dll.
* Install the setup file. Get it [Here].
Download the file and place it in garrysmod/lua/autorun/server/ and then fill out all the details with your own.
* Start your server.
Everything should work as normal.For Developers
I have used the handy LuaDoc system to provide full documentation for the module.
You can find it [Here].
Please report back if you use this or have any trouble.Thanks
The people who made SourceBans in the first place.
The people on my server for being unwilling test pilots
Overv for lots of testing and being the first adopter.Changelog

Code:

1.531 Tiny change to make the source GM13 compatible (no more | operator!)
1.53 sm_rehash now goes through all online players and makes sure their group is up to date.
1.521 Fixed a hang if an admin had no srv_flags and no srv_group
1.52 Added various sm_#say commands at a request, and added a SBANS_NO_COMMANDS global variable to disable all admin commands (for pure lua usage)
1.51 Made it work again
1.5 Made it support gatekeeper
1.41 Fixed yet another 'stop loading admins' glitch
1.4 Added GetAdmins(), made it work a bit more.
1.317 Added even more error prevention when an admin doesn't have a server group but is assigned to the server
1.316 Added error prevention when an admin doesn't have a server group but is assigned to the server
1.315 Made sure callback was always actually a function even when not passed one, fixed a typo.
1.31 Added some error checks, removed some sloppy assumptions and fixed queued ban checks not working.
1.3 Pimped up the concommands and made them report more details
1.22 Added dogroups to the config to disable automatic usergroup setting
1.21 Made it so that the player is only kicked if their user object is available
1.2 Made CheckForBan() and BanPlayerBySteamIDAndIP() accessable
1.12 Made the concommands check that the right amount of arguments had been passed.
1.11 Fixed a typo that stopped the fix working
1.1 Fixed the module freezing the server by pinging the database 10 times a second

Is this a replacement for the VAC security?
And does this use a global database wich has write and read permission from every server wich installed this.
Like, if someone gets bannes by this system somewhere for a normal reason, he gets banned on all servers
using this, and for breaking the private rules of the server, he only gets bannes on that particular server.

Here is a siggestion. Why not create certain server rules profiles.
Like, this server is for rp, and serious RP only.

Someone playing on this server breaks one of the rules in the serious RP profile.
This someone gets bannes from all servers using this serious RP profile.
Like, the ban gets tagged with this profile relation only.

But once he breaks some of the standard rules like cheating, this persons just gets banned
from every server using this.

Is this a replacement for the VAC security?
And does this use a global database wich has write and read permission from every server wich installed this.
Like, if someone gets bannes by this system somewhere for a normal reason, he gets banned on all servers
using this, and for breaking the private rules of the server, he only gets bannes on that particular server.

Here is a siggestion. Why not create certain server rules profiles.
Like, this server is for rp, and serious RP only.

Someone playing on this server breaks one of the rules in the serious RP profile.
This someone gets bannes from all servers using this serious RP profile.
Like, the ban gets tagged with this profile relation only.

But once he breaks some of the standard rules like cheating, this persons just gets banned
from every server using this.

No, this is a Lua version of [This] system, which allows you to have a ban enacted on every Source based server you own. It does work in Garry's Mod, but it's a bit laggy so I made a native version.

Ok, looked into it, uploaded a new version that should work better.
The main reason you weren't receiving feedback is that I'd forgot to import HUD_PRINTCONSOLE.
Anyway, I've added new words and that.
From server console:

Code:

sm_ban lexi 5 testing
sm_ban: Your ban request has been sent to the database.
Dropped Lexi from server (Kicked by Console : You are BANNED from this server!)
sm_ban: Lexi has been banned successfully.

From my console:

Code:

] sm_addban 120 STEAM_0:1:17496864 Using 'omg! :D' in a serious roleplay event
sm_addban: Your ban request has been sent to the database.
sm_addban: STEAM_0:1:17496864 has been banned successfully.

Please download the latest version of the module from the post or [Here] and tell me how it works out for you.
Thanks.

] sm_addban 14440 STEAMID Rdming
You do not have access to this command!
clafair (STEAMID) connected from Canada
NutterButter: Im going to top floor
NutterButter: Im in the building
] sm_rcon sm_addban 14440 STEAMID Rdming

I'm admin on the users file, ulx admin, sourcemod admin. Even admin on the bans website. It didn't update on the website either.

Code:

] sm_ban gash 1 test
You do not have access to this command!

I also banned myself using the web interface, and it didn't even ban me this time. Just kicked me.

Okay, it is a problem with the Z flag. I removed the Z flag, and it worked perfectly... BESIDES the fact that a one minute ban did not unban me after one minute, and sb_reload didn't unban me either once the ban expired.

I had to manually sm_unban myself.

EDIT

I tried it again, does it ban you for 5 minutes by default if it's lower then 5? Because that's what it did.. lol, I banned myself for 1 minute, took 5 minutes. Banned for 5 minutes, took that long.

Yep. I didn't think people'd ban for less.
I'll look into lowering or not actually doing the ban if it's for shorter.

Good. :3:

I don't think that's my fault, more info?

What would be the reason of the web interface not loading?
I think it would most likely be the game server having trouble connecting to the web server.
The Webpage is connecting fine, If we ban someone from the webpage, they are banned from the server also, but why wouldn't it update?

Try putting lua_log_sv 1 in your server.cfg and checking for Lua errors in garrysmod/lua_errors_server.txt after banning someone.
Are they banned for the full amount of time, even though the ban doesn't show up?

Every single command in SourceBans.lua has been removed from Sourcemod before adding SourceBans.lua. The player is completely banned for the full amount of time if they are banned using the web interface or in-game, but if you ban in-game it does not list the ban on the website. That's the only problem, which I'm not sure how can be fixed. Could it just be a problem with my host (xenon servers), in some way?

Humor me and try temporarily disabling SourceMod with the quick and reversible fix I put in the main post, then try banning someone. As my server's incredibly active ban page shows, it works fine from the Lua, and my last local test with the concommands worked fine, so it's got to be something on your end.

I've uploaded a version that should prevent all three of those errors.
However, the middle one is because you have access to the server, but haven't been assigned a server group. You might want to fix that?

Go to the admin list.
Then look at your name.
Then look at the column next to it, the 'Server Admin Group' one.
If it says 'No Group/Individual Permissions', then that's the problem.
If it doesn't I might need access to your installation to see why you're assigned a group without a name.

If you want to be able to manage who gets put into what group via the web interface when Overv gets around to making it work properly, (or if you use the plain version and only have Admin and SuperAdmin) then yes.
Otherwise, don't bother. You don't even actually need to bother doing the groups in that case, as I tostringed it. I'll just announce in the server log that you're a 'nil'. I'll get around to neat-ifying that later.