summaryrefslogtreecommitdiff
path: root/src/main/webapp/wayf-swamid.jsp
blob: 300d630076a738f467879e500453efbc93fe2c06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page contentType="text/html;charset=UTF-8" %> 
<html>

<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>

<%request.setCharacterEncoding("UTF-8");%>
<%response.setCharacterEncoding("UTF-8");%>

<logic:present name="showComments" scope="Request">

<!-- TO CONFIGURE THIS FOR A SPECIFIC SITE
     =====================================

     Before you deploy this jsp you need to look for CONFIG below.
     These mark places where you should make changes. 

     If you want to make more profound changes but only to the jsp,
     you should read the sections marked PROGRAMMING NOTE below.-->

<!-- PROGRAMMING NOTE

     "requestURL" contains the URL that was specified to get the
     WAYF going.  The jsp uses it mostly for submitting result back to
     the WAYF and error reporting -->

</logic:present>

    <jsp:useBean id="requestURL" scope="request" class="java.lang.String"/>

<logic:notPresent name="entityID" scope="request">
<logic:notPresent name="shire" scope="request">

<jsp:forward page = "wayferror-swamid.jsp"/>
</logic:notPresent>
</logic:notPresent>


<head>
    <title>Identity Provider Selection</title>
    <link rel="stylesheet" title="normal" type="text/css" href="wayf-swamid.css"/>
    <link rel="stylesheet" title="normal" type="text/css" href="css/ui-lightness/jquery-ui-1.8.2.custom.css"/>
    <script language="javascript" type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
    <script language="javascript" type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script>
</head>

<body>
  <div id="container">
    <div class="head">
       <img src="images/swami2.png" alt="SWAMI logotype"/>
    </div>

    <div class="content">
     <h1>Authentication required</h1>
     <div class="selector">
      <div class="selector-left">
        <h2>Select your identity provider from the list</h2>

        <logic:present name="sites" scope="request"><logic:notPresent name="siteLists" scope="request">
            <form id="originform" method="get" action="<bean:write name="requestURL" />">
                <logic:notPresent name="entityID" scope="request">
                    <input type="hidden" name="shire" value="<bean:write name="shire" />" />
                    <input type="hidden" name="target" value="<bean:write name="target" />" />
                    <input type="hidden" name="providerId" value="<bean:write name="providerId" />" />
                    <logic:present name="time" scope="request">
                         <input type="hidden" name="time" value="<bean:write name="time" />" />
                    </logic:present>
                </logic:notPresent>
                <logic:present name="entityID" scope="request">
                    <input type="hidden" name="entityID" value="<bean:write name="entityID" />" />
                    <input type="hidden" name="returnX" value="<bean:write name="returnX" />" />
                    <input type="hidden" name="returnIDParam" value="<bean:write name="returnIDParam" />" />
                 </logic:present>
                 <input type="hidden" name="action" value="selection" />
                 <!-- input type="text" id="originSearch" name="string" value="" tabindex="25" size="30"/ -->
                 <select name="origin" id="origin" tabindex="40">      
                     <logic:iterate id="site" name="sites">
                         <option value="<jsp:getProperty name="site" property="name" />">
                             <jsp:getProperty name="site" property="displayName" />
                         </option>
                     </logic:iterate>
                 </select>
                 <input type="submit" value="Select" tabindex="50" />
                 <select name="cache" tabindex="60">
                     <option value="false"> Do not remember</option>
                     <option value="session" selected="selected"> Remember for session</option>
                     <option value="perm"> Remember for a week</option>
                 </select>
            </form>
        </logic:notPresent></logic:present>
       </div>
       <div class="selector-right">
        <logic:present name="cookieList" scope="request">
        <h2>Recently used</h2>
        <ul>
        <logic:iterate id="site" name="cookieList">
            <li>
              <logic:present name="entityID" scope="request">

                <bean:define id="returnIDParam" name="returnIDParam"/>
                <bean:define id="ei" name="entityID" />
                <bean:define id="re" name="returnX"/>

                <a href="<bean:write name="requestURL" />?entityID=<%= java.net.URLEncoder.encode(ei.toString(), "utf-8") %>&amp;return=<%= java.net.URLEncoder.encode(re.toString(), "utf-8") %>&amp;returnIDxParam=<%= java.net.URLEncoder.encode( returnIDParam.toString(), "utf-8" ) %>&amp;cache=perm&amp;action=selection&amp;origin=<jsp:getProperty name="site" property="name" />">
                    <jsp:getProperty name="site" property="displayName" />
                </a>
              </logic:present>
              <logic:notPresent name="entityID" scope="request">
                <bean:define id="targ" name="target" />
                <bean:define id="shire" name="shire" />
                <bean:define id="pid" name="providerId" />
                <a href="<bean:write name="requestURL" />?target=<%= java.net.URLEncoder.encode(targ.toString(),"utf-8") %>&amp;shire=<%= java.net.URLEncoder.encode(shire.toString(),"utf-8") %>&amp;providerId=<%= java.net.URLEncoder.encode(pid.toString(),"utf-8") %>&amp;time=<bean:write name="time" />&amp;cache=perm&amp;action=selection&amp;origin=<jsp:getProperty name="site" property="name" />">
                    <jsp:getProperty name="site" property="displayName" />
                </a>
              </logic:notPresent>
            </li>
        </logic:iterate>
        </ul>

        <form method="get" action="ClearCache.wayf">
          <logic:notPresent name="entityID" scope="request">
            <input type="hidden" name="shire" value="<bean:write name="shire" />" />
            <input type="hidden" name="target" value="<bean:write name="target" />" />
            <input type="hidden" name="providerId" value="<bean:write name="providerId" />" />
            <logic:present name="time" scope="request">
            <input type="hidden" name="time" value="<bean:write name="time" />" />
          </logic:present>
          </logic:notPresent>
          <logic:present name="entityID" scope="request">
            <input type="hidden" name="entityID" value="<bean:write name="entityID" />" />
            <input type="hidden" name="returnX" value="<bean:write name="returnX" />" />
            <input type="hidden" name="returnIDParam" value="<bean:write name="returnIDParam" />" />
          </logic:present>
          <input tabindex="20" type="submit" value="Clear List" />
        </form>
        </logic:present>
       </div>
       <div style="clear: both;"></div>
     </div>

     <div class="content-left">
        <img src="images/swedish-flag.png" alt="Swedish flag"/>
        <h2>Välj en identitetsutgivare</h2>
        <p>Tjänsten du försöker nå kräver att du väljer en identitetsutgivare (tex ditt universitet/högskola) från ovanstående lista innan du kan logga in. </p>
        <p><a title="Länken öppnas i ett nytt fönster" href="http://www.swamid.se/pub/jsp/polopoly.jsp?d=6940&amp;a=25649" class="external-link" rel="external">Vad är en identitetsutgivare?</a><br/>
           <a title="Länken öppnas i ett nytt fönster" href="http://www.swamid.se/pub/jsp/polopoly.jsp?d=6940" class="external-link" rel="external">Vad är SWAMID?</a></p>
     </div>
     <div class="content-right">
        <img src="images/flagga_uk.gif" alt="English flag"/>
        <h2>Choose an identity provider</h2>
        <p>The Service you are trying to access requires you to choose an identityprovider (e.g. your university/college) from the list above before you can log in. </p>
        <p><a title="Link will open in a new window" href="http://www.swamid.se/pub/jsp/polopoly.jsp?d=6940&amp;a=25650" target="wayf-info" class="external-link" rel="external">What is an identity provider?</a><br/>
           <a title="Link will open in a new window" href="http://www.swamid.se/pub/jsp/polopoly.jsp?d=6940" class="external-link" target="wayf-info" rel="external">What is SWAMID?</a>
        </p>
     </div>
    </div>

    <div class="footer">
        <p class="text">
