-
Notifications
You must be signed in to change notification settings - Fork 477
/
loginpage.xhtml
230 lines (213 loc) · 16.6 KB
/
loginpage.xhtml
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:o="http://omnifaces.org/ui"
xmlns:p="http://primefaces.org/ui"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:jsf="http://xmlns.jcp.org/jsf">
<h:head>
</h:head>
<h:body>
<f:metadata>
<f:viewParam name="redirectPage" value="#{LoginPage.redirectPage}"/>
<f:viewAction action="#{LoginPage.init}"/>
</f:metadata>
<ui:composition template="/dataverse_template.xhtml">
<ui:param name="pageTitle" value="#{bundle.login} - #{dataverseServiceBean.findRootDataverse().name}"/>
<ui:param name="showDataverseHeader" value="false"/>
<ui:param name="showMessagePanel" value="#{true}"/>
<ui:param name="loginRedirectPage" value="dataverse.xhtml"/>
<ui:define name="body">
<ui:fragment rendered="#{LoginPage.listAuthenticationProviders().size() lt 1}">
<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger">
<h:outputFormat value="#{bundle['authenticationProvidersAvailable.tip']}" escape="false">
<f:param value="<h3>"/>
<f:param value="</h3>"/>
<f:param value="<br />"/>
</h:outputFormat>
</div>
</div>
</div>
</ui:fragment>
<div jsf:id="login-container" class="row">
<div class="col-md-12">
<div class="col-md-6 col-md-offset-3">
<h2><span class="glyphicon glyphicon-log-in" /> #{bundle.login}</h2>
<div id="builtinProvider" jsf:rendered="#{LoginPage.authProvider.id == 'builtin'}">
<h:form id="loginForm" styleClass="form-horizontal">
<p:focus context="loginForm"/>
<ui:remove>
<ui:fragment rendered="#{LoginPage.multipleProvidersAvailable}">
<div class="form-group text-left">
<label class="col-sm-4 control-label" for="loginSystemSelect">
#{bundle['login.System']}
</label>
<div class="col-sm-8">
<h:selectOneMenu id="loginSystemSelect" styleClass="form-control" value="#{LoginPage.credentialsAuthProviderId}">
<f:selectItems value="#{LoginPage.listCredentialsAuthenticationProviders()}" var="ap"
itemLabel="#{ap.title}" itemValue="#{ap.id}" />
<f:ajax render="@all" listener="#{LoginPage.resetFilledCredentials}"/>
</h:selectOneMenu>
</div>
</div>
</ui:fragment>
</ui:remove>
<ui:repeat id="credentialsContainer" value="#{LoginPage.filledCredentials}" var="fc">
<div class="form-group text-left">
<label class="col-sm-4 control-label" for="credValue">
#{bundle[fc.credential.key]}
</label>
<div class="col-sm-8">
<h:inputText rendered="#{not fc.credential.secret}" value="#{fc.value}" id="credValue" styleClass="form-control"/>
<p:message rendered="#{not fc.credential.secret}" for="credValue" display="text"/>
<h:inputSecret rendered="#{fc.credential.secret}" value="#{fc.value}" id="sCredValue" styleClass="form-control"/>
<p:message rendered="#{not fc.credential.secret}" for="sCredValue" display="text"/>
</div>
</div>
</ui:repeat>
<!-- validation -->
<div class="form-group" jsf:rendered="#{LoginPage.requireExtraValidation}">
<div class="col-sm-offset-4 col-sm-8">
<p>
<h:outputText styleClass="highlightBold" value="#{bundle['contact.question']}"/> <span class="glyphicon glyphicon-asterisk text-danger" title="#{bundle.requiredField}"/>
</p>
<h:outputFormat value="#{LoginPage.op1} + #{LoginPage.op2} = "/>
<p:inputText id="messageSum" label="Sum" size="4" value="#{LoginPage.userSum}" converterMessage="#{bundle['contact.sum.converterMessage']}"
required="#{param['DO_VALIDATION']}" requiredMessage="#{bundle['contact.sum.required']}"
validatorMessage="#{bundle['contact.sum.invalid']}" validator="#{LoginPage.validateUserSum}">
<f:convertNumber integerOnly="true" type="number"/>
</p:inputText>
<h:message for="messageSum" styleClass="bg-danger text-danger"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-9 button-block">
<p:commandButton id="login" styleClass="btn btn-default" value="#{bundle.login}" update="@all" action="#{LoginPage.login}"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-9">
<a href="passwordreset.xhtml">
#{bundle['login.forgot.text']}
</a>
</div>
</div>
</h:form>
</div>
<div id="remoteProvider" jsf:rendered="#{LoginPage.authProvider.id == 'shib'}">
<h:form>
<p class="help-block">
<span class="glyphicon glyphicon-info-sign"/>
<h:outputFormat value=" #{bundle['login.institution.blurb']} " escape="false">
<f:param value="#{settingsWrapper.guidesBaseUrl}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
<h:outputText value="#{bundle['login.institution.support.beforeLink']} " />
<p:commandLink value="#{settingsWrapper.supportTeamName}" oncomplete="PF('contactForm').show()" update=":contactDialog" actionListener="#{sendFeedbackDialog.initUserInput}">
<f:setPropertyActionListener target="#{sendFeedbackDialog.messageSubject}" value=""/>
<f:setPropertyActionListener target="#{sendFeedbackDialog.recipient}" value="#{null}"/>
<f:setPropertyActionListener target="#{sendFeedbackDialog.userMessage}" value=""/>
<f:setPropertyActionListener target="#{sendFeedbackDialog.userEmail}" value=""/>
</p:commandLink>
<h:outputText value=" #{bundle['login.institution.support.afterLink']}" escape="false"/>
</p>
</h:form>
<div class="form-horizontal">
<div class="form-group text-left">
<label class="col-sm-4 control-label">
#{bundle['auth.providers.title.shib']}
</label>
<div id="idpSelect" class="col-sm-8">
</div>
</div>
</div>
<script type="text/javascript">
shibRedirectPage = '';
</script>
<script src="/resources/js/shib/idpselect_config.js" type="text/javascript" language="javascript"></script>
<script src="/resources/js/shib/idpselect.js" type="text/javascript" language="javascript"></script>
<script src="/resources/js/shib/idpselect_style.js" type="text/javascript" language="javascript"></script>
<noscript>
<!-- If you need to care about non javascript browsers you will need to
generate a hyperlink to a non-js DS.
To build you will need:
- URL: The base URL of the DS you use
- EI: Your entityId, URLencoded. You can get this from the line that
this page is called with.
- RET: Your return address dlib-adidp.ucs.ed.ac.uk. Again you can get
this from the page this is called with, but beware of the
target%3Dcookie%253A5269905f bit..
< href=${URL}?entityID=${EI}&return=${RET}
-->
Your Browser does not support javascript. Please use
<!--FIXME not valid xhtml?-->
<!--<a href="http://federation.org/DS/DS?entityID=https%3A%2F%2FyourentityId.edu.edu%2Fshibboleth&return=https%3A%2F%2Fyourreturn.edu%2FShibboleth.sso%2FDS%3FSAMLDS%3D1%26target%3Dhttps%3A%2F%2Fyourreturn.edu%2F">this link</a>.-->
</noscript>
</div>
<!--ONLY RENDER BUTTON FOR OAUTH PROVIDERS (ORCID, Google, GitHub)-->
<div class="form-horizontal" jsf:rendered="#{LoginPage.authProvider.OAuthProvider}">
<o:form useRequestURI="true">
<p class="help-block">
<span class="glyphicon glyphicon-info-sign"/>
<h:outputFormat value=" #{bundle['auth.providers.blurb']}" escape="false">
<o:param value="#{LoginPage.authProvider.info.title}"/>
<o:param value="#{settingsWrapper.guidesBaseUrl}"/>
<o:param value="#{systemConfig.guidesVersion}"/>
<o:param>
<p:commandLink value="#{settingsWrapper.supportTeamName}" oncomplete="PF('contactForm').show()" update=":contactDialog" actionListener="#{sendFeedbackDialog.initUserInput}">
<f:setPropertyActionListener target="#{sendFeedbackDialog.messageSubject}" value=""/>
<f:setPropertyActionListener target="#{sendFeedbackDialog.recipient}" value="#{null}"/>
<f:setPropertyActionListener target="#{sendFeedbackDialog.userMessage}" value=""/>
<f:setPropertyActionListener target="#{sendFeedbackDialog.userEmail}" value=""/>
</p:commandLink>
</o:param>
</h:outputFormat>
</p>
</o:form>
<div class="form-group text-left">
<div class="col-sm-12">
<h:outputLink styleClass="btn btn-default" value="#{OAuth2Page.linkFor(LoginPage.authProvider.id, LoginPage.redirectPage)}">
<h:graphicImage rendered="#{fn:contains(LoginPage.authProvider.id, 'orcid')}" value="/resources/images/orcid_16x16.png" height="16" width="16"/>
<h:outputFormat rendered="#{not fn:contains(LoginPage.authProvider.id, 'orcid')}" value="#{LoginPage.getLoginButtonText()}"/>
<h:outputFormat rendered="#{fn:contains(LoginPage.authProvider.id, 'orcid')}" value="#{bundle['login.button.orcid']}"/>
</h:outputLink>
<ui:fragment rendered="#{fn:contains(LoginPage.authProvider.id, 'orcid')}">
<p class="help-block small" style="margin-top:1em;">
<h:outputText value="#{bundle['auth.providers.orcid.helpmessage1']}" escape="false"/>
</p>
<p class="help-block small" style="margin-top:1em;">
<h:outputText value="#{bundle['auth.providers.orcid.helpmessage2']}" escape="false"/>
</p>
</ui:fragment>
</div>
</div>
</div>
<div id="otherProviders" jsf:rendered="#{LoginPage.listAuthenticationProviders().size() > 1}">
<h4>#{bundle['auth.providers.title']}</h4>
<h:form>
<ui:repeat value="#{LoginPage.listAuthenticationProviders()}" var="provider">
<p:commandLink rendered="#{provider.id != LoginPage.authProvider.id}" styleClass="btn btn-default" actionListener="#{LoginPage.setAuthProviderById(provider.id)}" update="login-container">
<h:outputText value="#{provider.title}" />
</p:commandLink>
</ui:repeat>
</h:form>
<div jsf:rendered="#{LoginPage.authProvider.id == 'builtin'}">
<p class="help-block"><span class="glyphicon glyphicon-info-sign"/>
<h:outputFormat value=" #{bundle['auth.providers.tip']}" escape="false">
<o:param value="#{settingsWrapper.guidesBaseUrl}"/>
<o:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
</p>
</div>
</div>
</div>
</div>
</div>
</ui:define>
</ui:composition>
</h:body>
</html>