diff options
author | erstazi <erstazi@c-wd.net> | 2024-03-29 16:39:17 -0400 |
---|---|---|
committer | gpcf <gpcf@gpcf.eu> | 2024-07-27 22:24:17 +0200 |
commit | faf07870d3d0026706448272c5e1b28ae089004e (patch) | |
tree | db5c0876de4e196d9c7dff63e400b538be93a110 | |
parent | 7fd89ae14c187393ed1b19d34c18c81a56b699ed (diff) | |
download | xban2-faf07870d3d0026706448272c5e1b28ae089004e.tar.gz xban2-faf07870d3d0026706448272c5e1b28ae089004e.tar.bz2 xban2-faf07870d3d0026706448272c5e1b28ae089004e.zip |
Adding a check for passwordless accounts when attempting to log on
-rw-r--r-- | init.lua | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -228,6 +228,12 @@ function xban.get_record(player) return record, last_pos end +function xban.has_password(name) + local handler = minetest.get_auth_handler() + local auth = handler.get_auth(name) + return auth and not minetest.check_password_entry(name, auth.password, "") +end + xban.present = {} minetest.register_chatcommand("mod_afk", { @@ -282,6 +288,9 @@ minetest.register_on_prejoinplayer(function(name, ip) return ("Banned: Expires: %s, Reason: %s"):format( date, e.reason) end + if not xban.has_password(name) then + return "This account has been deactivated. Please, contact the server owner on the forums." + end if minetest.settings:get("moderate_new_accounts") and not minetest.player_exists(name) then local players = minetest.get_connected_players() for i=1,#players do |