From 75a15c932bf94208c4912d2482847533b996a7a2 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 25 Feb 2017 12:36:41 -0600 Subject: [PATCH] Revert builtin auth handler changes --- builtin/game/auth.lua | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/builtin/game/auth.lua b/builtin/game/auth.lua index 61f4f3af..717a9cea 100644 --- a/builtin/game/auth.lua +++ b/builtin/game/auth.lua @@ -48,7 +48,7 @@ local function read_auth_file() error("Invalid line in auth.txt: "..dump(line)) end local privileges = core.string_to_privs(privilege_string) - newtable[string.lower(name)] = {password=password, privileges=privileges, last_login=last_login} + newtable[name] = {password=password, privileges=privileges, last_login=last_login} end end io.close(file) @@ -88,7 +88,6 @@ core.builtin_auth_handler = { -- always has an empty password, otherwise use default, which is -- usually empty too) local new_password_hash = "" - name = string.lower(name) -- If not in authentication table, return nil if not core.auth_table[name] then return nil @@ -120,10 +119,9 @@ core.builtin_auth_handler = { last_login = core.auth_table[name].last_login, } end, - create_auth = function(name, password) + create_auth = function(name, password) assert(type(name) == "string") assert(type(password) == "string") - name = string.lower(name) core.log('info', "Built-in authentication handler adding player '"..name.."'") core.auth_table[name] = { password = password, @@ -135,7 +133,6 @@ core.builtin_auth_handler = { set_password = function(name, password) assert(type(name) == "string") assert(type(password) == "string") - name = string.lower(name) if not core.auth_table[name] then core.builtin_auth_handler.create_auth(name, password) else @@ -148,7 +145,6 @@ core.builtin_auth_handler = { set_privileges = function(name, privileges) assert(type(name) == "string") assert(type(privileges) == "table") - name = string.lower(name) if not core.auth_table[name] then core.builtin_auth_handler.create_auth(name, core.get_password_hash(name, @@ -163,7 +159,6 @@ core.builtin_auth_handler = { return true end, record_login = function(name) - name = string.lower(name) assert(type(name) == "string") assert(core.auth_table[name]).last_login = os.time() save_auth_file() @@ -219,4 +214,4 @@ core.register_on_prejoinplayer(function(name, ip) "or use a different nickname.", name, k) end end -end) +end) \ No newline at end of file