Commit 461670da authored by conor's avatar conor

added new features to content filter, see changelog.html for details

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3262 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8e88fb87
......@@ -44,6 +44,19 @@
ContentFilter Plugin Changelog
</h1>
<p><b>1.2</b> -- Jan, 2006</p>
<ul>
<li>Added support to notify administrator by email on content match notification.</li>
<li>Added support to include original packet when sending violation notifications.</li>
<li>Added support to filter users presence status.</li>
<li>Increased size of patterns input area to allow more patterns.</li>
<li>Fixed masking function.</li>
<li>Added debug logging to help users identify problems.</li>
<li>Updated readme.html</li>
</ul>
<p><b>1.0.1</b> -- December 15, 2005</p>
<ul>
<li>Now requires Wildfire 2.4.0</li>
......
......@@ -53,7 +53,7 @@ alternative content.
<h2>Installation</h2>
<p>
Copy the contentfilter.jar into the plugins directory of your Wildfire
Copy the contentfilter.jar into the plugins directory of your Jive Messenger
installation. The plugin will then be automatically deployed. To upgrade to a
new version, copy the new contentfilter.jar file over the existing file.
</p>
......@@ -62,7 +62,7 @@ new version, copy the new contentfilter.jar file over the existing file.
<p>
By default, after the plugin has been deployed all of its features are disabled.
This plugin is configured via the "Content Filter" sidebar item located under the
"System" tab in the Wildfire Admin Console.
"System" tab in the Jive Messenger Admin Console.
</p>
<p>
......@@ -73,16 +73,28 @@ can be enhanced with more complex regular expressions as required e.g.:
<ul>
<li>for a complete word match, add boundary checks with \b e.g. \bfox\b will match against the word "fox" and nothing else.
<li>for case insensitive matchs add (?i) e.g. (?i)\bfox\b will match against "fox", "Fox", "foX" etc.
<li>it is also possible to group related patterns patterns e.g. fox|dog, this can be used to reduce the number of individual patterns to test for.
</ul>
</p>
<p>
If you choose to filter your users presence status and there is a content match then:
<ul>
<li>if you are masking content, other users will see a masked status.
<li>if you are rejecting content, other users not see the status change, how it affects the user with the invalid status is client dependant.
</ul>
</p>
<p>
Want to know more about regular expressions in Java? This official <a href="http://java.sun.com/docs/books/tutorial/extra/regex/">tutorial</a>
is useful.
</p>
<p>
The default mask is "***", you can change it to anything you like including smilies!
</p>
<h2>Using the Plugin</h2>
<p>
After the plugin has been configured, nothing else needs to be done to use it.
TODO - update
</p>
</body>
......
/**
* $RCSfile$
* $Revision: 1594 $
* $Date: 2005-07-04 14:08:42 -0300 (Mon, 04 Jul 2005) $
* $Date: 2005-07-04 18:08:42 +0100 (Mon, 04 Jul 2005) $
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
......@@ -11,13 +11,16 @@
package org.jivesoftware.wildfire.plugin;
import org.xmpp.packet.Message;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.dom4j.Element;
import org.xmpp.packet.Message;
import org.xmpp.packet.Packet;
/**
* Filters message content using regular expressions. If a content mask is
* provided message content will be altered.
......@@ -111,39 +114,68 @@ public class ContentFilter {
}
/**
* Filters message content.
* Filters packet content.
*
* @param msg the message to filter, its subject/body may be altered if there
* @param packet the packet to filter, its content may be altered if there
* are content matches and a content mask is set
* @return true if the msg content matched up, false otherwise
*/
public boolean filter(Message msg) {
boolean hasMatch = false;
public boolean filter(Packet p) {
return process(p.getElement());
}
if (msg.getSubject() != null) {
if (hasMatch(msg.getSubject())) {
hasMatch = true;
if (isMaskingContent()) {
String newSubject = replaceContent(msg.getSubject());
msg.setSubject(newSubject);
private boolean process(Element element) {
boolean matched = mask(element);
if (!matched || isMaskingContent())
{
//only check children if no match has yet been found
//or all content must be masked
Iterator iter = element.elementIterator();
while (iter.hasNext()) {
matched |= process((Element)iter.next());
}
}
return matched;
}
if (msg.getBody() != null) {
if (hasMatch(msg.getBody())) {
hasMatch = true;
private boolean mask(Element element) {
boolean match = false;
String content = element.getText();
if ((content != null) && (content.length() > 0)) {
for (Pattern pattern : compiledPatterns) {
Matcher matcher = pattern.matcher(content);
if (matcher.find()) {
match = true;
if (isMaskingContent()) {
String newBody = replaceContent(msg.getBody());
msg.setBody(newBody);
content = matcher.replaceAll(mask);
element.setText(content);
}
}
}
}
return hasMatch;
return match;
}
private String replaceContent(String content) {
/**
* Applies mask to the given <code>content</code>
*
* @param content
* @return masked content
*/
private String mask(String content) {
for (Pattern pattern : compiledPatterns) {
Matcher m = pattern.matcher(content);
content = m.replaceAll(mask);
......@@ -153,18 +185,19 @@ public class ContentFilter {
}
/**
* Performs sequential search for any pattern match.
* Applies patterns against the given <code>content</code>. Terminates on
* first match.
*
* @param content the content to search against
* @return true if a match is found, false otherwise
*/
private boolean hasMatch(String content) {
boolean hasMatch = false;
for (Pattern pattern : compiledPatterns) {
Matcher m = pattern.matcher(content);
if (m.find()) {
Matcher matcher = pattern.matcher(content);
if (matcher.find()) {
hasMatch = true;
break;
}
......
/**
* $RCSfile$
* $Revision: 1594 $
* $Date: 2005-07-04 14:08:42 -0300 (Mon, 04 Jul 2005) $
* $Date: 2005-07-04 18:08:42 +0100 (Mon, 04 Jul 2005) $
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
......@@ -11,6 +11,17 @@
package org.jivesoftware.wildfire.plugin;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeUtility;
import org.jivesoftware.util.EmailService;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.MessageRouter;
import org.jivesoftware.wildfire.Session;
import org.jivesoftware.wildfire.XMPPServer;
......@@ -19,12 +30,12 @@ import org.jivesoftware.wildfire.container.PluginManager;
import org.jivesoftware.wildfire.interceptor.InterceptorManager;
import org.jivesoftware.wildfire.interceptor.PacketInterceptor;
import org.jivesoftware.wildfire.interceptor.PacketRejectedException;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.wildfire.user.User;
import org.jivesoftware.wildfire.user.UserManager;
import org.xmpp.packet.JID;
import org.xmpp.packet.Message;
import org.xmpp.packet.Packet;
import java.io.File;
import org.xmpp.packet.Presence;
/**
* Content filter plugin.
......@@ -48,6 +59,30 @@ public class ContentFilterPlugin implements Plugin, PacketInterceptor {
public static final String VIOLATION_NOTIFICATION_CONTACT_PROPERTY =
"plugin.contentFilter.violation.notification.contact";
/**
* The expected value is a boolean, if true the user identified by the value
* of the property #VIOLATION_NOTIFICATION_CONTACT_PROPERTY, will also receive
* a copy of the offending packet. The default value is false.
*/
public static final String VIOLATION_INCLUDE_ORIGNAL_PACKET_ENABLED_PROPERTY =
"plugin.contentFilter.violation.notification.include.original.enabled";
/**
* The expected value is a boolean, if true the user identified by the value
* of the property #VIOLATION_NOTIFICATION_CONTACT_PROPERTY, will receive
* notification by IM. The default value is true.
*/
public static final String VIOLATION_NOTIFICATION_BY_IM_ENABLED_PROPERTY =
"plugin.contentFilter.violation.notification.by.im.enabled";
/**
* The expected value is a boolean, if true the user identified by the value
* of the property #VIOLATION_NOTIFICATION_CONTACT_PROPERTY, will receive
* notification by email. The default value is false.
*/
public static final String VIOLATION_NOTIFICATION_BY_EMAIL_ENABLED_PROPERTY =
"plugin.contentFilter.violation.notification.by.email.enabled";
/**
* The expected value is a boolean, if true the sender will be notified when a
* message is rejected, otherwise the message will be silently rejected,i.e. the
......@@ -74,6 +109,12 @@ public class ContentFilterPlugin implements Plugin, PacketInterceptor {
*/
public static final String PATTERNS_PROPERTY = "plugin.contentFilter.patterns";
/**
* The expected value is a boolean, if true Presence packets will
* be filtered
*/
public static final String FILTER_STATUS_ENABLED_PROPERTY = "plugin.contentFilter.filter.status.enabled";
/**
* The expected value is a boolean, if true the value of #MASK_PROPERTY will
* be used to mask matching content.
......@@ -123,6 +164,22 @@ public class ContentFilterPlugin implements Plugin, PacketInterceptor {
*/
private String violationContact;
/**
* flags if original packet should be included in the message
* to the violation contact.
*/
private boolean violationIncludeOriginalPacketEnabled;
/**
* flags if violation contact should be notified by IM.
*/
private boolean violationNotificationByIMEnabled;
/**
* flags if violation contact should be notified by email.
*/
private boolean violationNotificationByEmailEnabled;
/**
* flag if patterns should be used
*/
......@@ -133,6 +190,11 @@ public class ContentFilterPlugin implements Plugin, PacketInterceptor {
*/
private String patterns;
/**
* flag if Presence packets should be filtered.
*/
private boolean filterStatusEnabled;
/**
* flag if mask should be used
*/
......@@ -206,6 +268,16 @@ public class ContentFilterPlugin implements Plugin, PacketInterceptor {
changeContentFilterPatterns();
}
public boolean isFilterStatusEnabled() {
return filterStatusEnabled;
}
public void setFilterStatusEnabled(boolean enabled) {
filterStatusEnabled = enabled;
JiveGlobals.setProperty(FILTER_STATUS_ENABLED_PROPERTY, enabled ? "true"
: "false");
}
private void changeContentFilterPatterns() {
if (patternsEnabled) {
contentFilter.setPatterns(patterns);
......@@ -257,6 +329,36 @@ public class ContentFilterPlugin implements Plugin, PacketInterceptor {
return violationContact;
}
public boolean isViolationIncludeOriginalPacketEnabled() {
return violationIncludeOriginalPacketEnabled;
}
public void setViolationIncludeOriginalPacketEnabled(boolean enabled) {
violationIncludeOriginalPacketEnabled = enabled;
JiveGlobals.setProperty(VIOLATION_INCLUDE_ORIGNAL_PACKET_ENABLED_PROPERTY,
enabled ? "true" : "false");
}
public boolean isViolationNotificationByIMEnabled() {
return violationNotificationByIMEnabled;
}
public void setViolationNotificationByIMEnabled(boolean enabled) {
violationNotificationByIMEnabled = enabled;
JiveGlobals.setProperty(VIOLATION_NOTIFICATION_BY_IM_ENABLED_PROPERTY,
enabled ? "true" : "false");
}
public boolean isViolationNotificationByEmailEnabled() {
return violationNotificationByEmailEnabled;
}
public void setViolationNotificationByEmailEnabled(boolean enabled) {
violationNotificationByEmailEnabled = enabled;
JiveGlobals.setProperty(VIOLATION_NOTIFICATION_BY_EMAIL_ENABLED_PROPERTY,
enabled ? "true" : "false");
}
public void initializePlugin(PluginManager pManager, File pluginDirectory) {
// configure this plugin
initFilter();
......@@ -274,6 +376,18 @@ public class ContentFilterPlugin implements Plugin, PacketInterceptor {
violationContact = JiveGlobals.getProperty(VIOLATION_NOTIFICATION_CONTACT_PROPERTY,
"admin");
// default to true
violationNotificationByIMEnabled = JiveGlobals.getBooleanProperty(
VIOLATION_NOTIFICATION_BY_IM_ENABLED_PROPERTY, true);
// default to false
violationNotificationByEmailEnabled = JiveGlobals.getBooleanProperty(
VIOLATION_NOTIFICATION_BY_EMAIL_ENABLED_PROPERTY, false);
// default to false
violationIncludeOriginalPacketEnabled = JiveGlobals.getBooleanProperty(
VIOLATION_INCLUDE_ORIGNAL_PACKET_ENABLED_PROPERTY, false);
// default to false
rejectionNotificationEnabled = JiveGlobals.getBooleanProperty(
REJECTION_NOTIFICATION_ENABLED_PROPERTY, false);
......@@ -291,6 +405,10 @@ public class ContentFilterPlugin implements Plugin, PacketInterceptor {
changeContentFilterPatterns();
// default to false
filterStatusEnabled = JiveGlobals.getBooleanProperty(FILTER_STATUS_ENABLED_PROPERTY,
false);
// default to false
maskEnabled = JiveGlobals.getBooleanProperty(MASK_ENABLED_PROPERTY, false);
......@@ -308,24 +426,58 @@ public class ContentFilterPlugin implements Plugin, PacketInterceptor {
interceptorManager.removeInterceptor(this);
}
public void interceptPacket(Packet packet, Session session, boolean read,
boolean processed) throws PacketRejectedException {
if (patternsEnabled && !processed && (packet instanceof Message)) {
Message msg = (Message) packet;
// filter the message
boolean contentMatched = contentFilter.filter(msg);
if (isValidTargetPacket(packet, read, processed)) {
Packet original = packet;
if (Log.isDebugEnabled()) {
Log.debug("Content filter: intercepted packet:" + original.toString());
}
// make a copy of the original packet only if required,
// as it's an expensive operation
if (violationNotificationEnabled && violationIncludeOriginalPacketEnabled && maskEnabled) {
original = packet.createCopy();
}
// notify contact of violations
// filter the packet
boolean contentMatched = contentFilter.filter(packet);
if (Log.isDebugEnabled()) {
Log.debug("Content filter: content matched? " + contentMatched);
}
// notify admin of violations
if (contentMatched && violationNotificationEnabled) {
sendViolationNotification(msg);
if (Log.isDebugEnabled()) {
Log.debug("Content filter: sending violation notification.");
Log.debug("Content filter: include original msg?" +
this.violationIncludeOriginalPacketEnabled);
}
sendViolationNotification(original);
}
// msg will either be rejected silently, rejected with
// some notification to sender, or masked.
if (contentMatched) {
if (maskEnabled) {
//masking enabled, no further action required
if (Log.isDebugEnabled()) {
Log.debug("Content filter: masked content:" + packet.toString());
}
} else {
//no masking, msg must be rejected
if (Log.isDebugEnabled()) {
Log.debug("Content filter: rejecting packet.");
}
// reject the message if not masking content
if (contentMatched && !maskEnabled) {
PacketRejectedException rejected = new PacketRejectedException(
"Message rejected with disallowed content!");
"Packet rejected with disallowed content!");
if (rejectionNotificationEnabled) {
// let the sender know about the rejection, this is
......@@ -337,16 +489,54 @@ public class ContentFilterPlugin implements Plugin, PacketInterceptor {
}
}
}
}
private void sendViolationNotification(Message offendingMsg) {
String subject = "Content filter notification!";
private boolean isValidTargetPacket(Packet packet, boolean read, boolean processed) {
return patternsEnabled && !processed && read &&
(packet instanceof Message ||
(filterStatusEnabled && packet instanceof Presence));
}
String msg = "Disallowed content detected in message from:"
+ offendingMsg.getFrom() + " to:" + offendingMsg.getTo()
private void sendViolationNotification(Packet originalPacket) {
String subject = "Content filter notification!";
String body = null;
if (originalPacket instanceof Message) {
Message originalMsg = (Message) originalPacket;
body = "Disallowed content detected in message from:"
+ originalMsg.getFrom() + " to:" + originalMsg.getTo()
+ ", message was "
+ (contentFilter.isMaskingContent() ? "altered" : "rejected");
+ (contentFilter.isMaskingContent() ? "altered." : "rejected.")
+ (violationIncludeOriginalPacketEnabled ?
"\nOriginal subject:" + (originalMsg.getSubject() != null ? originalMsg.getSubject() : "")
+ "\nOriginal content:" + (originalMsg.getBody() != null ? originalMsg.getBody() : "") : "");
} else {
//presence
Presence originalPresence = (Presence) originalPacket;
body = "Disallowed status detected in presence from:"
+ originalPresence.getFrom()
+ ", status was "
+ (contentFilter.isMaskingContent() ? "altered." : "rejected.")
+ (violationIncludeOriginalPacketEnabled ?
"\nOriginal status:" + originalPresence.getStatus() : "");
}
if (violationNotificationByIMEnabled) {
if (Log.isDebugEnabled()) {
Log.debug("Sending IM notification");
}
messageRouter.route(createServerMessage(subject, body));
}
if (violationNotificationByEmailEnabled) {
messageRouter.route(createServerMessage(subject, msg));
if (Log.isDebugEnabled()) {
Log.debug("Sending email notification");
}
sendViolationNotificationEmail(subject, body);
}
}
private Message createServerMessage(String subject, String body) {
......@@ -358,4 +548,34 @@ public class ContentFilterPlugin implements Plugin, PacketInterceptor {
message.setBody(body);
return message;
}
private void sendViolationNotificationEmail(String subject, String body) {
List<MimeMessage> messages = new ArrayList<MimeMessage>();
EmailService emailService = EmailService.getInstance();
MimeMessage message = emailService.createMimeMessage();
String encoding = MimeUtility.mimeCharset("iso-8859-1");
try {
User user = UserManager.getInstance().getUser(violationContact);
message.setRecipient(javax.mail.Message.RecipientType.TO, new InternetAddress(user.getEmail()));
message.setFrom(new InternetAddress("no_reply@" + violationNotificationFrom, "Wildfire", encoding));
message.setText(body);
message.setSubject(subject);
messages.add(message);
} catch (Exception e) {
Log.error(e);
}
emailService.sendMessages(messages);
}
}
\ No newline at end of file
......@@ -13,9 +13,11 @@
boolean save = request.getParameter("save") != null;
boolean success = request.getParameter("success") != null;
//pattern options
//filter options
boolean patternsEnabled = ParamUtils.getBooleanParameter(request, "patternsenabled");
String patterns = ParamUtils.getParameter(request, "patterns");
String [] filterStatusChecked = ParamUtils.getParameters(request, "filterstatus");
boolean filterStatusEnabled = filterStatusChecked.length > 0;
//mask options
boolean maskEnabled = ParamUtils.getBooleanParameter(request, "maskenabled");
......@@ -28,6 +30,10 @@
//notification options
boolean notificationEnabled = ParamUtils.getBooleanParameter(request, "notificationenabled");
String contactName = ParamUtils.getParameter(request, "contactname");
List<String> notificationOptions = Arrays.asList(ParamUtils.getParameters(request, "notificationcb"));
boolean notificationByIMEnabled = notificationOptions.contains("notificationbyim");
boolean notificationByEmailEnabled = notificationOptions.contains("notificationbyemail");
boolean includeOriginalEnabled = notificationOptions.contains("notificationincludeoriginal");
//get handle to plugin
ContentFilterPlugin plugin = (ContentFilterPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("contentfilter");
......@@ -38,9 +44,7 @@
if (patterns == null) {
errors.put("missingPatterns", "missingPatterns");
}
else {
} else {
String[] data = patterns.split(",");
try {
for (String aData : data) {
......@@ -51,7 +55,6 @@
}
}
if (mask == null) {
errors.put("missingMask", "missingMask");
}
......@@ -65,27 +68,43 @@
} else {
contactName = contactName.trim().toLowerCase();
try {
UserManager.getInstance().getUser(contactName);
User user = UserManager.getInstance().getUser(contactName);
if (notificationByEmailEnabled) {
//verify that the user has an email address
if (user.getEmail() == null) {
errors.put("userEmailNotConfigured", "userEmailNotConfigured");
}
//verify that the email server is configured
if (!JiveGlobals.getBooleanProperty("mail.configured", false)) {
errors.put("mailServerNotConfigured", "mailServerNotConfigured");
}
}
} catch (UserNotFoundException unfe) {
errors.put("userNotFound", "userNotFound");
}
}
if (!notificationByIMEnabled && !notificationByEmailEnabled) {
errors.put("notificationFormatNotConfigured", "notificationFormatNotConfigured");
}
if (errors.size() == 0) {
plugin.setPatternsEnabled(patternsEnabled);
plugin.setPatterns(patterns);
plugin.setFilterStatusEnabled(filterStatusEnabled);
plugin.setMaskEnabled(maskEnabled);
plugin.setMask(mask);
plugin.setViolationNotificationEnabled(notificationEnabled);
plugin.setViolationContact(contactName);
plugin.setViolationNotificationByIMEnabled(notificationByIMEnabled);
plugin.setViolationNotificationByEmailEnabled(notificationByEmailEnabled);
plugin.setViolationIncludeOriginalPacketEnabled(includeOriginalEnabled);
plugin.setRejectionNotificationEnabled(rejectionNotificationEnabled);
plugin.setRejectionMessage(rejectionMsg);
response.sendRedirect("contentfilter-props-edit-form.jsp?success=true");
return;
}
}
else {
} else {
patterns = plugin.getPatterns();
mask = plugin.getMask();
contactName = plugin.getViolationContact();
......@@ -97,9 +116,13 @@
mask = plugin.getMask();
contactName = plugin.getViolationContact();
rejectionMsg = plugin.getRejectionMessage();
notificationByIMEnabled = plugin.isViolationNotificationByIMEnabled();
notificationByEmailEnabled = plugin.isViolationNotificationByEmailEnabled();
includeOriginalEnabled = plugin.isViolationIncludeOriginalPacketEnabled();
}
patternsEnabled = plugin.isPatternsEnabled();
filterStatusEnabled = plugin.isFilterStatusEnabled();
maskEnabled = plugin.isMaskEnabled();
notificationEnabled = plugin.isViolationNotificationEnabled();
rejectionNotificationEnabled = plugin.isRejectionNotificationEnabled();
......@@ -163,7 +186,7 @@ Use the form below to edit content filter settings.<br>
<%= ((patternsEnabled) ? "" : "checked") %>>
</td>
<td width="99%">
<label for="not01"><b>Disabled</b></label> - Messages will not be filtered.
<label for="not01"><b>Disabled</b></label> - Packets will not be filtered.
</td>
</tr>
<tr>
......@@ -172,14 +195,17 @@ Use the form below to edit content filter settings.<br>
<%= ((patternsEnabled) ? "checked" : "") %>>
</td>
<td width="99%">
<label for="not02"><b>Enabled</b></label> - Messages will be filtered.
<label for="not02"><b>Enabled</b></label> - Packets will be filtered.
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="left">Patterns:&nbsp;
<input type="text" size="100" maxlength="100" name="patterns"
value="<%= (patterns != null ? patterns : "") %>">
<td align="left">Patterns:&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<textarea rows="10" cols="100" name="patterns"><%= (patterns != null ? patterns : "") %></textarea>
<% if (errors.containsKey("missingPatterns")) { %>
<span class="jive-error-text">
<br>Please enter comma separated, regular expressions.
......@@ -191,6 +217,10 @@ Use the form below to edit content filter settings.<br>
<% } %>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="checkbox" name="filterstatus" value="filterstatus" <%= filterStatusEnabled ? "checked" : "" %>>Filter users presence status.</input></td>
</tr>
</tbody>
</table>
</div>
......@@ -203,7 +233,7 @@ Use the form below to edit content filter settings.<br>
<div>
<p>
Enable this feature to alter message content when there is a pattern match.
Enable this feature to alter packet content when there is a pattern match.
</p>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
......@@ -214,7 +244,7 @@ Use the form below to edit content filter settings.<br>
<%= ((maskEnabled) ? "" : "checked") %>>
</td>
<td width="99%">
<label for="not01"><b>Disabled</b></label> - Messages will be rejected.
<label for="not01"><b>Disabled</b></label> - Packets will be rejected.
</td>
</tr>
<tr>
......@@ -223,7 +253,7 @@ Use the form below to edit content filter settings.<br>
<%= ((maskEnabled) ? "checked" : "") %>>
</td>
<td width="99%">
<label for="not02"><b>Enabled</b></label> - Messages will be masked.
<label for="not02"><b>Enabled</b></label> - Packets will be masked.
</td>
</tr>
<tr>
......@@ -250,7 +280,7 @@ Use the form below to edit content filter settings.<br>
<div>
<p>
Enable this feature to have the message sender notified whenever a message is rejected.
Enable this feature to have the sender notified whenever a packet is rejected.
NB: This feature is only operational if "Content Mask" feature is disabled.
</p>
......@@ -323,9 +353,8 @@ Use the form below to edit content filter settings.<br>
</tr>
<tr>
<td>&nbsp;</td>
<td align="left">Username:&nbsp;
<input type="text" size="20" maxlength="100" name="contactname"
value="<%= (contactName != null ? contactName : "") %>">@<%= XMPPServer.getInstance().getServerInfo().getName() %>
<td align="left">Username:&nbsp
<input type="text" size="20" maxlength="100" name="contactname" value="<%= (contactName != null ? contactName : "") %>">@<%= XMPPServer.getInstance().getServerInfo().getName() %>
<% if (errors.containsKey("missingContactName")) { %>
<span class="jive-error-text">
<br>Please enter a username.
......@@ -337,6 +366,27 @@ Use the form below to edit content filter settings.<br>
<% } %>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="checkbox" name="notificationcb" value="notificationbyim" <%= notificationByIMEnabled ? "checked" : "" %>>Notify by IM.</input>
<input type="checkbox" name="notificationcb" value="notificationbyemail" <%= notificationByEmailEnabled ? "checked" : "" %>>Notify by Email.</input>
<input type="checkbox" name="notificationcb" value="notificationincludeoriginal" <%= includeOriginalEnabled ? "checked" : "" %>>Include original packet.</input>
<% if (errors.containsKey("mailServerNotConfigured")) { %>
<span class="jive-error-text">
<br>Error, sending an email will fail because the mail server is not setup. Please go to the <a href="/system-email.jsp">mail settings page</a> and set the mail host.
</span>
<% } else if (errors.containsKey("userEmailNotConfigured")) { %>
<span class="jive-error-text">
<br>Please configure <a href="/user-properties.jsp?username=<%= contactName %>"><%= contactName %>'s</a> email address.
</span>
<% } else if (errors.containsKey("notificationFormatNotConfigured")) { %>
<span class="jive-error-text">
<br>Users must be notified by IM and/or Email.
</span>
<% } %>
</td>
</tr>
</tbody>
</table>
</div>
......
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