mirror of
https://git.phreedom.club/localhost_frssoft/fediauth.git
synced 2025-01-08 17:11:10 +00:00
integrate with yl_matterbridge
This commit is contained in:
parent
81e3bbcdc3
commit
c433898c26
1
init.lua
1
init.lua
|
@ -11,6 +11,7 @@ fediauth = {
|
||||||
-- baseXX functions
|
-- baseXX functions
|
||||||
basexx = loadfile(MP.."/basexx.lua")(),
|
basexx = loadfile(MP.."/basexx.lua")(),
|
||||||
}
|
}
|
||||||
|
fediauth.matterbridge_avalaible = minetest.get_modpath("yl_matterbridge") and true
|
||||||
|
|
||||||
dofile(MP.."/mastoapi.lua")
|
dofile(MP.."/mastoapi.lua")
|
||||||
local instance = minetest.settings:get("fediauth.instance")
|
local instance = minetest.settings:get("fediauth.instance")
|
||||||
|
|
2
mod.conf
2
mod.conf
|
@ -1,2 +1,4 @@
|
||||||
name = fediauth
|
name = fediauth
|
||||||
min_minetest_version = 5.3
|
min_minetest_version = 5.3
|
||||||
|
optional_depends = yl_matterbridge
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,11 @@ function fediauth.discard_passw(playername)
|
||||||
if stored_pwd == auth_data.password then
|
if stored_pwd == auth_data.password then
|
||||||
fediauth.storage:set_string(playername .. "_pwd", "")
|
fediauth.storage:set_string(playername .. "_pwd", "")
|
||||||
else
|
else
|
||||||
minetest.log("warning", "[fediauth] '" .. playername .. "' attempt change password! Restoring")
|
local msg_violation = "[fediauth] '" .. playername .. "' attempt change password! Restoring"
|
||||||
|
minetest.log("warning", msg_violation)
|
||||||
|
if fediauth.matterbridge_avalaible then
|
||||||
|
yl_matterbridge.send_to_bridge("", msg_violation)
|
||||||
|
end
|
||||||
|
|
||||||
minetest.kick_player(playername, "password protection violation")
|
minetest.kick_player(playername, "password protection violation")
|
||||||
minetest.set_player_password(playername, stored_pwd)
|
minetest.set_player_password(playername, stored_pwd)
|
||||||
|
|
Loading…
Reference in a new issue