mod_register: Allow 'title' and 'instructions' fields to be customized
authorKim Alvefur <zash@zash.se>
Thu, 05 Jan 2017 17:39:15 +0100
changeset 7815 2bc339352dcd
parent 7812 34ca48325ce7
child 7816 56b0ae8cbb02
mod_register: Allow 'title' and 'instructions' fields to be customized
plugins/mod_register.lua
--- a/plugins/mod_register.lua	Wed Jan 04 11:24:48 2017 +0100
+++ b/plugins/mod_register.lua	Thu Jan 05 17:39:15 2017 +0100
@@ -41,16 +41,21 @@
 	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();