Comparison

core/usermanager.lua @ 4773:ee55956597f4

usermanager: Add log error for use of COMPAT config option 'anonymous_login'. To be removed in next version.
author Matthew Wild <mwild1@gmail.com>
date Sat, 28 Apr 2012 14:35:52 +0100
parent 4459:2ccc386b9913
child 4943:50f63f07245f
comparison
equal deleted inserted replaced
4772:fc16f39e0c79 4773:ee55956597f4
39 if host_session.type ~= "local" then return; end 39 if host_session.type ~= "local" then return; end
40 40
41 host_session.events.add_handler("item-added/auth-provider", function (event) 41 host_session.events.add_handler("item-added/auth-provider", function (event)
42 local provider = event.item; 42 local provider = event.item;
43 local auth_provider = config.get(host, "core", "authentication") or default_provider; 43 local auth_provider = config.get(host, "core", "authentication") or default_provider;
44 if config.get(host, "core", "anonymous_login") then auth_provider = "anonymous"; end -- COMPAT 0.7 44 if config.get(host, "core", "anonymous_login") then
45 log("error", "Deprecated config option 'anonymous_login'. Use authentication = 'anonymous' instead.");
46 auth_provider = "anonymous";
47 end -- COMPAT 0.7
45 if provider.name == auth_provider then 48 if provider.name == auth_provider then
46 host_session.users = setmetatable(provider, provider_mt); 49 host_session.users = setmetatable(provider, provider_mt);
47 end 50 end
48 if host_session.users ~= nil and host_session.users.name ~= nil then 51 if host_session.users ~= nil and host_session.users.name ~= nil then
49 log("debug", "host '%s' now set to use user provider '%s'", host, host_session.users.name); 52 log("debug", "host '%s' now set to use user provider '%s'", host, host_session.users.name);