NameRegistration.jsp revision 9460c7a63d515c2c57bcb516c956a024c2b56c33
567N/A<%--
567N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
567N/A
567N/A Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
567N/A
567N/A The contents of this file are subject to the terms
567N/A of the Common Development and Distribution License
567N/A (the License). You may not use this file except in
567N/A compliance with the License.
567N/A
567N/A You can obtain a copy of the License at
567N/A https://opensso.dev.java.net/public/CDDLv1.0.html or
567N/A opensso/legal/CDDLv1.0.txt
567N/A See the License for the specific language governing
567N/A permission and limitations under the License.
567N/A
567N/A When distributing Covered Code, include this CDDL
567N/A Header Notice in each file and include the License file
873N/A at opensso/legal/CDDLv1.0.txt.
567N/A If applicable, add the following below the CDDL Header,
567N/A with the fields enclosed by brackets [] replaced by
567N/A your own identifying information:
567N/A "Portions Copyrighted [year] [name of copyright owner]"
567N/A
862N/A $Id: NameRegistration.jsp,v 1.4 2008/06/25 05:48:34 qcheng Exp $
567N/A
567N/A--%>
567N/A
567N/A<%@page language="java"
567N/Aimport="com.sun.liberty.LibertyManager, java.util.Set, java.util.Iterator"
567N/A%>
567N/A<%@include file="Header.jsp"%>
567N/A
567N/A<%
861N/A String providerAlias = request.getParameter(
861N/A LibertyManager.getMetaAliasKey());
861N/A String realm = LibertyManager.getRealmByMetaAlias(providerAlias);
567N/A String providerID = LibertyManager.getEntityID(providerAlias);
567N/A String providerRole = LibertyManager.getProviderRole(providerAlias);
861N/A String homeURL = LibertyManager.getHomeURL(realm, providerID, providerRole);
567N/A String preLoginURL = LibertyManager.getPreLoginServletURL(
567N/A realm, providerID, providerRole, request);
567N/A String actionLocation = LibertyManager.getNameRegistrationURL(
619N/A realm, providerID, providerRole, request);
619N/A String gotoUrl = HttpUtils.getRequestURL(request).toString()
567N/A + "?" + request.getQueryString();
619N/A String userDN = LibertyManager.getUser(request);
567N/A String nameRegistrationDonePageURL =
567N/A LibertyManager.getNameRegistrationDonePageURL(
567N/A realm, providerID, providerRole, request);
567N/A String dest = nameRegistrationDonePageURL + "&regStatus=cancel";
567N/A%>
567N/A
567N/A<script language="javascript">
567N/A function doCancel() {
567N/A location.href="<%=dest%>";
567N/A }
567N/A</script>
567N/A
567N/A<center>
567N/A<%
567N/A if (providerAlias == null || providerAlias.length() <= 0) {
567N/A response.sendError(response.SC_INTERNAL_SERVER_ERROR,
567N/A "Provider alias not found");
567N/A return;
567N/A } else if (providerID == null || providerID.length() <= 0) {
567N/A response.sendError(response.SC_INTERNAL_SERVER_ERROR,
567N/A "Provider not found");
567N/A return;
567N/A }
567N/A if (userDN == null) {
567N/A // redirect for authentication
567N/A char delimiter;
567N/A delimiter = preLoginURL.indexOf('?') < 0 ? '?' : '&';
567N/A response.sendRedirect(preLoginURL + delimiter + "goto=" +
567N/A java.net.URLEncoder.encode(gotoUrl));
567N/A return;
567N/A }
567N/A try {
567N/A Set providerList = LibertyManager.getRegisteredProviders(
567N/A userDN, realm, providerID, providerRole);
567N/A if (providerList != null && !providerList.isEmpty()) {
567N/A%>
567N/A
567N/A<form name="selectprovider" method="POST" action="<%= actionLocation%>">
567N/A<table cellpadding='0' cellspacing='3'>
567N/A<tr>
567N/A<td align="center">
567N/A <b>Please select a remote provider to register with: </b>
567N/A</td>
567N/A</tr>
567N/A<tr>
567N/A <td align="center">
567N/A <select name="<%=LibertyManager.getNameRegistrationProviderIDKey()%>"
567N/A size="1" >
567N/A<%
567N/A Iterator iterProvider = providerList.iterator();
567N/A while (iterProvider.hasNext()) {
567N/A String providerId = (String)iterProvider.next();
567N/A%>
567N/A <option value="<%=providerId%>"><%=providerId%></option>
567N/A<%
567N/A }
567N/A%>
567N/A </select>
567N/A </td>
567N/A</tr>
567N/A
567N/A</tr>
567N/A<tr>
567N/A <td align="center">
567N/A <p>
567N/A <br />
567N/A <input name="doIt" type="submit" value="submit">
567N/A <input name="button2" type="button" onClick='doCancel()' value="cancel">
567N/A </p>
567N/A </td>
567N/A</tr>
567N/A</table>
567N/A
567N/A<% } else { %>
619N/A <p><b>User has no active registrations.</b><p>
861N/A
861N/A <% if (homeURL == null) { %>
861N/A <a href="http://www.sun.com">Continue</a>
861N/A <% } else { %>
861N/A <a href="<%=homeURL%>">Continue</a>
861N/A <% } %>
861N/A </p>
861N/A<% }
861N/A
861N/A } catch(Exception ex){
619N/A response.sendRedirect(preLoginURL + "?goto=" +
861N/A java.net.URLEncoder.encode(gotoUrl));
861N/A return;
861N/A }
861N/A%>
861N/A</center>
861N/A<p>&nbsp</p>
861N/A<%@ include file="Footer.jsp"%>
861N/A
861N/A
861N/A
619N/A