showServerConfig.jsp revision 984ea967792540448d05fba2ac6fad5dadf91fd6
278N/A<%--
278N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
278N/A
278N/A Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
278N/A
278N/A The contents of this file are subject to the terms
278N/A of the Common Development and Distribution License
278N/A (the License). You may not use this file except in
278N/A compliance with the License.
278N/A
278N/A You can obtain a copy of the License at
278N/A https://opensso.dev.java.net/public/CDDLv1.0.html or
278N/A opensso/legal/CDDLv1.0.txt
278N/A See the License for the specific language governing
278N/A permission and limitations under the License.
278N/A
278N/A When distributing Covered Code, include this CDDL
278N/A Header Notice in each file and include the License file
278N/A at opensso/legal/CDDLv1.0.txt.
278N/A If applicable, add the following below the CDDL Header,
5680N/A with the fields enclosed by brackets [] replaced by
278N/A your own identifying information:
5680N/A "Portions Copyrighted [year] [name of copyright owner]"
5680N/A
5680N/A $Id: showServerConfig.jsp,v 1.11 2008/11/25 18:16:57 veiming Exp $
278N/A
278N/A--%>
278N/A
4786N/A<%--
618N/A Portions Copyrighted 2010 ForgeRock AS
844N/A--%>
4786N/A
4786N/A<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1258N/A
278N/A<%@ page import="com.iplanet.sso.SSOException" %>
4786N/A<%@ page import="com.iplanet.sso.SSOToken" %>
2899N/A<%@ page import="com.iplanet.sso.SSOTokenManager" %>
5680N/A<%@ page import="com.sun.identity.common.configuration.ServerConfiguration" %>
5680N/A<%@ page import="com.sun.identity.security.EncodeAction" %>
5680N/A<%@ page import="com.sun.identity.idm.IdConstants" %>
5680N/A<%@ page import="com.sun.identity.sm.SMSEntry" %>
278N/A<%@ page import="com.sun.identity.sm.ServiceConfig" %>
4786N/A<%@ page import="com.sun.identity.sm.ServiceConfigManager" %>
4786N/A<%@ page import="java.security.AccessController" %>
5721N/A<%@ page import="java.io.File" %>
4786N/A<%@ page import="java.net.URL" %>
278N/A<%@ page import="java.util.ResourceBundle" %>
278N/A<%@ page import="java.util.Properties" %>
278N/A<%@ page import="java.util.Enumeration" %>
278N/A<%@ page import="java.util.Set" %>
278N/A<%@ page import="java.util.StringTokenizer" %>
278N/A<%@ page import="java.util.Iterator" %>
278N/A<%@ page import="com.iplanet.am.util.SystemProperties" %>
278N/A
278N/A
278N/A<html xmlns="http://www.w3.org/1999/xhtml">
278N/A<head>
278N/A <title>OpenAM</title>
278N/A <link rel="stylesheet" type="text/css" href="com_sun_web_ui/css/css_ns6up.css" />
278N/A <link rel="shortcut icon" href="com_sun_web_ui/images/favicon/favicon.ico" type="image/x-icon" />
278N/A</head>
278N/A
278N/A<body class="DefBdy">
278N/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">
278N/A <table class="MstTblBot" title="" border="0" cellpadding="0" cellspacing="0" width="100%">
4786N/A <tr>
278N/A <td class="MstTdTtl" width="99%">
1845N/A <div class="MstDivTtl"><img name="AMConfig.configurator.ProdName" src="console/images/PrimaryProductName.png" alt="OpenAM" border="0" /></div>
5680N/A </td>
5680N/A <td class="MstTdLogo" width="1%"><img name="AMConfig.configurator.BrandLogo" src="com_sun_web_ui/images/other/javalogo.gif" alt="Java(TM) Logo" border="0" height="55" width="31" /></td>
5680N/A </tr>
1845N/A </table>
278N/A <table class="MstTblEnd" border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><img name="RMRealm.mhCommon.EndorserLogo" src="com_sun_web_ui/images/masthead/masthead-sunname.gif" alt="Sun(TM) Microsystems, Inc." align="right" border="0" height="10" width="108" /></td></tr></table>
4786N/A </div>
4786N/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>
4786N/A <table border="0" cellpadding="10" cellspacing="0" width="100%"><tr><td></td></tr></table>
4786N/A <table border="0" cellpadding="10" cellspacing="0" width="100%"><tr><td>
4786N/A
4786N/A<%
4786N/A try {
4786N/A SSOTokenManager manager = SSOTokenManager.getInstance();
4786N/A SSOToken ssoToken = manager.createSSOToken(request);
4786N/A manager.validateToken(ssoToken);
4786N/A String strURL = request.getRequestURL().toString();
4786N/A
4786N/A if (ssoToken.getPrincipal().getName().equals(
4786N/A "id=amadmin,ou=user," + SMSEntry.getRootSuffix())
4786N/A ) {
4786N/A out.println("<B>SYSTEM PROPERTIES</B>");
4786N/A %>
1938N/A <table border="1">
1938N/A <tr>
5721N/A <td>
3817N/A <%
3817N/A Properties propDef = ServerConfiguration.getDefaults(ssoToken);
3817N/A out.println("<B>OpenAM Version</B>");
4786N/A %>
</td>
<td>
<%
out.println(propDef.getProperty("com.iplanet.am.version"));
%>
</td>
</tr>
<tr>
<td>
<%
Properties prop = null;
try {
URL url = new URL(strURL);
int port = url.getPort();
String protocol = url.getProtocol();
String host = url.getHost();
String path = url.getPath();
if (port == -1) {
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(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(sctx.getServerInfo());
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Operating System</B>");
%>
</td>
<td>
<%
out.println(System.getProperty("os.name"));
out.println(" ");
out.println(System.getProperty("os.version"));
out.println(" ");
out.println(System.getProperty("os.arch"));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java Version</B>");
%>
</td>
<td>
<%
out.println(System.getProperty("java.version"));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Browser Version</B>");
%>
</td>
<td>
<%
out.println(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(System.getProperty("java.home"));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Server Names (Configuration->Sites and Servers)</B>");
%>
</td>
<td>
<%
out.println(ServerConfiguration.getServers(ssoToken));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Configuration Directory</B>");
%>
</td>
<td>
<%
out.println(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(dsname + " (" + subConfig.getSchemaID() + ")");
else
out.println(dsname + " (" + subConfig.getSchemaID() + "), ");
j++;
}
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java Runtime Name</B>");
%>
</td>
<td>
<%
out.println(System.getProperty("java.runtime.name"));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java VM Name</B>");
%>
</td>
<td>
<%
out.println(System.getProperty("java.vm.name"));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java VM Version</B>");
%>
</td>
<td>
<%
out.println(System.getProperty("java.vm.version"));
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java Arch Data Model</B>");
%>
</td>
<td>
<%
out.println(System.getProperty("sun.arch.data.model") + " bit");
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>System Locale</B>");
%>
</td>
<td>
<%
out.println(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(token + "\n");
}
%>
</td>
</tr>
<tr>
<td>
<%
out.println("<B>Java VM Vendor</B>");
%>
</td>
<td>
<%
out.println(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>");
} else {
out.println("<B>User does not have permission to access this page</B>");
}
} catch (SSOException e) {
response.sendRedirect("UI/Login?goto=../showServerConfig.jsp");
}
%>
</td></tr></table>
</body></html>