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 @@
- a copy of which is included in this distribution.
--%>
<%@ page import="org.jivesoftware.util.*,
org.jivesoftware.wildfire.*,
java.text.NumberFormat,
org.jivesoftware.wildfire.component.ComponentSession"
<%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.SessionManager,
org.jivesoftware.wildfire.session.ComponentSession"
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/fmt_rt" prefix="fmt" %>
......
......@@ -11,9 +11,9 @@
<%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.Session,
org.jivesoftware.wildfire.SessionManager,
org.jivesoftware.wildfire.component.ComponentSession,
org.jivesoftware.wildfire.session.ComponentSession,
org.jivesoftware.wildfire.session.Session,
java.net.URLEncoder"
errorPage="error.jsp"
%>
......@@ -33,10 +33,11 @@
<% admin.init(request, response, session, application, out ); %>
<% // Get parameters
int start = ParamUtils.getIntParameter(request,"start",0);
int range = ParamUtils.getIntParameter(request,"range",admin.getRowsPerPage("component-session-summary", DEFAULT_RANGE));
boolean close = ParamUtils.getBooleanParameter(request,"close");
String jid = ParamUtils.getParameter(request,"jid");
int start = ParamUtils.getIntParameter(request, "start", 0);
int range = ParamUtils
.getIntParameter(request, "range", admin.getRowsPerPage("component-session-summary", DEFAULT_RANGE));
boolean close = ParamUtils.getBooleanParameter(request, "close");
String jid = ParamUtils.getParameter(request, "jid");
if (request.getParameter("range") != null) {
admin.setRowsPerPage("component-session-summary", range);
......@@ -68,9 +69,9 @@
return;
}
// paginator vars
int numPages = (int)Math.ceil((double)sessionCount/(double)range);
int curPage = (start/range) + 1;
int maxIndex = (start+range <= sessionCount ? start+range : sessionCount);
int numPages = (int) Math.ceil((double) sessionCount / (double) range);
int curPage = (start / range) + 1;
int maxIndex = (start + range <= sessionCount ? start + range : sessionCount);
%>
<html>
......
......@@ -9,11 +9,13 @@
- a copy of which is included in this distribution.
--%>
<%@ page import="org.jivesoftware.util.*,
java.util.*,
org.jivesoftware.wildfire.*"
<%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.Connection,
org.jivesoftware.wildfire.PrivateStorage"
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/fmt_rt" prefix="fmt" %>
......
......@@ -9,9 +9,9 @@
--%>
<%@ page import="org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.ClientSession,
org.jivesoftware.wildfire.handler.IQAuthHandler,
org.jivesoftware.wildfire.handler.IQRegisterHandler,
org.jivesoftware.wildfire.session.ClientSession,
java.util.HashMap"
errorPage="error.jsp"
%>
......@@ -33,9 +33,9 @@
<% // Get parameters
boolean save = request.getParameter("save") != null;
boolean inbandEnabled = ParamUtils.getBooleanParameter(request,"inbandEnabled");
boolean canChangePassword = ParamUtils.getBooleanParameter(request,"canChangePassword");
boolean anonLogin = ParamUtils.getBooleanParameter(request,"anonLogin");
boolean inbandEnabled = ParamUtils.getBooleanParameter(request, "inbandEnabled");
boolean canChangePassword = ParamUtils.getBooleanParameter(request, "canChangePassword");
boolean anonLogin = ParamUtils.getBooleanParameter(request, "anonLogin");
String allowedIPs = request.getParameter("allowedIPs");
// Get an IQRegisterHandler:
......@@ -51,7 +51,7 @@
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]?)");
Map<String,String> newMap = new HashMap<String,String>();
Map<String, String> newMap = new HashMap<String, String>();
StringTokenizer tokens = new StringTokenizer(allowedIPs, ", ");
while (tokens.hasMoreTokens()) {
String address = tokens.nextToken().trim();
......@@ -68,12 +68,12 @@
anonLogin = authHandler.isAnonymousAllowed();
// Encode the allowed IP addresses
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()) {
buf.append(iter.next());
}
while (iter.hasNext()) {
buf.append(", ").append((String)iter.next());
buf.append(", ").append((String) iter.next());
}
allowedIPs = buf.toString();
%>
......
......@@ -8,14 +8,17 @@
- a copy of which is included in this distribution.
--%>
<%@ page import="org.jivesoftware.util.*,
java.util.*,
org.jivesoftware.wildfire.*,
java.text.NumberFormat,
org.jivesoftware.wildfire.server.IncomingServerSession,
org.jivesoftware.wildfire.server.OutgoingServerSession"
<%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.SessionManager,
org.jivesoftware.wildfire.session.IncomingServerSession,
org.jivesoftware.wildfire.session.OutgoingServerSession,
java.text.NumberFormat"
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/fmt_rt" prefix="fmt" %>
......
......@@ -4,7 +4,7 @@
--%>
<%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.wildfire.server.IncomingServerSession,
org.jivesoftware.wildfire.session.IncomingServerSession,
java.net.URLEncoder,
java.util.Calendar,
java.util.Date"%>
......@@ -20,7 +20,7 @@
<% // Show the secured icon only if ALL sessions are secure
boolean isSecured = true;
// Check if all incoming sessions are secured
for (IncomingServerSession inSession : inSessions) {
for (org.jivesoftware.wildfire.session.IncomingServerSession inSession : inSessions) {
if (!inSession.getConnection().isSecure()) {
isSecured = false;
break;
......
......@@ -9,9 +9,9 @@
--%>
<%@ page import="org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.Session,
org.jivesoftware.wildfire.SessionManager,
org.jivesoftware.wildfire.server.OutgoingServerSession,
org.jivesoftware.wildfire.session.OutgoingServerSession,
org.jivesoftware.wildfire.session.Session,
java.util.*"
errorPage="error.jsp"
%>
......
......@@ -10,16 +10,15 @@
<%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.ClientSession,
org.jivesoftware.wildfire.PresenceManager,
org.jivesoftware.wildfire.SessionManager,
org.jivesoftware.wildfire.session.ClientSession,
org.jivesoftware.wildfire.user.User,
org.jivesoftware.wildfire.user.UserManager,
org.xmpp.packet.JID,
java.text.NumberFormat"
java.text.NumberFormat,
java.util.Collection"
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/fmt_rt" prefix="fmt" %>
......@@ -39,7 +38,7 @@
// Get the session & address objects
SessionManager sessionManager = webManager.getSessionManager();
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);
// Get a presence manager
......
......@@ -3,20 +3,21 @@
- $Date$
--%>
<%@ page import="org.jivesoftware.wildfire.Session,
org.xmpp.packet.Presence,
java.net.URLEncoder,
org.jivesoftware.util.LocaleUtils,
org.jivesoftware.util.StringUtils"%><%@ page import="org.xmpp.packet.JID"%>
<%@ page import="org.jivesoftware.util.LocaleUtils,
org.jivesoftware.util.StringUtils,
org.jivesoftware.wildfire.session.Session,
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
- * 'count', an int representing the row number we're on.
- * 'current', a boolean which indicates the current row the user is looking (pass in
- false if there is no current row.
- * 'linkURL', a String representing the JSP page to link to
--%>
--%>
<% if (current) { %>
......@@ -51,7 +52,7 @@
<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" />
......
......@@ -8,13 +8,15 @@
- a copy of which is included in this distribution.
--%>
<%@ page import="org.jivesoftware.util.*,
java.util.*,
org.jivesoftware.wildfire.*,
java.util.Date,
org.xmpp.packet.JID"
<%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.SessionManager,
org.jivesoftware.wildfire.SessionResultFilter,
org.jivesoftware.wildfire.session.ClientSession,
java.util.Collection"
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/fmt_rt" prefix="fmt" %>
......@@ -164,8 +166,8 @@
filter.setSortOrder(order);
filter.setStartIndex(start);
filter.setNumResults(range);
Collection<ClientSession> sessions = sessionManager.getSessions(filter);
%>
Collection<org.jivesoftware.wildfire.session.ClientSession> sessions = sessionManager.getSessions(filter);
%>
<div class="jive-table">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
......
......@@ -10,10 +10,10 @@
<%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.ClientSession,
org.jivesoftware.wildfire.Connection,
org.jivesoftware.wildfire.ConnectionManager,
org.jivesoftware.wildfire.XMPPServer"
org.jivesoftware.wildfire.XMPPServer,
org.jivesoftware.wildfire.session.ClientSession"
errorPage="error.jsp"
%>
......@@ -25,11 +25,11 @@
boolean update = request.getParameter("update") != null;
boolean success = ParamUtils.getBooleanParameter(request, "success");
// Client configuration parameters
String clientSecurityRequired = ParamUtils.getParameter(request,"clientSecurityRequired");
String clientSecurityRequired = ParamUtils.getParameter(request, "clientSecurityRequired");
String ssl = ParamUtils.getParameter(request, "ssl");
String tls = ParamUtils.getParameter(request, "tls");
// Server configuration parameters
String serverSecurityRequired = ParamUtils.getParameter(request,"serverSecurityRequired");
String serverSecurityRequired = ParamUtils.getParameter(request, "serverSecurityRequired");
String dialback = ParamUtils.getParameter(request, "dialback");
String server_tls = ParamUtils.getParameter(request, "server_tls");
......@@ -42,8 +42,7 @@
ClientSession.setTLSPolicy(Connection.TLSPolicy.required);
// Enable 5223 port (old SSL port)
XMPPServer.getInstance().getConnectionManager().enableClientSSLListener(true);
}
else if ("notreq".equals(clientSecurityRequired)) {
} else if ("notreq".equals(clientSecurityRequired)) {
// User selected that security is NOT required
// Enable 5222 port and make TLS optional
......@@ -51,8 +50,7 @@
ClientSession.setTLSPolicy(Connection.TLSPolicy.optional);
// Enable 5223 port (old SSL port)
XMPPServer.getInstance().getConnectionManager().enableClientSSLListener(true);
}
else if ("custom".equals(clientSecurityRequired)) {
} else if ("custom".equals(clientSecurityRequired)) {
// User selected custom client authentication
// Enable or disable 5223 port (old SSL port)
......@@ -62,11 +60,9 @@
XMPPServer.getInstance().getConnectionManager().enableClientListener(true);
if ("notavailable".equals(tls)) {
ClientSession.setTLSPolicy(Connection.TLSPolicy.disabled);
}
else if ("optional".equals(tls)) {
} else if ("optional".equals(tls)) {
ClientSession.setTLSPolicy(Connection.TLSPolicy.optional);
}
else {
} else {
ClientSession.setTLSPolicy(Connection.TLSPolicy.required);
}
}
......@@ -78,16 +74,14 @@
XMPPServer.getInstance().getConnectionManager().enableServerListener(true);
JiveGlobals.setProperty("xmpp.server.tls.enabled", "true");
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
// Enable TLS and enable server dialback
XMPPServer.getInstance().getConnectionManager().enableServerListener(true);
JiveGlobals.setProperty("xmpp.server.tls.enabled", "true");
JiveGlobals.setProperty("xmpp.server.dialback.enabled", "true");
}
else if ("custom".equals(serverSecurityRequired)) {
} else if ("custom".equals(serverSecurityRequired)) {
// User selected custom server authentication
boolean dialbackEnabled = "available".equals(dialback);
......@@ -101,8 +95,7 @@
// Enable or disable TLS for s2s connections
JiveGlobals.setProperty("xmpp.server.tls.enabled", tlsEnabled ? "true" : "false");
}
else {
} else {
XMPPServer.getInstance().getConnectionManager().enableServerListener(false);
// Disable server dialback
JiveGlobals.setProperty("xmpp.server.dialback.enabled", "false");
......@@ -117,26 +110,24 @@
// Set page vars
ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
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";
ssl = "available";
tls = "required";
}
else if (Connection.TLSPolicy.optional.equals(ClientSession.getTLSPolicy())) {
} else if (Connection.TLSPolicy.optional.equals(ClientSession.getTLSPolicy())) {
clientSecurityRequired = "notreq";
ssl = "available";
tls = "optional";
}
else {
} else {
clientSecurityRequired = "custom";
ssl = "available";
tls = "notavailable";
}
}
else {
} else {
clientSecurityRequired = "custom";
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);
......@@ -146,14 +137,12 @@
serverSecurityRequired = "notreq";
dialback = "available";
server_tls = "optional";
}
else {
} else {
serverSecurityRequired = "req";
dialback = "notavailable";
server_tls = "optional";
}
}
else {
} else {
serverSecurityRequired = "custom";
dialback = dialbackEnabled ? "available" : "notavailable";
server_tls = "notavailable";
......
<%--
- $Revision$
- $Date$
......@@ -8,17 +9,19 @@
- a copy of which is included in this distribution.
--%>
<%@ page import="org.jivesoftware.util.*,
java.util.*,
org.jivesoftware.wildfire.*,
org.jivesoftware.admin.*,
java.util.HashMap,
org.jivesoftware.wildfire.user.*,
java.util.Map,
<%@ page import="org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.SessionManager,
org.jivesoftware.wildfire.session.ClientSession,
org.jivesoftware.wildfire.session.Session,
org.jivesoftware.wildfire.user.User,
org.xmpp.packet.JID,
java.net.URLEncoder"
java.net.URLEncoder,
java.util.Collection,
java.util.HashMap,
java.util.Iterator"
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/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