The <a href="http://www.swamid.se">SWAMID federation</a> is an activity of the <a href="http://www.swami.se">Swedish Alliance for Middleware Infrastructure</a>.
<a href="http://www.swamid.se">SWAMID</a> is in part based on <a href="http://shibboleth.internet2.edu">Shibboleth</a> from <a href="http://www.internet2.edu">Internet2</a>.
If you need assistance or require information send an e-mail to <a href="mailto:info@swamid.se?subject=WAYF+support+request">SWAMID support</a> with a description of the problem.
        </p>
    </div>
</div>

<logic:present name="siteLists" scope="request">
<script language="javascript" type="text/javascript">
<!--

function changedFed(X, Selected) {

  <logic:notPresent name="singleSiteList" scope="request">

     while (X.length > 0) {
        X.options[(X.length-1)] = null;
     }
  
  
    <logic:iterate id="siteset" name="siteLists">
      if (Selected == "<jsp:getProperty name="siteset" property="name"/>") {
        var opt;
        <logic:iterate id="site" name="siteset" property="sites">
          opt = new Option ("<jsp:getProperty name="site" property="displayName" />");
          X.options[X.length] = opt;
          opt.value = "<jsp:getProperty name="site" property="name" />";
        </logic:iterate>
      }
    </logic:iterate>
  
      if (Selected == "ALL") {
        var opt;
  
      <logic:present name="sites" scope="request">
          <logic:iterate id="site" name="sites">
            opt = new Option("<jsp:getProperty name="site" property="displayName" />");
            X.options[X.length] = opt;
            opt.value = "<jsp:getProperty name="site" property="name" />";
          </logic:iterate>
      </logic:present>
  
      <logic:notPresent name="sites" scope="request">
          <logic:iterate id="siteset" name="siteLists">
            <logic:iterate id="site" name="siteset" property="sites">
              opt = new Option ("<jsp:getProperty name="site" property="displayName" />");
              X.options[X.length] = opt;
              opt.value = "<jsp:getProperty name="site" property="name" />";
            </logic:iterate>
          </logic:iterate>
      </logic:notPresent>
    }
  
  </logic:notPresent>
  
}
-->
</script>
</logic:present>

<logic:present name="sites" scope="request">

<logic:present name="showComments" scope="Request">
   <!-- Load the autosuggest code.

        PROGRAMMING NOTE - the "ie6Hack" is to do with an issue in ie6 in which the
        psuedo drop down floats below the real dropdown.  The hack is that we jsut disable
        the real drop down when the pseudo one is about.  This can seem weird for some
        layouts and so if you are not deploying against ie6 you can just send an
        empty array.
 -->
</logic:present>
  
   <script language="javascript" type="text/javascript">
$(function() {
   $('#origin').focus();
});
   </script>
   <!-- script language="javascript" type="text/javascript">
$(function() {
   var idps = [
<logic:iterate id="site" name="sites">
     {
        label: "<%= ((edu.internet2.middleware.shibboleth.wayf.IdPSite)site).getDisplayName().replace("\n","").toString() %>",
        value: "<jsp:getProperty name="site" property="name" />"
     },
</logic:iterate>
   ]; 
   $('#originSearch').autocomplete({
      minLength: 0,
      source: idps,
      focus: function(event, ui) {
         $('#originSearch').val(ui.item.label);
	 return false;
      },
      select: function(event, ui) {
	 $('#originSearch').val(ui.item.label);
         $('#origin').val(ui.item.value);
         return false;
      }
   });
   $('#originSearch').focus();
   //$('.button').button();
   //$('select').selectmenu({style: 'dropdown'});
});
   </script -->
</logic:present>

  
</body>
</html>