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

Refactoring wortk. JM-924

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6548 b35dd754-fafc-0310-a699-88a17e54d16e
parent 915f4967
...@@ -9,12 +9,13 @@ ...@@ -9,12 +9,13 @@
- a copy of which is included in this distribution. - a copy of which is included in this distribution.
--%> --%>
<%@ page import="org.jivesoftware.util.*, <%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.wildfire.*, org.jivesoftware.util.ParamUtils,
java.text.NumberFormat, org.jivesoftware.wildfire.SessionManager,
org.jivesoftware.wildfire.component.ComponentSession" org.jivesoftware.wildfire.session.ComponentSession"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
<%@ page import="java.text.NumberFormat" %>
<%@ 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" %>
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<%@ page import="org.jivesoftware.util.JiveGlobals, <%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.util.ParamUtils, org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.Session,
org.jivesoftware.wildfire.SessionManager, org.jivesoftware.wildfire.SessionManager,
org.jivesoftware.wildfire.component.ComponentSession, org.jivesoftware.wildfire.session.ComponentSession,
org.jivesoftware.wildfire.session.Session,
java.net.URLEncoder" java.net.URLEncoder"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
...@@ -32,11 +32,12 @@ ...@@ -32,11 +32,12 @@
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" /> <jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" />
<% admin.init(request, response, session, application, out ); %> <% admin.init(request, response, session, application, out ); %>
<% // Get parameters <% // Get parameters
int start = ParamUtils.getIntParameter(request,"start",0); int start = ParamUtils.getIntParameter(request, "start", 0);
int range = ParamUtils.getIntParameter(request,"range",admin.getRowsPerPage("component-session-summary", DEFAULT_RANGE)); int range = ParamUtils
boolean close = ParamUtils.getBooleanParameter(request,"close"); .getIntParameter(request, "range", admin.getRowsPerPage("component-session-summary", DEFAULT_RANGE));
String jid = ParamUtils.getParameter(request,"jid"); boolean close = ParamUtils.getBooleanParameter(request, "close");
String jid = ParamUtils.getParameter(request, "jid");
if (request.getParameter("range") != null) { if (request.getParameter("range") != null) {
admin.setRowsPerPage("component-session-summary", range); admin.setRowsPerPage("component-session-summary", range);
...@@ -68,9 +69,9 @@ ...@@ -68,9 +69,9 @@
return; return;
} }
// paginator vars // paginator vars
int numPages = (int)Math.ceil((double)sessionCount/(double)range); int numPages = (int) Math.ceil((double) sessionCount / (double) range);
int curPage = (start/range) + 1; int curPage = (start / range) + 1;
int maxIndex = (start+range <= sessionCount ? start+range : sessionCount); int maxIndex = (start + range <= sessionCount ? start + range : sessionCount);
%> %>
<html> <html>
......
...@@ -9,11 +9,13 @@ ...@@ -9,11 +9,13 @@
- a copy of which is included in this distribution. - a copy of which is included in this distribution.
--%> --%>
<%@ page import="org.jivesoftware.util.*, <%@ page import="org.jivesoftware.util.JiveGlobals,
java.util.*, org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.*" org.jivesoftware.wildfire.Connection,
org.jivesoftware.wildfire.PrivateStorage"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
<%@ page import="org.jivesoftware.wildfire.session.ClientSession" %>
<%@ 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" %>
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
--%> --%>
<%@ page import="org.jivesoftware.util.ParamUtils, <%@ page import="org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.ClientSession,
org.jivesoftware.wildfire.handler.IQAuthHandler, org.jivesoftware.wildfire.handler.IQAuthHandler,
org.jivesoftware.wildfire.handler.IQRegisterHandler, org.jivesoftware.wildfire.handler.IQRegisterHandler,
org.jivesoftware.wildfire.session.ClientSession,
java.util.HashMap" java.util.HashMap"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
</head> </head>
<body> <body>
<% // Get parameters <% // Get parameters
boolean save = request.getParameter("save") != null; boolean save = request.getParameter("save") != null;
boolean inbandEnabled = ParamUtils.getBooleanParameter(request,"inbandEnabled"); boolean inbandEnabled = ParamUtils.getBooleanParameter(request, "inbandEnabled");
boolean canChangePassword = ParamUtils.getBooleanParameter(request,"canChangePassword"); boolean canChangePassword = ParamUtils.getBooleanParameter(request, "canChangePassword");
boolean anonLogin = ParamUtils.getBooleanParameter(request,"anonLogin"); boolean anonLogin = ParamUtils.getBooleanParameter(request, "anonLogin");
String allowedIPs = request.getParameter("allowedIPs"); String allowedIPs = request.getParameter("allowedIPs");
// Get an IQRegisterHandler: // Get an IQRegisterHandler:
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
Pattern pattern = Pattern.compile("(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.)" + Pattern pattern = Pattern.compile("(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.)" +
"(?:(?:\\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){2}" + "(?:(?:\\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){2}" +
"(?:\\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"); "(?:\\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)");
Map<String,String> newMap = new HashMap<String,String>(); Map<String, String> newMap = new HashMap<String, String>();
StringTokenizer tokens = new StringTokenizer(allowedIPs, ", "); StringTokenizer tokens = new StringTokenizer(allowedIPs, ", ");
while (tokens.hasMoreTokens()) { while (tokens.hasMoreTokens()) {
String address = tokens.nextToken().trim(); String address = tokens.nextToken().trim();
...@@ -68,12 +68,12 @@ ...@@ -68,12 +68,12 @@
anonLogin = authHandler.isAnonymousAllowed(); anonLogin = authHandler.isAnonymousAllowed();
// Encode the allowed IP addresses // Encode the allowed IP addresses
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
Iterator<String> iter = ClientSession.getAllowedIPs().keySet().iterator(); Iterator<String> iter = org.jivesoftware.wildfire.session.ClientSession.getAllowedIPs().keySet().iterator();
if (iter.hasNext()) { if (iter.hasNext()) {
buf.append(iter.next()); buf.append(iter.next());
} }
while (iter.hasNext()) { while (iter.hasNext()) {
buf.append(", ").append((String)iter.next()); buf.append(", ").append((String) iter.next());
} }
allowedIPs = buf.toString(); allowedIPs = buf.toString();
%> %>
......
...@@ -8,14 +8,17 @@ ...@@ -8,14 +8,17 @@
- a copy of which is included in this distribution. - a copy of which is included in this distribution.
--%> --%>
<%@ page import="org.jivesoftware.util.*, <%@ page import="org.jivesoftware.util.JiveGlobals,
java.util.*, org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.*, org.jivesoftware.wildfire.SessionManager,
java.text.NumberFormat, org.jivesoftware.wildfire.session.IncomingServerSession,
org.jivesoftware.wildfire.server.IncomingServerSession, org.jivesoftware.wildfire.session.OutgoingServerSession,
org.jivesoftware.wildfire.server.OutgoingServerSession" java.text.NumberFormat"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
<%@ page import="java.util.Calendar" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.List" %>
<%@ 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" %>
...@@ -23,7 +26,7 @@ ...@@ -23,7 +26,7 @@
<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" /> <jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<% webManager.init(request, response, session, application, out ); %> <% webManager.init(request, response, session, application, out ); %>
<% // Get parameters <% // Get parameters
String hostname = ParamUtils.getParameter(request, "hostname"); String hostname = ParamUtils.getParameter(request, "hostname");
// Handle a "go back" click: // Handle a "go back" click:
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
--%> --%>
<%@ page import="org.jivesoftware.util.JiveGlobals, <%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.wildfire.server.IncomingServerSession, org.jivesoftware.wildfire.session.IncomingServerSession,
java.net.URLEncoder, java.net.URLEncoder,
java.util.Calendar, java.util.Calendar,
java.util.Date"%> java.util.Date"%>
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
- * 'count', an int representing the row number we're on. - * 'count', an int representing the row number we're on.
--%> --%>
<% // Show the secured icon only if ALL sessions are secure <% // Show the secured icon only if ALL sessions are secure
boolean isSecured = true; boolean isSecured = true;
// Check if all incoming sessions are secured // Check if all incoming sessions are secured
for (IncomingServerSession inSession : inSessions) { for (org.jivesoftware.wildfire.session.IncomingServerSession inSession : inSessions) {
if (!inSession.getConnection().isSecure()) { if (!inSession.getConnection().isSecure()) {
isSecured = false; isSecured = false;
break; break;
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
--%> --%>
<%@ page import="org.jivesoftware.util.ParamUtils, <%@ page import="org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.Session,
org.jivesoftware.wildfire.SessionManager, org.jivesoftware.wildfire.SessionManager,
org.jivesoftware.wildfire.server.OutgoingServerSession, org.jivesoftware.wildfire.session.OutgoingServerSession,
org.jivesoftware.wildfire.session.Session,
java.util.*" java.util.*"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
<% } %> <% } %>
<% int count = 0; <% int count = 0;
hostnames = new ArrayList<String>(hostnames).subList(start, maxIndex); hostnames = new ArrayList<String>(hostnames).subList(start, maxIndex);
for (String host : hostnames) { for (String host : hostnames) {
count++; count++;
......
...@@ -10,16 +10,15 @@ ...@@ -10,16 +10,15 @@
<%@ page import="org.jivesoftware.util.JiveGlobals, <%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.util.ParamUtils, org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.ClientSession,
org.jivesoftware.wildfire.PresenceManager, org.jivesoftware.wildfire.PresenceManager,
org.jivesoftware.wildfire.SessionManager, org.jivesoftware.wildfire.SessionManager,
org.jivesoftware.wildfire.session.ClientSession,
org.jivesoftware.wildfire.user.User, org.jivesoftware.wildfire.user.User,
org.jivesoftware.wildfire.user.UserManager, org.jivesoftware.wildfire.user.UserManager,
org.xmpp.packet.JID, java.text.NumberFormat,
java.text.NumberFormat" java.util.Collection"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
<%@ page import="java.util.Collection"%>
<%@ 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" %>
...@@ -27,7 +26,7 @@ ...@@ -27,7 +26,7 @@
<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" /> <jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<% webManager.init(request, response, session, application, out ); %> <% webManager.init(request, response, session, application, out ); %>
<% // Get parameters <% // Get parameters
String jid = ParamUtils.getParameter(request, "jid"); String jid = ParamUtils.getParameter(request, "jid");
// Handle a "go back" click: // Handle a "go back" click:
...@@ -39,7 +38,7 @@ ...@@ -39,7 +38,7 @@
// Get the session & address objects // Get the session & address objects
SessionManager sessionManager = webManager.getSessionManager(); SessionManager sessionManager = webManager.getSessionManager();
JID address = new JID(jid); JID address = new JID(jid);
ClientSession currentSess = sessionManager.getSession(address); org.jivesoftware.wildfire.session.ClientSession currentSess = sessionManager.getSession(address);
boolean isAnonymous = !UserManager.getInstance().isRegisteredUser(address); boolean isAnonymous = !UserManager.getInstance().isRegisteredUser(address);
// Get a presence manager // Get a presence manager
......
...@@ -3,20 +3,21 @@ ...@@ -3,20 +3,21 @@
- $Date$ - $Date$
--%> --%>
<%@ page import="org.jivesoftware.wildfire.Session, <%@ page import="org.jivesoftware.util.LocaleUtils,
org.xmpp.packet.Presence, org.jivesoftware.util.StringUtils,
java.net.URLEncoder, org.jivesoftware.wildfire.session.Session,
org.jivesoftware.util.LocaleUtils, org.xmpp.packet.JID,
org.jivesoftware.util.StringUtils"%><%@ page import="org.xmpp.packet.JID"%> org.xmpp.packet.Presence"%>
<%@ page import="java.net.URLEncoder"%>
<%--
- This page is meant to be included in other pages. It assumes 2 variables: <%--
- * 'sess', a org.jivesoftware.xmpp.Session object - This page is meant to be included in other pages. It assumes 2 variables:
- * 'count', an int representing the row number we're on. - * 'sess', a org.jivesoftware.xmpp.Session object
- * 'current', a boolean which indicates the current row the user is looking (pass in - * 'count', an int representing the row number we're on.
- false if there is no current row. - * 'current', a boolean which indicates the current row the user is looking (pass in
- * 'linkURL', a String representing the JSP page to link to - false if there is no current row.
--%> - * 'linkURL', a String representing the JSP page to link to
--%>
<% if (current) { %> <% if (current) { %>
...@@ -51,7 +52,7 @@ ...@@ -51,7 +52,7 @@
<fmt:message key="session.details.streaming" /> <fmt:message key="session.details.streaming" />
<% } else if (_status == Session.STATUS_AUTHENTICATED) { %> <% } else if (_status == org.jivesoftware.wildfire.session.Session.STATUS_AUTHENTICATED) { %>
<fmt:message key="session.details.authenticated" /> <fmt:message key="session.details.authenticated" />
......
...@@ -8,13 +8,15 @@ ...@@ -8,13 +8,15 @@
- a copy of which is included in this distribution. - a copy of which is included in this distribution.
--%> --%>
<%@ page import="org.jivesoftware.util.*, <%@ page import="org.jivesoftware.util.JiveGlobals,
java.util.*, org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.*, org.jivesoftware.wildfire.SessionManager,
java.util.Date, org.jivesoftware.wildfire.SessionResultFilter,
org.xmpp.packet.JID" org.jivesoftware.wildfire.session.ClientSession,
java.util.Collection"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
<%@ page import="java.util.Date" %>
<%@ 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" %>
...@@ -159,13 +161,13 @@ ...@@ -159,13 +161,13 @@
</table> </table>
<br> <br>
<% // Get the iterator of sessions, print out session info if any exist. <% // Get the iterator of sessions, print out session info if any exist.
SessionResultFilter filter = SessionResultFilter.createDefaultSessionFilter(); SessionResultFilter filter = SessionResultFilter.createDefaultSessionFilter();
filter.setSortOrder(order); filter.setSortOrder(order);
filter.setStartIndex(start); filter.setStartIndex(start);
filter.setNumResults(range); filter.setNumResults(range);
Collection<ClientSession> sessions = sessionManager.getSessions(filter); Collection<org.jivesoftware.wildfire.session.ClientSession> sessions = sessionManager.getSessions(filter);
%> %>
<div class="jive-table"> <div class="jive-table">
<table cellpadding="0" cellspacing="0" border="0" width="100%"> <table cellpadding="0" cellspacing="0" border="0" width="100%">
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
<%@ page import="org.jivesoftware.util.JiveGlobals, <%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.util.ParamUtils, org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.ClientSession,
org.jivesoftware.wildfire.Connection, org.jivesoftware.wildfire.Connection,
org.jivesoftware.wildfire.ConnectionManager, org.jivesoftware.wildfire.ConnectionManager,
org.jivesoftware.wildfire.XMPPServer" org.jivesoftware.wildfire.XMPPServer,
org.jivesoftware.wildfire.session.ClientSession"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
...@@ -21,15 +21,15 @@ ...@@ -21,15 +21,15 @@
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<% try { %> <% try { %>
<% // Get parameters: <% // Get parameters:
boolean update = request.getParameter("update") != null; boolean update = request.getParameter("update") != null;
boolean success = ParamUtils.getBooleanParameter(request, "success"); boolean success = ParamUtils.getBooleanParameter(request, "success");
// Client configuration parameters // Client configuration parameters
String clientSecurityRequired = ParamUtils.getParameter(request,"clientSecurityRequired"); String clientSecurityRequired = ParamUtils.getParameter(request, "clientSecurityRequired");
String ssl = ParamUtils.getParameter(request, "ssl"); String ssl = ParamUtils.getParameter(request, "ssl");
String tls = ParamUtils.getParameter(request, "tls"); String tls = ParamUtils.getParameter(request, "tls");
// Server configuration parameters // Server configuration parameters
String serverSecurityRequired = ParamUtils.getParameter(request,"serverSecurityRequired"); String serverSecurityRequired = ParamUtils.getParameter(request, "serverSecurityRequired");
String dialback = ParamUtils.getParameter(request, "dialback"); String dialback = ParamUtils.getParameter(request, "dialback");
String server_tls = ParamUtils.getParameter(request, "server_tls"); String server_tls = ParamUtils.getParameter(request, "server_tls");
...@@ -42,8 +42,7 @@ ...@@ -42,8 +42,7 @@
ClientSession.setTLSPolicy(Connection.TLSPolicy.required); ClientSession.setTLSPolicy(Connection.TLSPolicy.required);
// Enable 5223 port (old SSL port) // Enable 5223 port (old SSL port)
XMPPServer.getInstance().getConnectionManager().enableClientSSLListener(true); XMPPServer.getInstance().getConnectionManager().enableClientSSLListener(true);
} } else if ("notreq".equals(clientSecurityRequired)) {
else if ("notreq".equals(clientSecurityRequired)) {
// User selected that security is NOT required // User selected that security is NOT required
// Enable 5222 port and make TLS optional // Enable 5222 port and make TLS optional
...@@ -51,8 +50,7 @@ ...@@ -51,8 +50,7 @@
ClientSession.setTLSPolicy(Connection.TLSPolicy.optional); ClientSession.setTLSPolicy(Connection.TLSPolicy.optional);
// Enable 5223 port (old SSL port) // Enable 5223 port (old SSL port)
XMPPServer.getInstance().getConnectionManager().enableClientSSLListener(true); XMPPServer.getInstance().getConnectionManager().enableClientSSLListener(true);
} } else if ("custom".equals(clientSecurityRequired)) {
else if ("custom".equals(clientSecurityRequired)) {
// User selected custom client authentication // User selected custom client authentication
// Enable or disable 5223 port (old SSL port) // Enable or disable 5223 port (old SSL port)
...@@ -62,11 +60,9 @@ ...@@ -62,11 +60,9 @@
XMPPServer.getInstance().getConnectionManager().enableClientListener(true); XMPPServer.getInstance().getConnectionManager().enableClientListener(true);
if ("notavailable".equals(tls)) { if ("notavailable".equals(tls)) {
ClientSession.setTLSPolicy(Connection.TLSPolicy.disabled); ClientSession.setTLSPolicy(Connection.TLSPolicy.disabled);
} } else if ("optional".equals(tls)) {
else if ("optional".equals(tls)) {
ClientSession.setTLSPolicy(Connection.TLSPolicy.optional); ClientSession.setTLSPolicy(Connection.TLSPolicy.optional);
} } else {
else {
ClientSession.setTLSPolicy(Connection.TLSPolicy.required); ClientSession.setTLSPolicy(Connection.TLSPolicy.required);
} }
} }
...@@ -78,16 +74,14 @@ ...@@ -78,16 +74,14 @@
XMPPServer.getInstance().getConnectionManager().enableServerListener(true); XMPPServer.getInstance().getConnectionManager().enableServerListener(true);
JiveGlobals.setProperty("xmpp.server.tls.enabled", "true"); JiveGlobals.setProperty("xmpp.server.tls.enabled", "true");
JiveGlobals.setProperty("xmpp.server.dialback.enabled", "false"); JiveGlobals.setProperty("xmpp.server.dialback.enabled", "false");
} } else if ("notreq".equals(serverSecurityRequired)) {
else if ("notreq".equals(serverSecurityRequired)) {
// User selected that security for s2s is NOT required // User selected that security for s2s is NOT required
// Enable TLS and enable server dialback // Enable TLS and enable server dialback
XMPPServer.getInstance().getConnectionManager().enableServerListener(true); XMPPServer.getInstance().getConnectionManager().enableServerListener(true);
JiveGlobals.setProperty("xmpp.server.tls.enabled", "true"); JiveGlobals.setProperty("xmpp.server.tls.enabled", "true");
JiveGlobals.setProperty("xmpp.server.dialback.enabled", "true"); JiveGlobals.setProperty("xmpp.server.dialback.enabled", "true");
} } else if ("custom".equals(serverSecurityRequired)) {
else if ("custom".equals(serverSecurityRequired)) {
// User selected custom server authentication // User selected custom server authentication
boolean dialbackEnabled = "available".equals(dialback); boolean dialbackEnabled = "available".equals(dialback);
...@@ -101,8 +95,7 @@ ...@@ -101,8 +95,7 @@
// Enable or disable TLS for s2s connections // Enable or disable TLS for s2s connections
JiveGlobals.setProperty("xmpp.server.tls.enabled", tlsEnabled ? "true" : "false"); JiveGlobals.setProperty("xmpp.server.tls.enabled", tlsEnabled ? "true" : "false");
} } else {
else {
XMPPServer.getInstance().getConnectionManager().enableServerListener(false); XMPPServer.getInstance().getConnectionManager().enableServerListener(false);
// Disable server dialback // Disable server dialback
JiveGlobals.setProperty("xmpp.server.dialback.enabled", "false"); JiveGlobals.setProperty("xmpp.server.dialback.enabled", "false");
...@@ -117,26 +110,24 @@ ...@@ -117,26 +110,24 @@
// Set page vars // Set page vars
ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager(); ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
if (connectionManager.isClientListenerEnabled() && connectionManager.isClientSSLListenerEnabled()) { if (connectionManager.isClientListenerEnabled() && connectionManager.isClientSSLListenerEnabled()) {
if (Connection.TLSPolicy.required.equals(ClientSession.getTLSPolicy())) { if (Connection.TLSPolicy.required.equals(org.jivesoftware.wildfire.session.ClientSession.getTLSPolicy())) {
clientSecurityRequired = "req"; clientSecurityRequired = "req";
ssl = "available"; ssl = "available";
tls = "required"; tls = "required";
} } else if (Connection.TLSPolicy.optional.equals(ClientSession.getTLSPolicy())) {
else if (Connection.TLSPolicy.optional.equals(ClientSession.getTLSPolicy())) {
clientSecurityRequired = "notreq"; clientSecurityRequired = "notreq";
ssl = "available"; ssl = "available";
tls = "optional"; tls = "optional";
} } else {
else {
clientSecurityRequired = "custom"; clientSecurityRequired = "custom";
ssl = "available"; ssl = "available";
tls = "notavailable"; tls = "notavailable";
} }
} } else {
else {
clientSecurityRequired = "custom"; clientSecurityRequired = "custom";
ssl = connectionManager.isClientSSLListenerEnabled() ? "available" : "notavailable"; ssl = connectionManager.isClientSSLListenerEnabled() ? "available" : "notavailable";
tls = Connection.TLSPolicy.disabled.equals(ClientSession.getTLSPolicy()) ? "notavailable" : ClientSession.getTLSPolicy().toString(); tls = Connection.TLSPolicy.disabled.equals(ClientSession.getTLSPolicy()) ? "notavailable" :
ClientSession.getTLSPolicy().toString();
} }
boolean tlsEnabled = JiveGlobals.getBooleanProperty("xmpp.server.tls.enabled", true); boolean tlsEnabled = JiveGlobals.getBooleanProperty("xmpp.server.tls.enabled", true);
...@@ -146,14 +137,12 @@ ...@@ -146,14 +137,12 @@
serverSecurityRequired = "notreq"; serverSecurityRequired = "notreq";
dialback = "available"; dialback = "available";
server_tls = "optional"; server_tls = "optional";
} } else {
else {
serverSecurityRequired = "req"; serverSecurityRequired = "req";
dialback = "notavailable"; dialback = "notavailable";
server_tls = "optional"; server_tls = "optional";
} }
} } else {
else {
serverSecurityRequired = "custom"; serverSecurityRequired = "custom";
dialback = dialbackEnabled ? "available" : "notavailable"; dialback = dialbackEnabled ? "available" : "notavailable";
server_tls = "notavailable"; server_tls = "notavailable";
......
<%-- <%--
- $Revision$ - $Revision$
- $Date$ - $Date$
...@@ -8,17 +9,19 @@ ...@@ -8,17 +9,19 @@
- a copy of which is included in this distribution. - a copy of which is included in this distribution.
--%> --%>
<%@ page import="org.jivesoftware.util.*, <%@ page import="org.jivesoftware.util.ParamUtils,
java.util.*, org.jivesoftware.wildfire.SessionManager,
org.jivesoftware.wildfire.*, org.jivesoftware.wildfire.session.ClientSession,
org.jivesoftware.admin.*, org.jivesoftware.wildfire.session.Session,
java.util.HashMap, org.jivesoftware.wildfire.user.User,
org.jivesoftware.wildfire.user.*,
java.util.Map,
org.xmpp.packet.JID, org.xmpp.packet.JID,
java.net.URLEncoder" java.net.URLEncoder,
java.util.Collection,
java.util.HashMap,
java.util.Iterator"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
<%@ page import="java.util.Map" %>
<%@ 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" %>
......
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