From: Perttu Ahola Date: Fri, 30 Mar 2012 18:25:54 +0000 (+0300) Subject: Fix admin password handling in minetest.builtin_auth_handler.get_auth X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=b494324ec3156082380f586434ac8ec32b44c550;p=zefram%2Fminetest%2Fminetest_engine.git Fix admin password handling in minetest.builtin_auth_handler.get_auth --- diff --git a/builtin/builtin.lua b/builtin/builtin.lua index 0cb76439..34bda824 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)