Commit ce12967c authored by Guus der Kinderen's avatar Guus der Kinderen Committed by akrherz

OF-1327: A list of JIDs cannot contain a String.

parent 986f402c
...@@ -16,9 +16,11 @@ ...@@ -16,9 +16,11 @@
package org.jivesoftware.openfire.auth; package org.jivesoftware.openfire.auth;
import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.admin.AdminManager; import org.jivesoftware.openfire.admin.AdminManager;
import org.jivesoftware.util.ClassUtils; import org.jivesoftware.util.ClassUtils;
import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.JiveGlobals;
import org.xmpp.packet.JID;
import java.util.SortedSet; import java.util.SortedSet;
import java.util.TreeSet; import java.util.TreeSet;
...@@ -98,7 +100,8 @@ public class AuthorizationBasedAuthProviderMapper implements AuthProviderMapper ...@@ -98,7 +100,8 @@ public class AuthorizationBasedAuthProviderMapper implements AuthProviderMapper
public AuthProvider getAuthProvider( String username ) public AuthProvider getAuthProvider( String username )
{ {
// TODO add optional caching, to prevent retrieving the administrative users upon every invocation. // TODO add optional caching, to prevent retrieving the administrative users upon every invocation.
final boolean isAdmin = AdminManager.getAdminProvider().getAdmins().contains( username ); final JID jid = XMPPServer.getInstance().createJID( username, null );
final boolean isAdmin = AdminManager.getAdminProvider().getAdmins().contains( jid );
if ( isAdmin ) if ( isAdmin )
{ {
......
...@@ -16,8 +16,10 @@ ...@@ -16,8 +16,10 @@
package org.jivesoftware.openfire.user; package org.jivesoftware.openfire.user;
import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.admin.AdminManager; import org.jivesoftware.openfire.admin.AdminManager;
import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.JiveGlobals;
import org.xmpp.packet.JID;
import java.util.SortedSet; import java.util.SortedSet;
import java.util.TreeSet; import java.util.TreeSet;
...@@ -86,7 +88,8 @@ public class AuthorizationBasedUserProviderMapper implements UserProviderMapper ...@@ -86,7 +88,8 @@ public class AuthorizationBasedUserProviderMapper implements UserProviderMapper
public UserProvider getUserProvider( String username ) public UserProvider getUserProvider( String username )
{ {
// TODO add optional caching, to prevent retrieving the administrative users upon every invocation. // TODO add optional caching, to prevent retrieving the administrative users upon every invocation.
final boolean isAdmin = AdminManager.getAdminProvider().getAdmins().contains( username ); final JID jid = XMPPServer.getInstance().createJID( username, null );
final boolean isAdmin = AdminManager.getAdminProvider().getAdmins().contains( jid );
if ( isAdmin ) if ( isAdmin )
{ {
......
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