Commit fcd1adfc authored by Holger Bergunde's avatar Holger Bergunde Committed by holger.bergunde

GoJara minor fixes v1.2.5

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13506 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4b34d8b6
...@@ -44,6 +44,14 @@ ...@@ -44,6 +44,14 @@
GoJara Plugin Changelog GoJara Plugin Changelog
</h1> </h1>
<p><b>1.2.5</b> -- Feb 22, 2013</p>
<ul>
<li>Fixed bypassing the access control</li>
<li>Fixed InvalidArgumentException when invalid JID is in the packet</li>
</ul>
<p><b>1.2.4</b> -- Feb 21, 2013</p> <p><b>1.2.4</b> -- Feb 21, 2013</p>
<ul> <ul>
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<name>GoJara</name> <name>GoJara</name>
<description>ProtoXEP-xxxx: Remote Roster Management support</description> <description>ProtoXEP-xxxx: Remote Roster Management support</description>
<author>Holger Bergunde and Daniel Henninger</author> <author>Holger Bergunde and Daniel Henninger</author>
<version>1.2.4</version> <version>1.2.5</version>
<date>02/16/2013</date> <date>02/22/2013</date>
<databaseKey>gojara</databaseKey> <databaseKey>gojara</databaseKey>
<databaseVersion>0</databaseVersion> <databaseVersion>0</databaseVersion>
<minServerVersion>3.7.0</minServerVersion> <minServerVersion>3.7.0</minServerVersion>
......
...@@ -45,7 +45,7 @@ public class DiscoPackageInterceptorHandler implements PacketInterceptor { ...@@ -45,7 +45,7 @@ public class DiscoPackageInterceptorHandler implements PacketInterceptor {
if (root == null) if (root == null)
return; return;
if (iqpacket.getFrom().toString().equals(_serverDomain)) { if (iqpacket.getFrom() == null || iqpacket.getFrom().toString().equals(_serverDomain)) {
String ns = root.getNamespaceURI(); String ns = root.getNamespaceURI();
if (ns.equals("http://jabber.org/protocol/disco#items") && iqpacket.getType().equals(IQ.Type.result)) { if (ns.equals("http://jabber.org/protocol/disco#items") && iqpacket.getType().equals(IQ.Type.result)) {
if (!_permissions.allowedForUser(_subDomain, iqpacket.getTo())) { if (!_permissions.allowedForUser(_subDomain, iqpacket.getTo())) {
......
...@@ -20,6 +20,7 @@ public class StatisticPackageInterceptor implements PacketInterceptor { ...@@ -20,6 +20,7 @@ public class StatisticPackageInterceptor implements PacketInterceptor {
private String _subdomain; private String _subdomain;
private DatabaseManager _db; private DatabaseManager _db;
// private static final Logger Log = LoggerFactory.getLogger(StatisticPackageInterceptor.class);
public StatisticPackageInterceptor(String subdomain) { public StatisticPackageInterceptor(String subdomain) {
_subdomain = subdomain; _subdomain = subdomain;
...@@ -28,21 +29,30 @@ public class StatisticPackageInterceptor implements PacketInterceptor { ...@@ -28,21 +29,30 @@ public class StatisticPackageInterceptor implements PacketInterceptor {
public void interceptPacket(Packet packet, Session session, boolean incoming, boolean processed) public void interceptPacket(Packet packet, Session session, boolean incoming, boolean processed)
throws PacketRejectedException { throws PacketRejectedException {
JID from = packet.getFrom(); try {
JID to = packet.getTo(); JID from = packet.getFrom();
JID to = packet.getTo();
if (from != null && to != null && processed && incoming) { if (from != null && to != null && processed && incoming) {
if (from.toString().contains(_subdomain) || to.toString().contains(_subdomain)) { if (from.toString().contains(_subdomain) || to.toString().contains(_subdomain)) {
/* /*
* Spectrum sends a Ping to itself through the server to check * Spectrum sends a Ping to itself through the server to
* if the server is alive. We ignore that for statistics * check if the server is alive. We ignore that for
*/ * statistics
if (to.toString().equals(from.toString()) && to.toString().equals(_subdomain)) */
return; if (to.toString().equals(from.toString()) && to.toString().equals(_subdomain))
String type = packet.getClass().getName(); return;
_db.addNewLogEntry(_subdomain, type, from.toString(), to.toString()); String type = packet.getClass().getName();
_db.addNewLogEntry(_subdomain, type, from.toString(), to.toString());
}
} }
} catch (IllegalArgumentException e) {
// Log.warn("There was an illegal JID while writing gojara gateway statistics! "+e.getMessage());
// TODO: IF there are packages with an invalid from or to jid like
// to="@somehost.com" Tinder will throw an exception. We cannot
// prevent that, because we want to know if there is a from and to
// jid.
} }
} }
} }
...@@ -7,7 +7,6 @@ import org.jivesoftware.openfire.XMPPServer; ...@@ -7,7 +7,6 @@ import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.interceptor.PacketInterceptor; import org.jivesoftware.openfire.interceptor.PacketInterceptor;
import org.jivesoftware.openfire.interceptor.PacketRejectedException; import org.jivesoftware.openfire.interceptor.PacketRejectedException;
import org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.processors.AbstractRemoteRosterProcessor; import org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.processors.AbstractRemoteRosterProcessor;
import org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.processors.CleanUpRosterProcessor;
import org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.processors.ClientToComponentUpdateProcessor; import org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.processors.ClientToComponentUpdateProcessor;
import org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.processors.DiscoIQRegisteredProcessor; import org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.processors.DiscoIQRegisteredProcessor;
import org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.processors.NonPersistantRosterProcessor; import org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.processors.NonPersistantRosterProcessor;
...@@ -83,7 +82,6 @@ public class RemoteRosterInterceptor implements PacketInterceptor { ...@@ -83,7 +82,6 @@ public class RemoteRosterInterceptor implements PacketInterceptor {
return; return;
} }
@SuppressWarnings("unused")
String from = myPacket.getFrom().toString(); String from = myPacket.getFrom().toString();
String to = myPacket.getTo().toString(); String to = myPacket.getTo().toString();
......
package org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.processors; package org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.processors;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.List; import java.util.List;
import org.dom4j.Element;
import org.dom4j.Node; import org.dom4j.Node;
import org.dom4j.tree.DefaultElement;
import org.jivesoftware.openfire.SharedGroupException; import org.jivesoftware.openfire.SharedGroupException;
import org.jivesoftware.openfire.interceptor.PacketRejectedException; import org.jivesoftware.openfire.interceptor.PacketRejectedException;
import org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.RemoteRosterInterceptor; import org.jivesoftware.openfire.plugin.gojara.messagefilter.remoteroster.RemoteRosterInterceptor;
......
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