Code Monkey home page Code Monkey logo

ulx-global-ban-fix's Introduction

Buy Me a Coffee at ko-fi.com

Also check out DarkRP Landing Page

image

ULX-Global-Ban

A Global Ban System designed to be used only with ULX & ULib Garry's Mod servers.
This Version has been fixed up by 1Day2Die#1337 (feel free to contact me on discord https://discord.gg/UgJcvgCg6N or via DM)

INFO

  • Created out of necessity.
  • Created by NigNog (Bcool) and Adobe Ninja.
  • This Version has been fixed up by 1Day2Die

FEATURES

Server Identification: When your server starts, it checks to see whether or not the IP:Port configuration is already there. If it's not it'll create it and assign the server an ID. If it is it'll assign the server an existing ID.

Bans: This addon overwrites the exists ULib function to add a ban, and inserts it into the MySQL Database.

Authentication: When the server Auths a player, the point where the SteamID is retrived and the normal ban status is checked, this addon checks the MySQL server to see if the user has been banned.

Information: When a user has been banned, their SteamID, Current Name, Reason, ServerID of the server which they where banned on, Admin(Banner) SteamID and Current admin name are all saved in the MySQL Database. Each time your server is started, the hostname is automagicly updated in the MySQL database.

Web: 3 Themes to decide from

PLANED/TODO

  • Nothing

CHANGELOG ==============,

  • [ADD] Web - New Modern theme
  • [ADD] Web - Steam API
  • [ADD] Web - Layout Changes
  • [ADD] Web - Webinstaller
  • [FIX] Made Operable again.
  • [ADD] Ban removal.
  • [ADD] Ban Modification.
  • [ADD] Ban listing in the xgui menus.
  • [ADD] Ban sync, your bans defaulty sync with the MySQL DB every 30 seconds.
  • [ADD] Config file with a small amount of configs for extra control.
  • [ADD] Limited GateKeeper functionality.
  • [FIX] Permanently Banned users could still get through.
  • [CHG] SQL Table Structure to incorporate all ULX ban details.

INSTALLATION

*Requires MySQLOO v9 *Requires ULX and ULib *Requires PHP Extention gmp (apt install phpx.x-gmp)

Create a new Database.

Upload the Webfiles to your webserver and open the website. You should now see the Installer. Run through the Installer and everything will be setup for you

Upload the ulx_globalbanmodule to your garrysmod/addons directory and edit "gb_config" to your liking.

Everything should be running smooth!

THEMES

image

image

image

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

ulx-global-ban-fix's People

Contributors

1day2die avatar azarus avatar bcool avatar cschulz avatar hounddogie avatar jeffx539 avatar maximecaruchet avatar

Stargazers

 avatar  avatar

ulx-global-ban-fix's Issues

light theme - Warning: Undefined variable $tmp in /bans/index.php on line 210

This error occurs if someone is banned for a duration of time. If no bans are in the database the error does not exist.

Full error:

`Warning: Undefined variable $tmp in /usr/www/darkstorm/darkstorm/bans/index.php on line 210

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /usr/www/darkstorm/darkstorm/bans/index.php:210 Stack trace: #0 {main} thrown in /usr/www/darkstorm/darkstorm/bans/index.php on line 210`

Dark theme - SQ_... Already defined

Warning: Constant SQ_TIMEOUT already defined in /usr/www/darkstorm/darkstorm/bans/index.php on line 76
Warning: Constant SQ_ENGINE already defined in /usr/www/darkstorm/darkstorm/bans/index.php on line 77

Server ID spam with LAN IP address

Currently on start up if a server without its LAN IP does not exist in the list, it will populate the list with a new one, and do some form of magic to just start using that server ID going forward.

This causes issues for servers which use RFC1918 addresses e.g. 192.168, as the bans page will be unable to query the server, and when the IP is corrected then on next reboot it will add yet another server ID, and so on...

Implement a check for if DB is already connected

10:47:07
02/24/2023 - 15:47:07: Lua Error: [ulx_globalbanmodule] addons/ulx_globalbanmodule/lua/globalban/gb_mysqloo.lua:62: Database already connected. 1. connect - [C]:-1 2. connectToDatabase - addons/ulx_globalbanmodule/lua/globalban/gb_mysqloo.lua:62 3. unknown - addons/ulx_globalbanmodule/lua/globalban/gb_mysqloo.lua:71

.env protection does not exist - SQL password breach guaranteed

Since no .htaccess or other methods are configured users can manually navigate to the generated .env file and view the plaintext SQL username and password. this is a massive security vulnerability that anyone that isn't a well versed admin could overlook and be pwned hard

confirmed on the dark and modern themes, light theme has the password hardcoded into php code, so it isn't affected.

Temp bans won't lift

image
I banned myself via "!ban ^ 1h skeleton nuts" and i am just getting back on to find the ban didn't life and the time is now just empty on the ban screen.

Implement error checking for if server is offline

When rebooting our dev server, the following errors are thrown:

image

This was caused by me manually adding the servers to the server list of the database, if there is a better way definitely let me know!

Error thrown when using ulx xban command

ulx xban is a built in tool to ULX which is less known, but extremely valuable for capturing all ban information on the fly.

11:34:03
02/24/2023 - 16:34:03: Lua Error: [ulx] addons/ulx/lua/ulx/xgui/server/sv_bans.lua:240: attempt to index a nil value 1. unknown - addons/ulx/lua/ulx/xgui/server/sv_bans.lua:240 2. unknown - addons/ulx/lua/ulx/modules/xgui_server.lua:73 3. unknown - lua/includes/modules/concommand.lua:54

dark theme - Undefined variable $tmp in /bans/lib/functions.php on line 12

Error found within the dark theme:

Warning: Undefined variable $tmp in /usr/www/darkstorm/darkstorm/bans/lib/functions.php on line 12

  |

  | Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /usr/www/darkstorm/darkstorm/bans/lib/functions.php:12
  | Stack trace:
  | #0 /usr/www/darkstorm/darkstorm/bans/index.php(161): calcSteamID()
  | #1 {main}
  | thrown in /usr/www/darkstorm/darkstorm/bans/lib/functions.php on line 12

This error also makes the webpage fail to populate bans appropriately:

UI:
image

SQL entry:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.