showServerConfig.jsp revision 47865bca6b632be56381a140939bdd446eec4514
3112N/A<%--
3112N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3112N/A
3112N/A Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
3112N/A
3112N/A The contents of this file are subject to the terms
3112N/A of the Common Development and Distribution License
3112N/A (the License). You may not use this file except in
3112N/A compliance with the License.
3112N/A
3112N/A You can obtain a copy of the License at
3112N/A https://opensso.dev.java.net/public/CDDLv1.0.html or
3112N/A opensso/legal/CDDLv1.0.txt
3112N/A See the License for the specific language governing
3112N/A permission and limitations under the License.
3112N/A
3112N/A When distributing Covered Code, include this CDDL
3112N/A Header Notice in each file and include the License file
3112N/A at opensso/legal/CDDLv1.0.txt.
3112N/A If applicable, add the following below the CDDL Header,
3112N/A with the fields enclosed by brackets [] replaced by
3112N/A your own identifying information:
3112N/A "Portions Copyrighted [year] [name of copyright owner]"
4251N/A
3112N/A $Id: showServerConfig.jsp,v 1.11 2008/11/25 18:16:57 veiming Exp $
4458N/A
4458N/A--%>
4458N/A
4458N/A<%--
3832N/A Portions copyright 2010-2014 ForgeRock AS.
3832N/A--%>
4458N/A
3832N/A<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3832N/A
4458N/A<%@ page import="com.iplanet.sso.SSOToken" %>
3832N/A<%@ page import="com.sun.identity.common.configuration.ServerConfiguration" %>
4714N/A<%@ page import="com.sun.identity.idm.IdConstants" %>
4458N/A<%@ page import="com.sun.identity.sm.ServiceConfig" %>
4714N/A<%@ page import="com.sun.identity.sm.ServiceConfigManager" %>
4251N/A<%@ page import="java.io.File" %>
4714N/A<%@ page import="java.net.URL" %>
4714N/A<%@ page import="java.util.Properties" %>
4251N/A<%@ page import="java.util.Set" %>
4616N/A<%@ page import="java.util.StringTokenizer" %>
3832N/A<%@ page import="java.util.Iterator" %>
4458N/A<%@ page import="org.owasp.esapi.ESAPI"%>
4458N/A
4458N/A
4458N/A<html xmlns="http://www.w3.org/1999/xhtml">
4458N/A<head>
4458N/A <title>OpenAM</title>
4458N/A <link rel="stylesheet" type="text/css" href="com_sun_web_ui/css/css_ns6up.css" />
4495N/A <link rel="shortcut icon" href="com_sun_web_ui/images/favicon/favicon.ico" type="image/x-icon" />
4495N/A</head>
4495N/A
4495N/A<body class="DefBdy">
4495N/A <div class="SkpMedGry1"><a href="#SkipAnchor3860"><img src="com_sun_web_ui/images/other/dot.gif" alt="Jump to End of Masthead" border="0" height="1" width="1" /></a></div><div class="MstDiv">
4495N/A <table class="MstTblBot" title="" border="0" cellpadding="0" cellspacing="0" width="100%">
4458N/A <tr>
4458N/A <td class="MstTdTtl">
4458N/A <div class="MstDivTtl"><img name="AMConfig.configurator.ProdName" src="com_sun_web_ui/images/PrimaryProductName.png" alt="OpenAM" border="0" /></div>
4458N/A </td>
4458N/A </tr>
4714N/A </table>
4714N/A </div>
4714N/A <table class="SkpMedGry1" border="0" cellpadding="5" cellspacing="0" width="100%"><tr><td><img src="com_sun_web_ui/images/other/dot.gif" alt="Jump to End of Masthead" border="0" height="1" width="1" /></a></td></tr></table>
4458N/A <table border="0" cellpadding="10" cellspacing="0" width="100%"><tr><td></td></tr></table>
4458N/A
4458N/A<%@ include file="/WEB-INF/jsp/admincheck.jsp" %>
4495N/A<%
4458N/A
4458N/A SSOToken ssoToken = requireAdminSSOToken(request, response, out, "showServerConfig.jsp");
4458N/A if (ssoToken == null) {
4458N/A%>
4458N/A</body></html>
4458N/A<%
4723N/A return;
4458N/A }
4458N/A
4458N/A%>
4458N/A <table border="0" cellpadding="10" cellspacing="0" width="100%"><tr><td>
4458N/A<%
4458N/A try {
4458N/A
880N/A String strURL = request.getRequestURL().toString();
4714N/A
4714N/A out.println("<B>SYSTEM PROPERTIES</B>");
4714N/A%>
4714N/A <table border="1">
3832N/A <tr>
4458N/A <td>
4754N/A<%
4458N/A Properties propDef = ServerConfiguration.getDefaults(ssoToken);
4458N/A out.println("<B>OpenAM Version</B>");
4458N/A%>
4458N/A </td>
4458N/A <td>
900N/A<%
4458N/A out.println(ESAPI.encoder().encodeForHTML(propDef.getProperty("com.iplanet.am.version")));
900N/A%>
927N/A </td>
900N/A </tr>
3832N/A <tr>
4495N/A <td>
4714N/A<%
4458N/A Properties prop = null;
4865N/A try {
4495N/A URL url = new URL(strURL);
4458N/A int port = url.getPort();
4716N/A String protocol = url.getProtocol();
4716N/A String host = url.getHost();
4495N/A String path = url.getPath();
4459N/A
4459N/A if (port == -1) {
4631N/A port = protocol.equals("https") ? 443 : 80;
}
int idx = path.indexOf("/showServerConfig.jsp");
if (idx != -1) {
path = path.substring(0, idx);
}
prop = ServerConfiguration.getServerInstance(ssoToken, protocol + "://" + host + ":" + port + path);
} catch (java.net.MalformedURLException e) {
//ignore
}
out.println("<B>Server Name</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(prop.getProperty("com.iplanet.am.server.protocol").trim() + "://" +
prop.getProperty("com.iplanet.am.server.host").trim() + ":" +
prop.getProperty("com.iplanet.am.server.port").trim() +
prop.getProperty("com.iplanet.am.services.deploymentDescriptor")));
%>
</td>
</tr>
<tr>
<td>
<%
ServletContext sctx = getServletConfig().getServletContext();
out.println("<B>Container</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(sctx.getServerInfo()));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Operating System</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(System.getProperty("os.name")));
out.println(" ");
out.println(ESAPI.encoder().encodeForHTML(System.getProperty("os.version")));
out.println(" ");
out.println(ESAPI.encoder().encodeForHTML(System.getProperty("os.arch")));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java Version</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(System.getProperty("java.version")));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Browser Version</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(request.getHeader("user-agent")));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Server Install Mode</B>");
%>
</td>
<td>
<%
if (!ServerConfiguration.isLegacy(ssoToken)) {
out.println("Realm");
} else {
out.println("Legacy");
}
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Service Management Configuration Datastore Type</B>");
%>
</td>
<td>
<%
String strConfigDir = prop.getProperty("com.iplanet.services.configpath");
boolean isEmbeddedDS = (new File(strConfigDir + "/opends")).exists();
if (isEmbeddedDS) {
out.println("Embedded");
} else {
out.println("Remote");
}
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java Home</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(System.getProperty("java.home")));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Server Names (Configuration->Sites and Servers)</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(ServerConfiguration.getServers(ssoToken).toString()));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Configuration Directory</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(strConfigDir));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>User management datastore names under root realm (Datastore plugin type)</B>");
%>
</td>
<td>
<%
ServiceConfigManager scm = new ServiceConfigManager(IdConstants.REPO_SERVICE, ssoToken);
ServiceConfig svcfg = scm.getOrganizationConfig("/", null);
Set dsSet = svcfg.getSubConfigNames();
int j = 1;
for (Iterator i = dsSet.iterator(); i.hasNext();) {
String dsname = (String)i.next();
ServiceConfig subConfig = svcfg.getSubConfig(dsname);
if (j == dsSet.size()) {
out.println(ESAPI.encoder().encodeForHTML(dsname + " (" + subConfig.getSchemaID() + ")"));
} else {
out.println(ESAPI.encoder().encodeForHTML(dsname + " (" + subConfig.getSchemaID() + "), "));
}
j++;
}
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java Runtime Name</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(System.getProperty("java.runtime.name")));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java VM Name</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(System.getProperty("java.vm.name")));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java VM Version</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(System.getProperty("java.vm.version")));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java Arch Data Model</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(System.getProperty("sun.arch.data.model")) + " bit");
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>System Locale</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(System.getProperty("user.language")));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java Classpath</B>");
%>
</td>
<td>
<%
String strCP = System.getProperty("java.class.path");
StringTokenizer st = new StringTokenizer(strCP, ":");
while (st.hasMoreTokens()) {
String token = st.nextToken();
out.println(ESAPI.encoder().encodeForHTML(token) + "\n");
}
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java VM Vendor</B>");
%>
</td>
<td>
<%
out.println(ESAPI.encoder().encodeForHTML(System.getProperty("java.vm.specification.vendor")));
%>
</td>
</tr>
</table>
<%
out.println("<br/>");
out.println("<a href=" + strURL + ">The data above is generated using the following url</a>");
} catch (SSOException ex) {
response.sendRedirect("UI/Login?goto=../showServerConfig.jsp");
}
%>
</td></tr></table>
</body></html>