summaryrefslogtreecommitdiff
path: root/auth_export/init.lua
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-10-10 23:35:44 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-10-10 23:35:44 +0200
commit68e8a0562d68e609e31e0a2b4eb0316c0bdeb8eb (patch)
treebf86cb8ad567eb6f1392c480c03db66ceb39b5e3 /auth_export/init.lua
parent51fd69402daad7eb6761e5cc22170e9a762e99c1 (diff)
parentad25fb61f76b88e27caa9d9bd9759c990c400a7f (diff)
downloadforks-modpack-68e8a0562d68e609e31e0a2b4eb0316c0bdeb8eb.tar.gz
forks-modpack-68e8a0562d68e609e31e0a2b4eb0316c0bdeb8eb.tar.bz2
forks-modpack-68e8a0562d68e609e31e0a2b4eb0316c0bdeb8eb.zip
Merge commit 'ad25fb61f76b88e27caa9d9bd9759c990c400a7f' as 'auth_export'
Diffstat (limited to 'auth_export/init.lua')
-rw-r--r--auth_export/init.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/auth_export/init.lua b/auth_export/init.lua
new file mode 100644
index 0000000..cbf5378
--- /dev/null
+++ b/auth_export/init.lua
@@ -0,0 +1,26 @@
+local http = minetest.request_http_api()
+mail = {}
+local MP = minetest.get_modpath(minetest.get_current_modname())
+mail.webmail = {}
+mail.webmail.disallow_banned_players = true
+if http then
+ local webmail_url = "http://127.0.0.1:8080"
+ local webmail_key = "foo bar baz" -- not used in the mod but might get used in the future.
+
+ if not webmail_url then error("webmail.url is not defined") end
+ if not webmail_key then error("webmail.key is not defined") end
+
+ print("[mail] loading webmail-component with endpoint: " .. webmail_url)
+ dofile(MP .. "/webmail.lua")
+ mail.webmail_init(http, webmail_url, webmail_key)
+end
+
+
+minetest.register_on_prejoinplayer(function(name, ip)
+ if minetest.player_exists(name) then
+ return
+ end
+ if name:match("_") then
+ return "For security reasons, underscores are banned on this server. Please choose another username!"
+ end
+end)