ConfigureGoogleApps.jsp revision 9740fa737ef2ed9453ab46d145777dbbbf6a747b
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe The contents of this file are subject to the terms
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe of the Common Development and Distribution License
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe (the License). You may not use this file except in
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe compliance with the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe You can obtain a copy of the License at
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov https://opensso.dev.java.net/public/CDDLv1.0.html or
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov See the License for the specific language governing
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov permission and limitations under the License.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov When distributing Covered Code, include this CDDL
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe Header Notice in each file and include the License file
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe If applicable, add the following below the CDDL Header,
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov with the fields enclosed by brackets [] replaced by
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe your own identifying information:
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov "Portions Copyrighted [year] [name of copyright owner]"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $Id: ConfigureGoogleApps.jsp,v 1.8 2009/08/14 18:32:46 asyhuang Exp $
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe Portions Copyrighted 2013 ForgeRock AS
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe<%@ page import="org.owasp.esapi.ESAPI"%>
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov<%@ page info="CreateGoogleApps" language="java" %>
<%@taglib uri="/WEB-INF/jato.tld" prefix="jato" %>
<%@taglib uri="/WEB-INF/cc.tld" prefix="cc" %>
request.setCharacterEncoding("UTF-8");
locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
<cc:header name="hdrCommon" pageTitle="webconsole.title" bundleID="amConsole" copyrightYear="2009" fireDisplayEvents="true">
<script language="javascript" src="../console/js/am.js"></script>
<script language="javascript" src="../console/js/tasksPage.js"></script>
<script language="javascript" src="../com_sun_web_ui/js/dynamic.js"></script>
<div id="main" style="position: absolute; margin: 0; border: none; padding: 0; width:auto; height:101%;">
<div id="divhelp" style="display: none; position:absolute; margin: 0; border: 1px solid #AABCC8; padding: 0; width:400px; height:200px; background:#FCFCFC">
<img src="../console/images/tasks/close.gif" width="16" height="16" onClick="hideHelp()" />
return confirm("<cc:text name="txtLogout" defaultValue="masthead.logoutMessage" bundleID="amConsole"/>");
getCircleOfTrust(radio.value);
if(choiceCOT.length>0) {
cotSelect(choiceCOT.options[0]);
getIDP(radio.value);
if (idpobj.options.length > 1) {
var frm = document.forms['ConfigureGoogleApps'];
if (realmobj.options.length < 2) {
if (cotobj.options.length < 2) {
if (idpobj.options.length < 2) {
<cc:primarymasthead name="mhCommon" bundleID="amConsole" logoutOnClick="return confirmLogout();" locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
<cc:pagetitle name="pgtitle" bundleID="amConsole" pageTitleText="page.title.configure.google.apps" showPageTitleSeparator="true" viewMenuLabel="" pageTitleHelpMessage="" showPageButtonsTop="true" showPageButtonsBottom="false" />
<cc:text name="txtDesc" defaultValue="page.desc.configure.google.apps" bundleID="amConsole" />
var frm = document.forms['ConfigureGoogleApps'];
var msgCreating = "<p><img src=\"../console/images/processing.gif\" width=\"66\" height\"66\"/></p><cc:text name="txtConfiguring" defaultValue="configuring.google.apps.waiting" bundleID="amConsole" escape="false" />";
var msgCreated = "<p> </p><input name=\"btnOK\" type=\"submit\" class=\"Btn1\" value=\"<cc:text name="txtOKBtn" defaultValue="ajax.ok.button" bundleID="amConsole" />\" onClick=\"document.location.replace(\'../task/ConfigureGoogleAppsComplete?idp=\' + idpNew + \'&realm=\' + realmNew + \'&domainId=\' + domainIdNew);return false;\" /></div></p>";
var ttlCreated = "<h3><cc:text name="txtTtlCreated" defaultValue="google.apps.configured.msg" escape="false" bundleID="amConsole" /></h3>";
var closeBtn = "<p> </p><p><div class=\"TtlBtnDiv\"><input name=\"btnClose\" type=\"submit\" class=\"Btn1\" value=\"<cc:text name="txtCloseBtn" defaultValue="ajax.close.button" bundleID="amConsole" />\" onClick=\"focusMain();return false;\" /></div></p>";
btn1.onclick = submitPage;
btn2.onclick = cancelOp;
var userLocale = "<%= viewBean.getUserLocale().toString() %>";
document.getElementById('dlg').innerHTML = '<center>' +
var url = "../console/ajax/AjaxProxy.jsp";
'&class=com.sun.identity.workflow.ConfigureGoogleApps' + getData();
frm = document.forms['ConfigureGoogleApps'];
if (ajaxObj.readyState == 4) {
var result = hexToString(ajaxObj.responseText);
frm = document.forms['ConfigureGoogleApps'];
document.getElementById('dlg').innerHTML = msg;
var url = "../console/ajax/AjaxProxy.jsp";
'&class=com.sun.identity.workflow.GetCircleOfTrusts' +
clearOptions(frm, 'ConfigureGoogleApps.choiceIDP');
var url = "../console/ajax/AjaxProxy.jsp";
'&class=com.sun.identity.workflow.GetHostedIDPs' +
if (ajaxObj.readyState == 4) {
var result = hexToString(ajaxObj.responseText);
result = result.replace(/^\s+/, '');
result = result.replace(/\s+$/, '');
if (result.length == 0) {
var cots = result.split('|');
for (var i = choiceCOT.length - 1; i>=0; i--) {
choiceCOT.remove(i);
for (var i = 0; i < cots.length; i++) {
choiceCOT.options[i] = new Option(cots[i], cots[i]);
selectOption(frm, 'ConfigureGoogleApps.choiceCOT', presetcot);
document.getElementById('dlg').innerHTML = msg;
if (ajaxObj.readyState == 4) {
var result = hexToString(ajaxObj.responseText);
result = result.replace(/^\s+/, '');
result = result.replace(/\s+$/, '');
if (result.length == 0) {
var idps = result.split('|');
for (var i = 0; i < idps.length; i++) {
choiceIDP.options[i] = new Option(idps[i], idps[i]);
document.getElementById('dlg').innerHTML = msg;
var nodes = document.getElementsByTagName("table");
var len = nodes.length;
String cot = request.getParameter("cot");
if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + cot , cot,
String idp = request.getParameter("entityId");
if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + idp, idp ,
if ((cot != null) && (cot.trim().length() > 0)) {
out.println("hideRealmObjs();");
out.println("hideIDPObjs();");
out.println("document.getElementById('cottxt').innerHTML = \"" + ESAPI.encoder().encodeForHTML(cot) + "\";");
out.println("document.getElementById('idptxt').innerHTML = \"" + ESAPI.encoder().encodeForHTML(idp) + "\";");
out.println("hideRealm();");
str = str.replace(/"/g, '"');
str = str.replace(/</g, '<');
str = str.replace(/>/g, '>');
var infoRealm = unescapeQuote("<cc:text name="txtInfoRealm" defaultValue="configure.google.apps.help.realm" bundleID="amConsole" />");
var infoEntityId = unescapeQuote("<cc:text name="txtInfoEntityId" defaultValue="configure.google.apps.help.entity.id" bundleID="amConsole" />");