Software /
code /
prosody
Changeset
7820:8a9942086068
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 09 Jan 2017 10:17:39 +0100 |
parents | 7817:4e3654031693 (current diff) 7819:ad709ee7d3d8 (diff) |
children | 7822:4caaa0c185f1 |
files | util/dependencies.lua |
diffstat | 12 files changed, 44 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_register.lua Fri Jan 06 17:01:48 2017 +0100 +++ b/plugins/mod_register.lua Mon Jan 09 10:17:39 2017 +0100 @@ -41,30 +41,37 @@ date = { name = "date", type = "text-single", label = "Birth date" }; }; +local title = module:get_option_string("registration_title", + "Creating a new account"); +local instructions = module:get_option_string("registration_instructions", + "Choose a username and password for use with this service."); + local registration_form = dataform_new{ - title = "Creating a new account"; - instructions = "Choose a username and password for use with this service."; + title = title; + instructions = instructions; field_map.username; field_map.password; }; local registration_query = st.stanza("query", {xmlns = "jabber:iq:register"}) - :tag("instructions"):text("Choose a username and password for use with this service."):up() + :tag("instructions"):text(instructions):up() :tag("username"):up() :tag("password"):up(); for _, field in ipairs(additional_fields) do if type(field) == "table" then registration_form[#registration_form + 1] = field; - else + elseif field_map[field] or field_map[field:sub(1, -2)] then if field:match("%+$") then - field = field:sub(1, #field - 1); + field = field:sub(1, -2); field_map[field].required = true; end registration_form[#registration_form + 1] = field_map[field]; registration_query:tag(field):up(); + else + module:log("error", "Unknown field %q", field); end end registration_query:add_child(registration_form:form());
--- a/tools/erlparse.lua Fri Jan 06 17:01:48 2017 +0100 +++ b/tools/erlparse.lua Mon Jan 09 10:17:39 2017 +0100 @@ -189,9 +189,9 @@ end; end -module "erlparse" +local _M = {}; -function parseFile(file) +function _M.parseFile(file) return readFile(file); end
--- a/util-src/crand.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/crand.c Mon Jan 09 10:17:39 2017 +0100 @@ -130,6 +130,9 @@ #endif int luaopen_util_crand(lua_State *L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif lua_newtable(L); lua_pushcfunction(L, Lrandom); lua_setfield(L, -2, "bytes");
--- a/util-src/encodings.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/encodings.c Mon Jan 09 10:17:39 2017 +0100 @@ -524,6 +524,9 @@ /***************** end *****************/ LUALIB_API int luaopen_util_encodings(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif #ifdef USE_STRINGPREP_ICU init_icu(); #endif
--- a/util-src/hashes.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/hashes.c Mon Jan 09 10:17:39 2017 +0100 @@ -212,6 +212,9 @@ }; LUALIB_API int luaopen_util_hashes(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif lua_newtable(L); luaL_setfuncs(L, Reg, 0);; lua_pushliteral(L, "-3.14");
--- a/util-src/net.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/net.c Mon Jan 09 10:17:39 2017 +0100 @@ -125,6 +125,9 @@ } int luaopen_util_net(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif luaL_Reg exports[] = { { "local_addresses", lc_local_addresses }, { NULL, NULL }
--- a/util-src/pposix.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/pposix.c Mon Jan 09 10:17:39 2017 +0100 @@ -779,6 +779,9 @@ /* Register functions */ int luaopen_util_pposix(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif luaL_Reg exports[] = { { "abort", lc_abort },
--- a/util-src/ringbuffer.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/ringbuffer.c Mon Jan 09 10:17:39 2017 +0100 @@ -197,6 +197,9 @@ } int luaopen_util_ringbuffer(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif if(luaL_newmetatable(L, "ringbuffer_mt")) { lua_pushcfunction(L, rb_tostring); lua_setfield(L, -2, "__tostring");
--- a/util-src/signal.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/signal.c Mon Jan 09 10:17:39 2017 +0100 @@ -384,6 +384,9 @@ }; int luaopen_util_signal(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif int i = 0; /* add the library */
--- a/util-src/table.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/table.c Mon Jan 09 10:17:39 2017 +0100 @@ -21,6 +21,9 @@ int luaopen_util_table(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif lua_newtable(L); lua_pushcfunction(L, Lcreate_table); lua_setfield(L, -2, "create");
--- a/util-src/windows.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/windows.c Mon Jan 09 10:17:39 2017 +0100 @@ -103,6 +103,9 @@ }; LUALIB_API int luaopen_util_windows(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif lua_newtable(L); luaL_setfuncs(L, Reg, 0); lua_pushliteral(L, "-3.14");
--- a/util/dependencies.lua Fri Jan 06 17:01:48 2017 +0100 +++ b/util/dependencies.lua Mon Jan 09 10:17:39 2017 +0100 @@ -61,7 +61,7 @@ if not lxp then missingdep("luaexpat", { - ["Debian/Ubuntu"] = "sudo apt-get install liblua5.1-expat0"; + ["Debian/Ubuntu"] = "sudo apt-get install lua-expat"; ["luarocks"] = "luarocks install luaexpat"; ["Source"] = "http://matthewwild.co.uk/projects/luaexpat/"; }); @@ -72,7 +72,7 @@ if not socket then missingdep("luasocket", { - ["Debian/Ubuntu"] = "sudo apt-get install liblua5.1-socket2"; + ["Debian/Ubuntu"] = "sudo apt-get install lua-socket"; ["luarocks"] = "luarocks install luasocket"; ["Source"] = "http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/"; }); @@ -83,7 +83,7 @@ if not lfs then missingdep("luafilesystem", { ["luarocks"] = "luarocks install luafilesystem"; - ["Debian/Ubuntu"] = "sudo apt-get install liblua5.1-filesystem0"; + ["Debian/Ubuntu"] = "sudo apt-get install lua-filesystem"; ["Source"] = "http://www.keplerproject.org/luafilesystem/"; }); fatal = true;