probeResult.addElement("name");
// Create the registration form to include in the probeResult. The form will include
// the basic information plus name and visibility of name and email.
// TODO Future versions could allow plugin modules to add new fields to the form
final DataForm registrationForm = new DataForm(DataForm.Type.form);
registrationForm.setTitle("XMPP Client Registration");
registrationForm.addInstruction("Please provide the following information");
final FormField fieldForm = registrationForm.addField();
fieldForm.setVariable("FORM_TYPE");
fieldForm.setType(FormField.Type.hidden);
fieldForm.addValue("jabber:iq:register");
final FormField fieldUser = registrationForm.addField();
fieldUser.setVariable("username");
fieldUser.setType(FormField.Type.text_single);
fieldUser.setLabel("Username");
fieldUser.setRequired(true);
final FormField fieldName = registrationForm.addField();
fieldName.setVariable("name");
fieldName.setType(FormField.Type.text_single);
fieldName.setLabel("Full name");
if (UserManager.getUserProvider().isNameRequired()) {
fieldName.setRequired(true);
}
final FormField fieldMail = registrationForm.addField();
fieldMail.setVariable("email");
fieldMail.setType(FormField.Type.text_single);
fieldMail.setLabel("Email");
if (UserManager.getUserProvider().isEmailRequired()) {
fieldMail.setRequired(true);
}
final FormField fieldPwd = registrationForm.addField();
fieldPwd.setVariable("password");
fieldPwd.setType(FormField.Type.text_private);
fieldPwd.setLabel("Password");
fieldPwd.setRequired(true);
// Add the registration form to the probe result.
probeResult.add(registrationForm.getElement());
}
// See if in-band registration should be enabled (default is true).
registrationEnabled = JiveGlobals.getBooleanProperty("register.inband", true);
// See if users can change their passwords (default is true).
canChangePassword = JiveGlobals.getBooleanProperty("register.password", true);