diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-30 21:25:54 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-30 21:25:54 +0300 |
commit | b494324ec3156082380f586434ac8ec32b44c550 (patch) | |
tree | 3fa02b760ebb39495ea4ade6e616ae22eec4a789 | |
parent | 4cee9a86ac6fcde65dc2855a716b52f4437323f0 (diff) | |
download | minetest-b494324ec3156082380f586434ac8ec32b44c550.tar.gz minetest-b494324ec3156082380f586434ac8ec32b44c550.tar.bz2 minetest-b494324ec3156082380f586434ac8ec32b44c550.zip |
Fix admin password handling in minetest.builtin_auth_handler.get_auth
-rw-r--r-- | builtin/builtin.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/builtin/builtin.lua b/builtin/builtin.lua index 0cb764394..34bda8245 100644 --- a/builtin/builtin.lua +++ b/builtin/builtin.lua @@ -1222,13 +1222,20 @@ minetest.builtin_auth_handler = { if not minetest.auth_table[name] then minetest.builtin_auth_handler.create_auth(name, minetest.get_password_hash(name, minetest.setting_get("default_password"))) end - if minetest.is_singleplayer() or name == minetest.setting_get("name") then + if minetest.is_singleplayer() then return { password = "", privileges = minetest.registered_privileges } else - return minetest.auth_table[name] + if minetest.auth_table[name] and name == minetest.setting_get("name") then + return { + password = minetest.auth_table[name].password, + privileges = minetest.registered_privileges + } + else + return minetest.auth_table[name] + end end end, create_auth = function(name, password) |