Project

General

Profile

metacat / lib / style / skins / dataone / account.jsp @ 7751

1
<%@page import="org.dataone.client.auth.CertificateManager"%>
2
<%@page import="java.security.PrivateKey"%>
3
<%@page import="java.security.cert.X509Certificate"%>
4
<%@page import="org.dataone.portal.PortalCertificateManager"%>
5
<%@ page language="java"%>
6
<%
7
	/**
8
	 *  '$RCSfile$'
9
	 *      Authors: Matt Jones
10
	 *    Copyright: 2008 Regents of the University of California and the
11
	 *               National Center for Ecological Analysis and Synthesis
12
	 *  For Details: http://www.nceas.ucsb.edu/
13
	 *
14
	 *   '$Author: leinfelder $'
15
	 *     '$Date: 2013-05-22 15:35:39 -0700 (Wed, 22 May 2013) $'
16
	 * '$Revision: 7751 $'
17
	 * 
18
	 * This is an HTML document for loading an xml document into Oracle
19
	 *
20
	 * This program is free software; you can redistribute it and/or modify
21
	 * it under the terms of the GNU General Public License as published by
22
	 * the Free Software Foundation; either version 2 of the License, or
23
	 * (at your option) any later version.
24
	 *
25
	 * This program is distributed in the hope that it will be useful,
26
	 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
	 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28
	 * GNU General Public License for more details.
29
	 *
30
	 * You should have received a copy of the GNU General Public License
31
	 * along with this program; if not, write to the Free Software
32
	 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
33
	 */
34
%>
35
<%@ include file="../../common/common-settings.jsp"%>
36
<%@ include file="../../common/configure-check.jsp"%>
37
<%
38
String certificateSubject = "(not logged in)";
39
//check for session-based certificate from the portal
40
String configurationFileName = application.getInitParameter("oa4mp:client.config.file");
41
String configurationFilePath = application.getRealPath(configurationFileName);
42
PortalCertificateManager portalManager = new PortalCertificateManager(configurationFilePath);
43
X509Certificate certificate = portalManager.getCertificate(request);
44
PrivateKey key = portalManager.getPrivateKey(request);
45
if (certificate != null && key != null) {
46
	certificateSubject = CertificateManager.getInstance().getSubjectDN(certificate);
47
}
48
%>
49
<html>
50
<head>
51
<title>Map legacy account to DataONE</title>
52

    
53
<link rel="stylesheet" type="text/css" href="<%=STYLE_COMMON_URL%>/jquery/jqueryui/css/smoothness/jquery-ui-1.8.6.custom.css">
54
<link rel="stylesheet" type="text/css" href="dataone.css" />	
55
<script language="javascript" type="text/javascript" src="<%=STYLE_COMMON_URL%>/jquery/jquery.js"></script>
56
<script language="javascript" type="text/javascript" src="<%=STYLE_COMMON_URL%>/jquery/jqueryui/js/jquery-ui-1.8.6.custom.min.js"></script>
57

    
58
</head>
59
<body onload="init()">
60
<!-- dataone logo header -->
61
<div class="logoheader">
62
	<h1></h1>
63
</div>
64

    
65
<p>
66
You are logged in as: <%=certificateSubject %>
67
</p>
68
<p>
69
<a href="<%=CONTEXT_URL%>/startRequest?target=<%=STYLE_SKINS_URL%>/dataone/account.jsp">Login or switch user...</a>
70
</p>
71

    
72
</body>
73
</html>