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

GoJara 1.2.4 fixed access control bug

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13504 b35dd754-fafc-0310-a699-88a17e54d16e
parent 771cac88
......@@ -44,6 +44,12 @@
GoJara Plugin Changelog
</h1>
<p><b>1.2.4</b> -- Feb 21, 2013</p>
<ul>
<li>Fixed access control when server hostname and xmpp domain are not the same</li>
</ul>
<p><b>1.2.3</b> -- Feb 16, 2013</p>
<ul>
......
......@@ -7,7 +7,7 @@
<name>GoJara</name>
<description>ProtoXEP-xxxx: Remote Roster Management support</description>
<author>Holger Bergunde and Daniel Henninger</author>
<version>1.2.3</version>
<version>1.2.4</version>
<date>02/16/2013</date>
<databaseKey>gojara</databaseKey>
<databaseVersion>0</databaseVersion>
......
......@@ -27,13 +27,13 @@ public class DiscoPackageInterceptorHandler implements PacketInterceptor {
private PermissionManager _permissions;
private String _subDomain;
private String _host;
private String _serverDomain;
public DiscoPackageInterceptorHandler(String subdomain) {
_permissions = new PermissionManager();
_subDomain = subdomain;
XMPPServer server = XMPPServer.getInstance();
_host = server.getServerInfo().getHostname();
_serverDomain = server.getServerInfo().getXMPPDomain();
}
public void interceptPacket(Packet packet, Session session, boolean incoming, boolean processed)
......@@ -48,7 +48,7 @@ public class DiscoPackageInterceptorHandler implements PacketInterceptor {
String ns = root.getNamespaceURI();
if (ns.equals("http://jabber.org/protocol/disco#items") && iqpacket.getType().equals(IQ.Type.result)) {
if (!_permissions.allowedForUser(_subDomain, iqpacket.getTo())) {
if (iqpacket.getFrom().toString().equals(_host)) {
if (iqpacket.getFrom().toString().equals(_serverDomain)) {
List<Node> nodes = XpathHelper.findNodesInDocument(root.getDocument(), "//discoitems:item");
for (Node node : nodes) {
if (node.valueOf("@jid").equals(_subDomain)) {
......
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