Commit 9287b9b0 authored by Ryan Graham's avatar Ryan Graham Committed by ryang

* Fixed issue where the username was not being escaped properly on the web sign-up page.

* Added internationalization (i18n) support.
* Updated UI to match later versions of Wildfire.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@7495 b35dd754-fafc-0310-a699-88a17e54d16e
parent 908886aa
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<title>Search Plugin Changelog</title> <title>Search Plugin Changelog</title>
<style type="text/css"> <style type="text/css">
BODY { BODY {
font-size : 100%; font-size : 100%;
...@@ -44,6 +44,13 @@ ...@@ -44,6 +44,13 @@
Registration Plugin Changelog Registration Plugin Changelog
</h1> </h1>
<p><b>1.3.2</b> -- March 12, 2007</p>
<ul>
<li>Fixed issue where the username was not being escaped properly on the web sign-up page.
<li>Added internationalization (i18n) support.</li>
<li>Updated UI to match later versions of Wildfire.</li>
</ul>
<p><b>1.3.1</b> -- October 06, 2006</p> <p><b>1.3.1</b> -- October 06, 2006</p>
<ul> <ul>
<li>Updated to use compression offered by Wildfire 3.1</li> <li>Updated to use compression offered by Wildfire 3.1</li>
......
login.title=Admin Console
registration.props.form.title=User Registration
registration.props.form.details=Use the form below to edit user registration settings.
registration.props.form.registration_settings=Registration Settings
registration.props.form.enable_features=Enable registration features using the checkboxes below.
registration.props.form.save_success=Settings saved successfully.
registration.props.form.invalid_group=Please enter and save a valid group name in the Default Group section at the bottom of this page before enabling automatic group adding.
registration.props.form.enable_im_notification=Enable instant message registration notification.
registration.props.form.enable_email_notification=Enable email registration notification.
registration.props.form.enable_welcome_msg=Enable welcome message.
registration.props.form.enable_add_user_to_group=Enable automatically adding of new users to a group.
registration.props.form.enable_web_registration=Enable users to register via a web page at
registration.props.form.save_settings=Save Settings
registration.props.form.registration_contacts=Registration Notification Contacts
registration.props.form.registration_contacts_details=Add or remove contacts to be alerted when a new user registers.
registration.props.form.registration_contact_removed=Contact successfully removed.
registration.props.form.registration_contact_added=Contact successfully added.
registration.props.form.registration_contact_missing=Contact missing.
registration.props.form.registration_contact_not_found=Contact not found.
registration.props.form.registration_invalid_email=Invalid email address.
registration.props.form.registration_add_im=Add IM Contact
registration.props.form.registration_add=Add
registration.props.form.registration_remove=Remove
registration.props.form.registration_im_contact=IM Contact
registration.props.form.registration_no_contact=No contact specified, use the form above to add one.
registration.props.form.registration_add_email=Add Email Contact
registration.props.form.registration_email_contact=Email Contact
registration.props.form.welcome_message=Welcome Message
registration.props.form.welcome_message_details=Enter the welcome message that will be sent to new users when they register.
registration.props.form.welcome_message_saved=Message saved successfully.
registration.props.form.welcome_message_missing=Please enter a welcome message.
registration.props.form.welcome_message_save=Save Messsage
registration.props.form.default_group=Default Group
registration.props.form.default_group_details=Enter the name of the group that all new users will be automatically added to.
registration.props.form.default_group_saved=Group saved successfully.
registration.props.form.default_group_invalid=Group not found or is invalid.
registration.props.form.default_group_save=Save Group
registration.props.form.sign_up=Sign-Up Page Header Text
registration.props.form.sign_up_details=Enter the text that will be displayed at the top of the sign-up web page.
registration.props.form.sign_up_saved=Header saved successfully.
registration.props.form.sign_up_missing=Please enter a header.
registration.props.form.sign_up_save=Save Header
registration.sign.up.title=Jive Wildfire Web Registration
registration.sign.up.unavailable=This service is currently unavailable.
registration.sign.up.instructions=Use the form below to create a new user account
registration.sign.up.error_creating_account=Error creating the user account. Please contact the administrator.
registration.sign.up.invalid_username=Invalid username.
registration.sign.up.create.user_exist=Username already exists - please choose a different one.
registration.sign.up.invalid_name=Invalid name.
registration.sign.up.invalid_email=Invalid email.
registration.sign.up.invalid_password=Invalid password.
registration.sign.up.invalid_match_password=Passwords don't match.
registration.sign.up.invalid_password_confirm=Invalid password confirmation.
registration.sign.up.success=New account successfully created.
registration.sign.up.create_account=Create Account
registration.sign.up.username=Username
registration.sign.up.name=Name
registration.sign.up.email=Email
registration.sign.up.password=Password
registration.sign.up.confirm_password=Confirm Password
registration.sign.up.required_fields=Required Fields
\ No newline at end of file
<%-- <%--
- Copyright (C) 2005 Jive Software. All rights reserved. - Copyright (C) 2005 Jive Software. All rights reserved.
- -
- This software is published under the terms of the GNU Public License (GPL), - This software is published under the terms of the GNU Public License (GPL),
- a copy of which is included in this distribution. - a copy of which is included in this distribution.
--%> --%>
<%@ page <%@ page
import="java.util.*, import="java.util.*,
org.jivesoftware.admin.*, org.jivesoftware.admin.*,
org.jivesoftware.wildfire.XMPPServer, org.jivesoftware.wildfire.XMPPServer,
org.jivesoftware.wildfire.user.*, org.jivesoftware.wildfire.user.*,
org.jivesoftware.wildfire.plugin.RegistrationPlugin, org.jivesoftware.wildfire.plugin.RegistrationPlugin,
org.jivesoftware.wildfire.group.*, org.jivesoftware.wildfire.group.*,
org.jivesoftware.util.*" org.jivesoftware.util.*"
errorPage="error.jsp"%> errorPage="error.jsp"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<% <%
boolean save = request.getParameter("save") != null; boolean save = request.getParameter("save") != null;
boolean saveWelcome = request.getParameter("savemessage") != null; boolean saveWelcome = request.getParameter("savemessage") != null;
boolean saveGroup = request.getParameter("savegroup") != null; boolean saveGroup = request.getParameter("savegroup") != null;
boolean saveHeader = request.getParameter("saveheader") != null; boolean saveHeader = request.getParameter("saveheader") != null;
boolean imEnabled = ParamUtils.getBooleanParameter(request, "imenabled", false); boolean imEnabled = ParamUtils.getBooleanParameter(request, "imenabled", false);
boolean emailEnabled = ParamUtils.getBooleanParameter(request, "emailenabled", false); boolean emailEnabled = ParamUtils.getBooleanParameter(request, "emailenabled", false);
boolean welcomeEnabled = ParamUtils.getBooleanParameter(request, "welcomeenabled", false); boolean welcomeEnabled = ParamUtils.getBooleanParameter(request, "welcomeenabled", false);
boolean groupEnabled = ParamUtils.getBooleanParameter(request, "groupenabled", false); boolean groupEnabled = ParamUtils.getBooleanParameter(request, "groupenabled", false);
boolean webEnabled = ParamUtils.getBooleanParameter(request, "webenabled", false); boolean webEnabled = ParamUtils.getBooleanParameter(request, "webenabled", false);
String contactIM = ParamUtils.getParameter(request, "contactIM"); String contactIM = ParamUtils.getParameter(request, "contactIM");
boolean addIM = ParamUtils.getBooleanParameter(request, "addIM"); boolean addIM = ParamUtils.getBooleanParameter(request, "addIM");
boolean deleteIM = ParamUtils.getBooleanParameter(request, "deleteIM"); boolean deleteIM = ParamUtils.getBooleanParameter(request, "deleteIM");
String contactEmail = ParamUtils.getParameter(request, "contactEmail"); String contactEmail = ParamUtils.getParameter(request, "contactEmail");
boolean addEmail = ParamUtils.getBooleanParameter(request, "addEmail"); boolean addEmail = ParamUtils.getBooleanParameter(request, "addEmail");
boolean deleteEmail = ParamUtils.getBooleanParameter(request, "deleteEmail"); boolean deleteEmail = ParamUtils.getBooleanParameter(request, "deleteEmail");
String welcomeMessage = ParamUtils.getParameter(request, "welcomemessage"); String welcomeMessage = ParamUtils.getParameter(request, "welcomemessage");
String group = ParamUtils.getParameter(request, "groupname"); String group = ParamUtils.getParameter(request, "groupname");
String header = ParamUtils.getParameter(request, "header"); String header = ParamUtils.getParameter(request, "header");
RegistrationPlugin plugin = (RegistrationPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("registration"); RegistrationPlugin plugin = (RegistrationPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("registration");
Map<String, String> errors = new HashMap<String, String>(); Map<String, String> errors = new HashMap<String, String>();
if (addIM) { if (addIM) {
if (contactIM == null) { if (contactIM == null) {
errors.put("missingContact", "missingContact"); errors.put("missingContact", "missingContact");
} }
else { else {
contactIM = contactIM.trim().toLowerCase(); contactIM = contactIM.trim().toLowerCase();
try { try {
XMPPServer.getInstance().getUserManager().getUser(contactIM); XMPPServer.getInstance().getUserManager().getUser(contactIM);
plugin.addIMContact(contactIM); plugin.addIMContact(contactIM);
response.sendRedirect("registration-props-form.jsp?addSuccess=true"); response.sendRedirect("registration-props-form.jsp?addSuccess=true");
return; return;
} }
catch (UserNotFoundException unfe) { catch (UserNotFoundException unfe) {
errors.put("userNotFound", "userNotFound"); errors.put("userNotFound", "userNotFound");
} }
} }
} }
if (deleteIM) { if (deleteIM) {
plugin.removeIMContact(contactIM); plugin.removeIMContact(contactIM);
response.sendRedirect("registration-props-form.jsp?deleteSuccess=true"); response.sendRedirect("registration-props-form.jsp?deleteSuccess=true");
return; return;
} }
if (addEmail) { if (addEmail) {
if (contactEmail == null) { if (contactEmail == null) {
errors.put("missingContact", "missingContact"); errors.put("missingContact", "missingContact");
} }
else { else {
if (plugin.isValidAddress(contactEmail)) { if (plugin.isValidAddress(contactEmail)) {
plugin.addEmailContact(contactEmail); plugin.addEmailContact(contactEmail);
response.sendRedirect("registration-props-form.jsp?addSuccess=true"); response.sendRedirect("registration-props-form.jsp?addSuccess=true");
return; return;
} }
else { else {
errors.put("invalidAddress", "invalidAddress"); errors.put("invalidAddress", "invalidAddress");
} }
} }
} }
if (deleteEmail) { if (deleteEmail) {
plugin.removeEmailContact(contactEmail); plugin.removeEmailContact(contactEmail);
response.sendRedirect("registration-props-form.jsp?deleteSuccess=true"); response.sendRedirect("registration-props-form.jsp?deleteSuccess=true");
return; return;
} }
if (save) { if (save) {
plugin.setIMNotificationEnabled(imEnabled); plugin.setIMNotificationEnabled(imEnabled);
plugin.setEmailNotificationEnabled(emailEnabled); plugin.setEmailNotificationEnabled(emailEnabled);
plugin.setWelcomeEnabled(welcomeEnabled); plugin.setWelcomeEnabled(welcomeEnabled);
plugin.setWebEnabled(webEnabled); plugin.setWebEnabled(webEnabled);
if (groupEnabled) { if (groupEnabled) {
group = plugin.getGroup(); group = plugin.getGroup();
if (group == null || group.trim().length() < 1) { if (group == null || group.trim().length() < 1) {
errors.put("groupNotFound", "groupNotFound"); errors.put("groupNotFound", "groupNotFound");
} }
try { try {
GroupManager.getInstance().getGroup(group); GroupManager.getInstance().getGroup(group);
} }
catch (Exception e) { catch (Exception e) {
errors.put("groupNotFound", "groupNotFound"); errors.put("groupNotFound", "groupNotFound");
} }
} }
if (errors.size() == 0) { if (errors.size() == 0) {
plugin.setGroupEnabled(groupEnabled); plugin.setGroupEnabled(groupEnabled);
response.sendRedirect("registration-props-form.jsp?settingsSaved=true"); response.sendRedirect("registration-props-form.jsp?settingsSaved=true");
return; return;
} }
} }
if (saveWelcome) { if (saveWelcome) {
if (welcomeMessage == null || welcomeMessage.trim().length() < 1) { if (welcomeMessage == null || welcomeMessage.trim().length() < 1) {
errors.put("missingWelcomeMessage", "missingWelcomeMessage"); errors.put("missingWelcomeMessage", "missingWelcomeMessage");
} }
else { else {
plugin.setWelcomeMessage(welcomeMessage); plugin.setWelcomeMessage(welcomeMessage);
response.sendRedirect("registration-props-form.jsp?welcomeSaved=true"); response.sendRedirect("registration-props-form.jsp?welcomeSaved=true");
return; return;
} }
} }
if (saveGroup && plugin.groupEnabled()) { if (saveGroup && plugin.groupEnabled()) {
if (group == null || group.trim().length() < 1) { if (group == null || group.trim().length() < 1) {
errors.put("groupNotFound", "groupNotFound"); errors.put("groupNotFound", "groupNotFound");
} }
try { try {
GroupManager.getInstance().getGroup(group); GroupManager.getInstance().getGroup(group);
} }
catch (Exception e) { catch (Exception e) {
errors.put("groupNotFound", "groupNotFound"); errors.put("groupNotFound", "groupNotFound");
} }
if (errors.size() == 0) { if (errors.size() == 0) {
plugin.setGroup(group); plugin.setGroup(group);
response.sendRedirect("registration-props-form.jsp?groupSaved=true"); response.sendRedirect("registration-props-form.jsp?groupSaved=true");
return; return;
} }
} }
if (saveGroup && !plugin.groupEnabled()) { if (saveGroup && !plugin.groupEnabled()) {
group = (group == null) ? "" : group; group = (group == null) ? "" : group;
plugin.setGroup(group); plugin.setGroup(group);
} }
if (saveHeader) { if (saveHeader) {
if (header == null || header.trim().length() < 1) { if (header == null || header.trim().length() < 1) {
errors.put("missingHeader", "missingHeader"); errors.put("missingHeader", "missingHeader");
} else { } else {
plugin.setHeader(header); plugin.setHeader(header);
response.sendRedirect("registration-props-form.jsp?headerSaved=true"); response.sendRedirect("registration-props-form.jsp?headerSaved=true");
return; return;
} }
} }
imEnabled = plugin.imNotificationEnabled(); imEnabled = plugin.imNotificationEnabled();
emailEnabled = plugin.emailNotificationEnabled(); emailEnabled = plugin.emailNotificationEnabled();
welcomeEnabled = plugin.welcomeEnabled(); welcomeEnabled = plugin.welcomeEnabled();
groupEnabled = plugin.groupEnabled(); groupEnabled = plugin.groupEnabled();
webEnabled = plugin.webEnabled(); webEnabled = plugin.webEnabled();
welcomeMessage = plugin.getWelcomeMessage(); welcomeMessage = plugin.getWelcomeMessage();
group = plugin.getGroup(); group = plugin.getGroup();
header = plugin.getHeader(); header = plugin.getHeader();
%> %>
<html> <html>
<head> <head>
<title>User Registration</title> <title><fmt:message key="registration.props.form.title" /></title>
<meta name="pageID" content="registration-props-form"/> <meta name="pageID" content="registration-props-form"/>
</head> </head>
<body> <body>
<script language="JavaScript" type="text/javascript"> <script language="JavaScript" type="text/javascript">
function addIMContact() { function addIMContact() {
document.regform.addIM.value = 'true'; document.regform.addIM.value = 'true';
document.regform.submit(); document.regform.submit();
} }
function addEmailContact() { function addEmailContact() {
document.regform.addEmail.value = 'true'; document.regform.addEmail.value = 'true';
document.regform.submit(); document.regform.submit();
} }
</script> </script>
<p>Use the form below to edit user registration settings.</p> <p><fmt:message key="registration.props.form.details" /></p>
<form action="registration-props-form.jsp?save" name="regform" method="post"> <form action="registration-props-form.jsp?save" name="regform" method="post">
<input type="hidden" name="addIM" value=""> <input type="hidden" name="addIM" value="">
<input type="hidden" name="addEmail" value=""> <input type="hidden" name="addEmail" value="">
<fieldset> <div class="jive-contentBoxHeader"><fmt:message key="registration.props.form.registration_settings" /></div>
<legend>Registration Settings</legend> <div class="jive-contentBox">
<div> <p><fmt:message key="registration.props.form.enable_features" /></p>
<p>Enable registration features using the checkboxes below.</p> <% if (ParamUtils.getBooleanParameter(request, "settingsSaved")) { %>
<% if (ParamUtils.getBooleanParameter(request, "settingsSaved")) { %> <div class="jive-success">
<table cellpadding="0" cellspacing="0" border="0">
<div class="jive-success"> <tbody>
<table cellpadding="0" cellspacing="0" border="0"> <tr>
<tbody> <td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<tr> <td class="jive-icon-label"><fmt:message key="registration.props.form.save_success" /></td>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td> </tr>
<td class="jive-icon-label">Settings saved successfully.</td> </tbody>
</tr> </table>
</tbody> </div>
</table>
</div> <% } %>
<% } %> <% if (errors.containsKey("groupNotFound")) { %>
<% if (errors.containsKey("groupNotFound")) { %> <div class="jive-error">
<table cellpadding="0" cellspacing="0" border="0">
<div class="jive-error"> <tbody>
<table cellpadding="0" cellspacing="0" border="0"> <tr>
<tbody> <td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0"></td>
<tr> <td class="jive-icon-label"><fmt:message key="registration.props.form.invalid_group" /></td>
<td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0"></td> </tr>
<td class="jive-icon-label">Please enter and save a valid group name in the Default Group section at the bottom of this page before enabling automatic group adding.</td> </tbody>
</tr> </table>
</tbody> </div>
</table>
</div> <% } %>
<% } %> <table cellpadding="3" cellspacing="0" border="0" width="100%">
<tbody>
<table cellpadding="3" cellspacing="0" border="0" width="100%"> <tr>
<tbody> <td width="1%" align="center" nowrap><input type="checkbox" name="imenabled" <%=(imEnabled) ? "checked" : "" %>></td>
<tr> <td width="99%" align="left"><fmt:message key="registration.props.form.enable_im_notification" /></td>
<td width="1%" align="center" nowrap><input type="checkbox" name="imenabled" <%=(imEnabled) ? "checked" : "" %>></td> </tr>
<td width="99%" align="left">Enable instant message registration notification.</td> <tr>
</tr> <td width="1%" align="center" nowrap><input type="checkbox" name="emailenabled" <%=(emailEnabled) ? "checked" : "" %>></td>
<tr> <td width="99%" align="left"><fmt:message key="registration.props.form.enable_email_notification" /></td>
<td width="1%" align="center" nowrap><input type="checkbox" name="emailenabled" <%=(emailEnabled) ? "checked" : "" %>></td> </tr>
<td width="99%" align="left">Enable email registration notification.</td> <tr>
</tr> <td width="1%" align="center" nowrap><input type="checkbox" name="welcomeenabled" <%=(welcomeEnabled) ? "checked" : "" %>></td>
<tr> <td width="99%" align="left"><fmt:message key="registration.props.form.enable_welcome_msg" /></td>
<td width="1%" align="center" nowrap><input type="checkbox" name="welcomeenabled" <%=(welcomeEnabled) ? "checked" : "" %>></td> </tr>
<td width="99%" align="left">Enable welcome message.</td> <tr>
</tr> <td width="1%" align="center" nowrap><input type="checkbox" name="groupenabled" <%=(groupEnabled) ? "checked" : "" %>></td>
<tr> <td width="99%" align="left"><fmt:message key="registration.props.form.enable_add_user_to_group" /></td>
<td width="1%" align="center" nowrap><input type="checkbox" name="groupenabled" <%=(groupEnabled) ? "checked" : "" %>></td> </tr>
<td width="99%" align="left">Enable automatically adding of new users to a group.</td> <tr>
</tr> <td width="1%" align="center" nowrap><input type="checkbox" name="webenabled" <%=(webEnabled) ? "checked" : "" %>></td>
<tr> <td width="99%" align="left"><fmt:message key="registration.props.form.enable_web_registration" /> <%=plugin.webRegistrationAddress() %></td>
<td width="1%" align="center" nowrap><input type="checkbox" name="webenabled" <%=(webEnabled) ? "checked" : "" %>></td> </tr>
<td width="99%" align="left">Enable users to register via a web page at <%=plugin.webRegistrationAddress() %>.</td> </tbody>
</tr> </table>
</tbody> <br>
</table> <input type="submit" value="<fmt:message key="registration.props.form.save_settings" />"/>
</div> </div>
<input type="submit" value="Save Settings"/> <br>
</fieldset>
<div class="jive-contentBoxHeader"><fmt:message key="registration.props.form.registration_contacts" /></div>
<br><br> <div class="jive-contentBox">
<p><fmt:message key="registration.props.form.registration_contacts_details" /></p>
<fieldset>
<legend>Registration Notification Contacts</legend> <% if (ParamUtils.getBooleanParameter(request, "deleteSuccess")) { %>
<div>
<div class="jive-success">
<p>Add or remove contacts to be alerted when a new user registers.</p> <table cellpadding="0" cellspacing="0" border="0">
<tbody>
<% if (ParamUtils.getBooleanParameter(request, "deleteSuccess")) { %> <tr>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<div class="jive-success"> <td class="jive-icon-label"><fmt:message key="registration.props.form.registration_contact_removed" /></td>
<table cellpadding="0" cellspacing="0" border="0"> </tr>
<tbody> </tbody>
<tr> </table>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td> </div>
<td class="jive-icon-label">Contact successfully removed.</td>
</tr> <% } else if (ParamUtils.getBooleanParameter(request, "addSuccess")) { %>
</tbody>
</table> <div class="jive-success">
</div> <table cellpadding="0" cellspacing="0" border="0">
<tbody>
<% } else if (ParamUtils.getBooleanParameter(request, "addSuccess")) { %> <tr>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<div class="jive-success"> <td class="jive-icon-label"><fmt:message key="registration.props.form.registration_contact_removed" /></td>
<table cellpadding="0" cellspacing="0" border="0"> </tr>
<tbody> </tbody>
<tr> </table>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td> </div>
<td class="jive-icon-label">Contact successfully added.</td>
</tr> <% } else if (errors.containsKey("missingContact")) { %>
</tbody>
</table> <div class="jive-error">
</div> <table cellpadding="0" cellspacing="0" border="0">
<tbody>
<% } else if (errors.containsKey("missingContact")) { %> <tr>
<td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0"></td>
<div class="jive-error"> <td class="jive-icon-label"><fmt:message key="registration.props.form.registration_contact_missing" /></td>
<table cellpadding="0" cellspacing="0" border="0"> </tr>
<tbody> </tbody>
<tr> </table>
<td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0"></td> </div>
<td class="jive-icon-label">Missing contact.</td>
</tr> <% } else if (errors.containsKey("userNotFound")) { %>
</tbody>
</table> <div class="jive-error">
</div> <table cellpadding="0" cellspacing="0" border="0">
<tbody>
<% } else if (errors.containsKey("userNotFound")) { %> <tr>
<td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0"></td>
<div class="jive-error"> <td class="jive-icon-label"><fmt:message key="registration.props.form.registration_contact_not_found" /></td>
<table cellpadding="0" cellspacing="0" border="0"> </tr>
<tbody> </tbody>
<tr> </table>
<td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0"></td> </div>
<td class="jive-icon-label">Contact not found.</td>
</tr> <% } else if (errors.containsKey("invalidAddress")) { %>
</tbody>
</table> <div class="jive-error">
</div> <table cellpadding="0" cellspacing="0" border="0">
<tbody>
<% } else if (errors.containsKey("invalidAddress")) { %> <tr>
<td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0"></td>
<div class="jive-error"> <td class="jive-icon-label"><fmt:message key="registration.props.form.registration_invalid_email" /></td>
<table cellpadding="0" cellspacing="0" border="0"> </tr>
<tbody> </tbody>
<tr> </table>
<td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0"></td> </div>
<td class="jive-icon-label">Invalid email address.</td>
</tr> <% } %>
</tbody>
</table> <div>
</div> <label for="contacttf"><fmt:message key="registration.props.form.registration_add_im" />:</label>
<input type="text" name="contactIM" size="30" maxlength="100" value="<%= (contactIM != null ? contactIM : "") %>" id="contacttf"/>
<% } %> <input type="submit" value="<fmt:message key="registration.props.form.registration_add" />" onclick="return addIMContact();"/>
<div> <br><br>
<label for="contacttf">Add IM Contact:</label>
<input type="text" name="contactIM" size="30" maxlength="100" value="<%= (contactIM != null ? contactIM : "") %>" id="contacttf"/> <div class="jive-table" style="width:400px;">
<input type="submit" value="Add" onclick="return addIMContact();"/> <table cellpadding="0" cellspacing="0" border="0" width="100%">
<thead>
<br><br> <tr>
<th width="99%"><fmt:message key="registration.props.form.registration_im_contact" /></th>
<div class="jive-table" style="width:400px;"> <th width="1%" nowrap><fmt:message key="registration.props.form.registration_remove" /></th>
<table cellpadding="0" cellspacing="0" border="0" width="100%"> </tr>
<thead> </thead>
<tr> <tbody>
<th width="99%">IM Contact</th> <% if (plugin.getIMContacts().size() == 0) { %>
<th width="1%" nowrap>Remove</th>
</tr> <tr>
</thead> <td width="100%" colspan="2" align="center" nowrap><fmt:message key="registration.props.form.registration_no_contact" /></td>
<tbody> </tr>
<% if (plugin.getIMContacts().size() == 0) { %>
<% } %>
<tr>
<td width="100%" colspan="2" align="center" nowrap>No contacts specified, use the form above to add one.</td> <% for (String imContact : plugin.getIMContacts()) { %>
</tr>
<tr>
<% } %> <td width="99%"><%=imContact %></td>
<td width="1%" align="center"><a
<% for (String imContact : plugin.getIMContacts()) { %> href="registration-props-form.jsp?deleteIM=true&contactIM=<%=imContact %>"
title="Delete Contact?"
<tr> onclick="return confirm('Are you sure you want to delete this contact?');"><img
<td width="99%"><%=imContact %></td> src="images/delete-16x16.gif" width="16" height="16"
<td width="1%" align="center"><a border="0"></a>
href="registration-props-form.jsp?deleteIM=true&contactIM=<%=imContact %>" </td>
title="Delete Contact?" </tr>
onclick="return confirm('Are you sure you want to delete this contact?');"><img
src="images/delete-16x16.gif" width="16" height="16" <% } %>
border="0"></a> </tbody>
</td> </table>
</tr> </div>
</div>
<% } %>
</tbody> <div>
</table> <label for="emailtf"><fmt:message key="registration.props.form.registration_add_email" />:</label>
</div> <input type="text" name="contactEmail" size="30" maxlength="100" value="<%= (contactEmail != null ? contactEmail : "") %>" id="emailtf"/>
</div> <input type="submit" value="<fmt:message key="registration.props.form.registration_add" />" onclick="return addEmailContact();"/>
<div> <br><br>
<label for="emailtf">Add Email Contact:</label>
<input type="text" name="contactEmail" size="30" maxlength="100" value="<%= (contactEmail != null ? contactEmail : "") %>" id="emailtf"/> <div class="jive-table" style="width:400px;">
<input type="submit" value="Add" onclick="return addEmailContact();"/> <table cellpadding="0" cellspacing="0" border="0" width="100%">
<thead>
<br><br> <tr>
<th width="99%"><fmt:message key="registration.props.form.registration_email_contact" /></th>
<div class="jive-table" style="width:400px;"> <th width="1%" nowrap><fmt:message key="registration.props.form.registration_add" /></th>
<table cellpadding="0" cellspacing="0" border="0" width="100%"> </tr>
<thead> </thead>
<tr> <tbody>
<th width="99%">Email Contact</th> <% if (plugin.getEmailContacts().size() == 0) { %>
<th width="1%" nowrap>Remove</th>
</tr> <tr>
</thead> <td width="100%" colspan="2" align="center" nowrap><fmt:message key="registration.props.form.registration_no_contact" /></td>
<tbody> </tr>
<% if (plugin.getEmailContacts().size() == 0) { %>
<% } %>
<tr>
<td width="100%" colspan="2" align="center" nowrap>No contacts specified, use the form above to add one.</td> <% for (String emailContact : plugin.getEmailContacts()) { %>
</tr>
<tr>
<% } %> <td width="99%"><%=emailContact %></td>
<td width="1%" align="center"><a
<% for (String emailContact : plugin.getEmailContacts()) { %> href="registration-props-form.jsp?deleteEmail=true&contactEmail=<%=emailContact %>"
title="Delete Contact?"
<tr> onclick="return confirm('Are you sure you want to delete this contact?');"><img
<td width="99%"><%=emailContact %></td> src="images/delete-16x16.gif" width="16" height="16"
<td width="1%" align="center"><a border="0"></a>
href="registration-props-form.jsp?deleteEmail=true&contactEmail=<%=emailContact %>" </td>
title="Delete Contact?" </tr>
onclick="return confirm('Are you sure you want to delete this contact?');"><img
src="images/delete-16x16.gif" width="16" height="16" <% } %>
border="0"></a> </tbody>
</td> </table>
</tr> </div>
</div>
<% } %> </div>
</tbody> </form>
</table>
</div> <br>
</div>
</fieldset> <form action="registration-props-form.jsp?savemessage=true" method="post">
</form> <div class="jive-contentBoxHeader"><fmt:message key="registration.props.form.welcome_message" /></div>
<div class="jive-contentBox">
<br><br> <p><fmt:message key="registration.props.form.welcome_message_details" /></p>
<form action="registration-props-form.jsp?savemessage=true" method="post"> <% if (ParamUtils.getBooleanParameter(request, "welcomeSaved")) { %>
<fieldset>
<legend>Welcome Message</legend> <div class="jive-success">
<div> <table cellpadding="0" cellspacing="0" border="0">
<tbody>
<p>Enter the welcome message that will be sent to new users when they register.</p> <tr>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<% if (ParamUtils.getBooleanParameter(request, "welcomeSaved")) { %> <td class="jive-icon-label"><fmt:message key="registration.props.form.welcome_message_saved" /></td>
</tr>
<div class="jive-success"> </tbody>
<table cellpadding="0" cellspacing="0" border="0"> </table>
<tbody> </div>
<tr>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td> <% } %>
<td class="jive-icon-label">Message saved successfully.</td>
</tr> <table cellpadding="3" cellspacing="0" border="0" width="100%">
</tbody> <tbody>
</table> <tr>
</div> <td width="5%" valign="top">Message:&nbsp;</td>
<td width="95%"><textarea cols="45" rows="5" wrap="virtual" name="welcomemessage"><%= welcomeMessage %></textarea></td>
<% } %> <% if (errors.containsKey("missingWelcomeMessage")) { %>
<span class="jive-error-text"><br><fmt:message key="registration.props.form.welcome_message_missing" /></span>
<table cellpadding="3" cellspacing="0" border="0" width="100%"> <% } %>
<tbody> </tr>
<tr> </tbody>
<td width="5%" valign="top">Message:&nbsp;</td> </table>
<td width="95%"><textarea cols="45" rows="5" wrap="virtual" name="welcomemessage"><%= welcomeMessage %></textarea></td>
<% if (errors.containsKey("missingWelcomeMessage")) { %> <br>
<span class="jive-error-text"><br>Please enter a welcome message.</span> <input type="submit" value="<fmt:message key="registration.props.form.welcome_message_save" />"/>
<% } %> </div>
</tr> </form>
</tbody>
</table> <br>
</div>
<form action="registration-props-form.jsp?savegroup=true" method="post">
<input type="submit" value="Save Message"/> <div class="jive-contentBoxHeader"><fmt:message key="registration.props.form.default_group" /></div>
</fieldset> <div class="jive-contentBox">
</form> <p><fmt:message key="registration.props.form.default_group_details" /></p>
<br><br> <% if (ParamUtils.getBooleanParameter(request, "groupSaved")) { %>
<form action="registration-props-form.jsp?savegroup=true" method="post"> <div class="jive-success">
<fieldset> <table cellpadding="0" cellspacing="0" border="0">
<legend>Default Group</legend> <tbody>
<div> <tr>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<p>Enter the name of the group that all new users will be automatically added to.</p> <td class="jive-icon-label"><fmt:message key="registration.props.form.default_group_saved" /></td>
</tr>
<% if (ParamUtils.getBooleanParameter(request, "groupSaved")) { %> </tbody>
</table>
<div class="jive-success"> </div>
<table cellpadding="0" cellspacing="0" border="0">
<tbody> <% } %>
<tr>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td> <table cellpadding="3" cellspacing="0" border="0" width="100%">
<td class="jive-icon-label">Group saved successfully.</td> <tbody>
</tr> <tr>
</tbody> <td>Default Group:&nbsp;<input type="text" name="groupname" size="30" maxlength="100" value="<%= (group != null ? group : "") %>"/>
</table> <% if (errors.containsKey("groupNotFound")) { %>
</div> <span class="jive-error-text"><br><fmt:message key="registration.props.form.default_group_invalid" /></span>
<% } %>
<% } %> </tr>
</tbody>
<table cellpadding="3" cellspacing="0" border="0" width="100%"> </table>
<tbody>
<tr> <br>
<td>Default Group:&nbsp;<input type="text" name="groupname" size="30" maxlength="100" value="<%= (group != null ? group : "") %>"/> <input type="submit" value="<fmt:message key="registration.props.form.default_group_save" />"/>
<% if (errors.containsKey("groupNotFound")) { %> </div>
<span class="jive-error-text"><br>Group not found or is invalid.</span> </form>
<% } %>
</tr> <br>
</tbody>
</table> <form action="registration-props-form.jsp?saveheader=true" method="post">
</div> <div class="jive-contentBoxHeader"><fmt:message key="registration.props.form.sign_up" /></div>
<div class="jive-contentBox">
<input type="submit" value="Save Group"/> <p><fmt:message key="registration.props.form.sign_up_details" /></p>
</fieldset>
</form> <% if (ParamUtils.getBooleanParameter(request, "headerSaved")) { %>
<br><br> <div class="jive-success">
<table cellpadding="0" cellspacing="0" border="0">
<form action="registration-props-form.jsp?saveheader=true" method="post"> <tbody>
<fieldset> <tr>
<legend>Sign-Up Page Header Text</legend> <td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<div> <td class="jive-icon-label"><fmt:message key="registration.props.form.sign_up_saved" /></td>
</tr>
<p>Enter the text that will be displayed at the top of the sign-up web page.</p> </tbody>
</table>
<% if (ParamUtils.getBooleanParameter(request, "headerSaved")) { %> </div>
<div class="jive-success"> <% } %>
<table cellpadding="0" cellspacing="0" border="0">
<tbody> <table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr> <tbody>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td> <tr>
<td class="jive-icon-label">Header saved successfully.</td> <td>Header Text:&nbsp;<input type="text" name="header" size="30" maxlength="100" value="<%=header %>"/></td>
</tr> <% if (errors.containsKey("missingHeader")) { %>
</tbody> <span class="jive-error-text"><br><fmt:message key="registration.props.form.sign_up_missing" /></span>
</table> <% } %>
</div> </tr>
</tbody>
<% } %> </table>
<table cellpadding="3" cellspacing="0" border="0" width="100%"> <br>
<tbody> <input type="submit" value="<fmt:message key="registration.props.form.sign_up_save" />"/>
<tr> </div>
<td>Header Text:&nbsp;<input type="text" name="header" size="30" maxlength="100" value="<%=header %>"/></td> </form>
<% if (errors.containsKey("missingHeader")) { %>
<span class="jive-error-text"><br>Please enter a header.</span> </body>
<% } %>
</tr>
</tbody>
</table>
</div>
<input type="submit" value="Save Message"/>
</fieldset>
</form>
</body>
</html> </html>
\ No newline at end of file
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
org.jivesoftware.wildfire.plugin.RegistrationPlugin, org.jivesoftware.wildfire.plugin.RegistrationPlugin,
org.jivesoftware.util.*, org.jivesoftware.util.*,
org.jivesoftware.stringprep.Stringprep, org.jivesoftware.stringprep.Stringprep,
org.jivesoftware.stringprep.StringprepException" org.jivesoftware.stringprep.StringprepException,
org.xmpp.packet.JID"
%> %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
...@@ -17,15 +18,15 @@ ...@@ -17,15 +18,15 @@
<html> <html>
<head> <head>
<title>Jive Wildfire Web Registration</title> <title><fmt:message key="registration.sign.up.title" /></title>
<link rel="stylesheet" type="text/css" href="/style/global.css"> <link rel="stylesheet" type="text/css" href="/style/global.css">
<style type="text/css"> <style type="text/css">
.drop-shadow { .drop-shadow {
font-weight: bold; font-weight: bold;
font-size: 14pt; font-size: 14pt;
color: white; color: white;
text-shadow: black 0.1em 0.1em 0.2em; text-shadow: black 0.1em 0.1em 0.2em;
padding-top: 21px;} padding-top: 21px;}
</style> </style>
<meta name="decorator" content="none"/> <meta name="decorator" content="none"/>
</head> </head>
...@@ -50,6 +51,7 @@ ...@@ -50,6 +51,7 @@
else { else {
try { try {
username = username.trim().toLowerCase(); username = username.trim().toLowerCase();
username = JID.escapeNode(username);
username = Stringprep.nodeprep(username); username = Stringprep.nodeprep(username);
} }
catch (StringprepException se) { catch (StringprepException se) {
...@@ -101,11 +103,11 @@ ...@@ -101,11 +103,11 @@
<% if (!plugin.webEnabled()) { %> <% if (!plugin.webEnabled()) { %>
This service is currently unavailable. <fmt:message key="registration.sign.up.unavailable" />
<% } else { %> <% } else { %>
<p>Use the form below to create a new user account</p> <p><fmt:message key="registration.sign.up.instructions" /></p>
<c:set var="submit" value="${param.create}"/> <c:set var="submit" value="${param.create}"/>
<c:set var="errors" value="${errors}"/> <c:set var="errors" value="${errors}"/>
...@@ -120,21 +122,21 @@ This service is currently unavailable. ...@@ -120,21 +122,21 @@ This service is currently unavailable.
<td class="jive-icon-label"> <td class="jive-icon-label">
<% if (errors.get("general") != null) { %> <% if (errors.get("general") != null) { %>
<fmt:message key="user.create.error_creating_account" /> <fmt:message key="registration.sign.up.error_creating_account" />
<% } else if (errors.get("username") != null) { %> <% } else if (errors.get("username") != null) { %>
<fmt:message key="user.create.invalid_username" /> <fmt:message key="registration.sign.up.invalid_username" />
<% } else if (errors.get("usernameAlreadyExists") != null) { %> <% } else if (errors.get("usernameAlreadyExists") != null) { %>
<fmt:message key="user.create.user_exist" /> <fmt:message key="registration.sign.up.user_exist" />
<% } else if (errors.get("name") != null) { %> <% } else if (errors.get("name") != null) { %>
<fmt:message key="user.create.invalid_name" /> <fmt:message key="registration.sign.up.invalid_name" />
<% } else if (errors.get("email") != null) { %> <% } else if (errors.get("email") != null) { %>
<fmt:message key="user.create.invalid_email" /> <fmt:message key="registration.sign.up.invalid_email" />
<% } else if (errors.get("password") != null) { %> <% } else if (errors.get("password") != null) { %>
<fmt:message key="user.create.invalid_password" /> <fmt:message key="registration.sign.up.invalid_password" />
<% } else if (errors.get("passwordMatch") != null) { %> <% } else if (errors.get("passwordMatch") != null) { %>
<fmt:message key="user.create.invalid_match_password" /> <fmt:message key="registration.sign.up.invalid_match_password" />
<% } else if (errors.get("passwordConfirm") != null) { %> <% } else if (errors.get("passwordConfirm") != null) { %>
<fmt:message key="user.create.invalid_password_confirm" /> <fmt:message key="registration.sign.up.invalid_password_confirm" />
<% } %> <% } %>
</td> </td>
</tr> </tr>
...@@ -150,7 +152,7 @@ This service is currently unavailable. ...@@ -150,7 +152,7 @@ This service is currently unavailable.
<tbody> <tbody>
<tr> <tr>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td> <td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<td class="jive-icon-label">New account successfully created.</td> <td class="jive-icon-label"><fmt:message key="registration.sign.up.success" /></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -160,13 +162,13 @@ This service is currently unavailable. ...@@ -160,13 +162,13 @@ This service is currently unavailable.
<form name="f" action="sign-up.jsp" method="get"> <form name="f" action="sign-up.jsp" method="get">
<fieldset> <div class="jive-contentBoxHeader"><fmt:message key="registration.sign.up.create_account" /></div>
<legend>Create Account</legend> <div class="jive-contentBox">
<div> <div>
<table cellpadding="3" cellspacing="0" border="0" width="100%"> <table cellpadding="3" cellspacing="0" border="0" width="100%">
<tbody> <tbody>
<tr> <tr>
<td width="1%" nowrap><label for="usernametf">Username:</label> *</td> <td width="1%" nowrap><label for="usernametf"><fmt:message key="registration.sign.up.username" />:</label> *</td>
<td width="99%"> <td width="99%">
<input type="text" name="username" size="30" maxlength="75" value="<%= ((username!=null) ? username : "") %>" <input type="text" name="username" size="30" maxlength="75" value="<%= ((username!=null) ? username : "") %>"
id="usernametf" autocomplete="off"> id="usernametf" autocomplete="off">
...@@ -174,7 +176,7 @@ This service is currently unavailable. ...@@ -174,7 +176,7 @@ This service is currently unavailable.
</tr> </tr>
<tr> <tr>
<td width="1%" nowrap> <td width="1%" nowrap>
<label for="nametf">Name:</label> <label for="nametf"><fmt:message key="registration.sign.up.name" />:</label>
</td> </td>
<td width="99%"> <td width="99%">
<input type="text" name="name" size="30" maxlength="75" value="<%= ((name!=null) ? name : "") %>" <input type="text" name="name" size="30" maxlength="75" value="<%= ((name!=null) ? name : "") %>"
...@@ -183,7 +185,7 @@ This service is currently unavailable. ...@@ -183,7 +185,7 @@ This service is currently unavailable.
</tr> </tr>
<tr> <tr>
<td width="1%" nowrap> <td width="1%" nowrap>
<label for="emailtf">Email:</label></td> <label for="emailtf"><fmt:message key="registration.sign.up.email" />:</label></td>
<td width="99%"> <td width="99%">
<input type="text" name="email" size="30" maxlength="75" value="<%= ((email!=null) ? email : "") %>" <input type="text" name="email" size="30" maxlength="75" value="<%= ((email!=null) ? email : "") %>"
id="emailtf"> id="emailtf">
...@@ -191,7 +193,7 @@ This service is currently unavailable. ...@@ -191,7 +193,7 @@ This service is currently unavailable.
</tr> </tr>
<tr> <tr>
<td nowrap> <td nowrap>
<label for="passtf">Password:</label> * <label for="passtf"><fmt:message key="registration.sign.up.password" />:</label> *
</td> </td>
<td width="99%"> <td width="99%">
<input type="password" name="password" value="" size="20" maxlength="75" <input type="password" name="password" value="" size="20" maxlength="75"
...@@ -200,7 +202,7 @@ This service is currently unavailable. ...@@ -200,7 +202,7 @@ This service is currently unavailable.
</tr> </tr>
<tr> <tr>
<td width="1%" nowrap> <td width="1%" nowrap>
<label for="confpasstf">Confirm Password:</label> * <label for="confpasstf"><fmt:message key="registration.sign.up.confirm_password" />:</label> *
</td> </td>
<td width="99%"> <td width="99%">
<input type="password" name="passwordConfirm" value="" size="20" maxlength="75" <input type="password" name="passwordConfirm" value="" size="20" maxlength="75"
...@@ -211,15 +213,12 @@ This service is currently unavailable. ...@@ -211,15 +213,12 @@ This service is currently unavailable.
</table> </table>
<br> <br>
<span class="jive-description"> <span class="jive-description">
* Required Fields * <fmt:message key="registration.sign.up.required_fields" />
</span> </span>
</div> </div>
</fieldset> </div>
<br><br>
<input type="submit" name="create" value="Create Account">
<input type="submit" name="create" value="<fmt:message key="registration.sign.up.create_account" />">
</form> </form>
<script language="JavaScript" type="text/javascript"> <script language="JavaScript" type="text/javascript">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment