Commit f71a0c1f authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Refactoring work.

git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@3008 b35dd754-fafc-0310-a699-88a17e54d16e
parent 279d2544
...@@ -8,11 +8,12 @@ ...@@ -8,11 +8,12 @@
org.jivesoftware.messenger.auth.AuthToken, org.jivesoftware.messenger.auth.AuthToken,
org.jivesoftware.messenger.auth.AuthFactory, org.jivesoftware.messenger.auth.AuthFactory,
org.jivesoftware.messenger.auth.UnauthorizedException, org.jivesoftware.messenger.auth.UnauthorizedException,
org.jivesoftware.admin.AdminConsole, org.jivesoftware.admin.AdminConsole"
org.jivesoftware.util.JiveGlobals"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
<%@ page import="org.jivesoftware.util.*"%> <%@ page import="org.jivesoftware.util.*"%>
<%@ page import="org.jivesoftware.messenger.XMPPServer"%>
<%@ page import="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" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
...@@ -22,17 +23,12 @@ ...@@ -22,17 +23,12 @@
<% admin.init(request, response, session, application, out ); %> <% admin.init(request, response, session, application, out ); %>
<%! // List of allowed usernames: <%! // List of allowed usernames:
static Map authorizedUsernames = null; static Map authorizedUsernames = new HashMap();
static String authorizedUsernameProp = JiveGlobals.getXMLProperty("adminConsole.authorizedUsernames");
static { static {
if (authorizedUsernameProp != null) { for (JID jid : XMPPServer.getInstance().getAdmins()) {
StringTokenizer tokenizer = new StringTokenizer(authorizedUsernameProp, ","); // Only allow local users to log into the admin console
while (tokenizer.hasMoreTokens()) { if (XMPPServer.getInstance().isLocal(jid)) {
if (authorizedUsernames == null) { authorizedUsernames.put(jid.getNode(), jid.getNode());
authorizedUsernames = new HashMap();
}
String tok = tokenizer.nextToken().trim();
authorizedUsernames.put(tok, tok);
} }
} }
} }
......
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