204 |
18 Mar 05 |
nicklas |
1 |
<%-- $Id$ |
204 |
18 Mar 05 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2005 Nicklas Nordborg |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Nicklas Nordborg |
204 |
18 Mar 05 |
nicklas |
6 |
|
2304 |
22 May 06 |
jari |
7 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
8 |
Available at http://base.thep.lu.se/ |
204 |
18 Mar 05 |
nicklas |
9 |
|
204 |
18 Mar 05 |
nicklas |
10 |
BASE is free software; you can redistribute it and/or |
204 |
18 Mar 05 |
nicklas |
11 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
12 |
as published by the Free Software Foundation; either version 3 |
204 |
18 Mar 05 |
nicklas |
13 |
of the License, or (at your option) any later version. |
204 |
18 Mar 05 |
nicklas |
14 |
|
204 |
18 Mar 05 |
nicklas |
15 |
BASE is distributed in the hope that it will be useful, |
204 |
18 Mar 05 |
nicklas |
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
204 |
18 Mar 05 |
nicklas |
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
204 |
18 Mar 05 |
nicklas |
18 |
GNU General Public License for more details. |
204 |
18 Mar 05 |
nicklas |
19 |
|
204 |
18 Mar 05 |
nicklas |
20 |
You should have received a copy of the GNU General Public License |
4511 |
11 Sep 08 |
jari |
21 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
204 |
18 Mar 05 |
nicklas |
22 |
------------------------------------------------------------------ |
204 |
18 Mar 05 |
nicklas |
23 |
|
204 |
18 Mar 05 |
nicklas |
24 |
This is the front page of BASE. It displays a login form |
204 |
18 Mar 05 |
nicklas |
25 |
and some of the relevant news items. |
204 |
18 Mar 05 |
nicklas |
26 |
|
204 |
18 Mar 05 |
nicklas |
27 |
@param login The value to display in the login input field. |
211 |
22 Mar 05 |
nicklas |
28 |
@param error An error message that should be displayed |
204 |
18 Mar 05 |
nicklas |
29 |
|
204 |
18 Mar 05 |
nicklas |
30 |
@author Nicklas |
204 |
18 Mar 05 |
nicklas |
31 |
@version 2.0 |
204 |
18 Mar 05 |
nicklas |
32 |
--%> |
5426 |
24 Sep 10 |
nicklas |
33 |
<%@ page pageEncoding="UTF-8" session="false" |
3061 |
15 Jan 07 |
nicklas |
34 |
import="net.sf.basedb.core.Application" |
522 |
04 May 05 |
nicklas |
35 |
import="net.sf.basedb.core.SessionControl" |
522 |
04 May 05 |
nicklas |
36 |
import="net.sf.basedb.core.DbControl" |
522 |
04 May 05 |
nicklas |
37 |
import="net.sf.basedb.core.News" |
1418 |
07 Oct 05 |
nicklas |
38 |
import="net.sf.basedb.core.ItemQuery" |
7394 |
09 Jun 17 |
nicklas |
39 |
import="net.sf.basedb.core.ItemResultIterator" |
370 |
05 Apr 05 |
nicklas |
40 |
import="net.sf.basedb.core.query.Orders" |
1418 |
07 Oct 05 |
nicklas |
41 |
import="net.sf.basedb.core.query.Hql" |
6426 |
27 Feb 14 |
nicklas |
42 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
7529 |
26 Nov 18 |
nicklas |
43 |
import="net.sf.basedb.util.extensions.ActionIterator" |
211 |
22 Mar 05 |
nicklas |
44 |
import="net.sf.basedb.clients.web.Base" |
204 |
18 Mar 05 |
nicklas |
45 |
import="net.sf.basedb.clients.web.util.HTML" |
2942 |
22 Nov 06 |
nicklas |
46 |
import="net.sf.basedb.util.formatter.Formatter" |
6426 |
27 Feb 14 |
nicklas |
47 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
6426 |
27 Feb 14 |
nicklas |
48 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
2942 |
22 Nov 06 |
nicklas |
49 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
5479 |
08 Nov 10 |
nicklas |
50 |
import="net.sf.basedb.clients.web.servlet.RssNewsFeed" |
6426 |
27 Feb 14 |
nicklas |
51 |
import="net.sf.basedb.clients.web.extensions.login.LoginFormAction" |
6426 |
27 Feb 14 |
nicklas |
52 |
import="net.sf.basedb.clients.web.extensions.login.FieldInfo" |
7536 |
28 Nov 18 |
nicklas |
53 |
import="net.sf.basedb.clients.web.extensions.login.PasswordLoginFormFactory" |
8045 |
03 Jun 22 |
nicklas |
54 |
import="net.sf.basedb.clients.web.extensions.DynamicActionAttributeSupport" |
2753 |
20 Oct 06 |
nicklas |
55 |
import="net.sf.basedb.util.Values" |
2942 |
22 Nov 06 |
nicklas |
56 |
import="java.util.Date" |
7529 |
26 Nov 18 |
nicklas |
57 |
import="java.util.Map" |
7529 |
26 Nov 18 |
nicklas |
58 |
import="java.util.TreeMap" |
7815 |
05 Jun 20 |
nicklas |
59 |
import="java.util.UUID" |
204 |
18 Mar 05 |
nicklas |
60 |
%> |
214 |
22 Mar 05 |
nicklas |
61 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
6426 |
27 Feb 14 |
nicklas |
62 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
6426 |
27 Feb 14 |
nicklas |
63 |
<%! |
6426 |
27 Feb 14 |
nicklas |
64 |
// If value is null, return "", else <prefix>+<value>+<suffix> |
6426 |
27 Feb 14 |
nicklas |
65 |
String valueIfNotNull(String prefix, String value, String suffix) |
6426 |
27 Feb 14 |
nicklas |
66 |
{ |
6426 |
27 Feb 14 |
nicklas |
67 |
return value == null ? "" : prefix+value+suffix; |
6426 |
27 Feb 14 |
nicklas |
68 |
} |
6426 |
27 Feb 14 |
nicklas |
69 |
%> |
204 |
18 Mar 05 |
nicklas |
70 |
<% |
522 |
04 May 05 |
nicklas |
71 |
final String login = Values.getString(request.getParameter("login"), ""); |
522 |
04 May 05 |
nicklas |
72 |
final String error = Values.getString(request.getParameter("error"), null); |
7540 |
03 Dec 18 |
nicklas |
73 |
final boolean again = Values.getBoolean(request.getParameter("again")); |
7529 |
26 Nov 18 |
nicklas |
74 |
final String requestedLoginForm = Values.getString(request.getParameter("loginForm"), null); |
522 |
04 May 05 |
nicklas |
75 |
final String root = request.getContextPath()+"/"; |
204 |
18 Mar 05 |
nicklas |
76 |
|
522 |
04 May 05 |
nicklas |
77 |
final SessionControl sc = Base.getSessionControl(pageContext, true); |
522 |
04 May 05 |
nicklas |
78 |
final String ID = sc.getId(); |
2942 |
22 Nov 06 |
nicklas |
79 |
final Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
7954 |
12 May 21 |
nicklas |
80 |
final DbControl dc = sc.newDbControl(":Main login form"); |
6426 |
27 Feb 14 |
nicklas |
81 |
|
204 |
18 Mar 05 |
nicklas |
82 |
try |
204 |
18 Mar 05 |
nicklas |
83 |
{ |
6426 |
27 Feb 14 |
nicklas |
84 |
String broadcastTitle = (String)application.getAttribute("broadcast.title"); |
6426 |
27 Feb 14 |
nicklas |
85 |
String broadcastMessage = (String)application.getAttribute("broadcast.message"); |
6426 |
27 Feb 14 |
nicklas |
86 |
boolean denyLogin = Boolean.TRUE.equals(application.getAttribute("broadcast.deny-login")); |
7540 |
03 Dec 18 |
nicklas |
87 |
|
7394 |
09 Jun 17 |
nicklas |
88 |
ItemResultIterator<News> news = null; |
6426 |
27 Feb 14 |
nicklas |
89 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext); |
8045 |
03 Jun 22 |
nicklas |
90 |
jspContext.setNeedResourcesPerExtension(true); |
7605 |
26 Feb 19 |
nicklas |
91 |
ExtensionsInvoker<LoginFormAction> invoker = ExtensionsControl.useExtensions(jspContext, "net.sf.basedb.clients.web.login-form"); |
6426 |
27 Feb 14 |
nicklas |
92 |
|
6426 |
27 Feb 14 |
nicklas |
93 |
LoginFormAction loginAction = null; |
7529 |
26 Nov 18 |
nicklas |
94 |
String selectedLoginForm = null; |
8045 |
03 Jun 22 |
nicklas |
95 |
String selectedExtension = null; |
7529 |
26 Nov 18 |
nicklas |
96 |
Map<String, String> allForms = new TreeMap<String, String>(); |
7529 |
26 Nov 18 |
nicklas |
97 |
|
7529 |
26 Nov 18 |
nicklas |
98 |
ActionIterator<LoginFormAction> it = invoker.iterate(); |
7529 |
26 Nov 18 |
nicklas |
99 |
while (it.hasNext()) |
6426 |
27 Feb 14 |
nicklas |
100 |
{ |
7529 |
26 Nov 18 |
nicklas |
101 |
LoginFormAction action = it.next(); |
6426 |
27 Feb 14 |
nicklas |
102 |
if (action != null) |
6426 |
27 Feb 14 |
nicklas |
103 |
{ |
7529 |
26 Nov 18 |
nicklas |
104 |
String formId = action.getId(); |
7529 |
26 Nov 18 |
nicklas |
105 |
if (formId == null) formId = it.getExtension().getId(); |
7529 |
26 Nov 18 |
nicklas |
106 |
String displayName = action.getDisplayName(); |
7529 |
26 Nov 18 |
nicklas |
107 |
if (displayName == null) displayName = it.getExtension().getAbout().getName(); |
7529 |
26 Nov 18 |
nicklas |
108 |
allForms.put(formId, displayName); |
7529 |
26 Nov 18 |
nicklas |
109 |
|
7529 |
26 Nov 18 |
nicklas |
110 |
if (loginAction == null || formId.equals(requestedLoginForm)) |
7529 |
26 Nov 18 |
nicklas |
111 |
{ |
7529 |
26 Nov 18 |
nicklas |
112 |
loginAction = action; |
7529 |
26 Nov 18 |
nicklas |
113 |
selectedLoginForm = formId; |
8045 |
03 Jun 22 |
nicklas |
114 |
selectedExtension = it.getExtension().getId(); |
7529 |
26 Nov 18 |
nicklas |
115 |
} |
6426 |
27 Feb 14 |
nicklas |
116 |
} |
6426 |
27 Feb 14 |
nicklas |
117 |
} |
6426 |
27 Feb 14 |
nicklas |
118 |
if (loginAction == null) |
6426 |
27 Feb 14 |
nicklas |
119 |
{ |
7536 |
28 Nov 18 |
nicklas |
120 |
loginAction = PasswordLoginFormFactory.INSTANCE; |
7536 |
28 Nov 18 |
nicklas |
121 |
selectedLoginForm = loginAction.getId(); |
6426 |
27 Feb 14 |
nicklas |
122 |
} |
6426 |
27 Feb 14 |
nicklas |
123 |
|
6426 |
27 Feb 14 |
nicklas |
124 |
FieldInfo loginField = loginAction.getLoginField(); |
6426 |
27 Feb 14 |
nicklas |
125 |
FieldInfo passwordField = loginAction.getPasswordField(); |
7500 |
08 Aug 18 |
nicklas |
126 |
FieldInfo extraField = loginAction.getExtraField(); |
204 |
18 Mar 05 |
nicklas |
127 |
%> |
6151 |
27 Sep 12 |
nicklas |
128 |
<base:page type="default"> |
7540 |
03 Dec 18 |
nicklas |
129 |
<base:head styles="login.css" scripts="~login.js"> |
8045 |
03 Jun 22 |
nicklas |
130 |
<ext:scripts context="<%=jspContext%>" extension="<%=selectedExtension%>" /> |
8045 |
03 Jun 22 |
nicklas |
131 |
<ext:stylesheets context="<%=jspContext%>" extension="<%=selectedExtension%>" /> |
6426 |
27 Feb 14 |
nicklas |
132 |
</base:head> |
7530 |
26 Nov 18 |
nicklas |
133 |
<base:body style="padding-top: 5em;" data-login-form="<%=HTML.encodeTags(selectedLoginForm)%>" data-requested-form="<%=HTML.encodeTags(requestedLoginForm) %>"> |
8045 |
03 Jun 22 |
nicklas |
134 |
<form name="login" action="login.jsp" method="post" |
8045 |
03 Jun 22 |
nicklas |
135 |
<%=DynamicActionAttributeSupport.getAttributesString(loginAction)%> |
8045 |
03 Jun 22 |
nicklas |
136 |
> |
5918 |
21 Dec 11 |
nicklas |
137 |
<input type="hidden" name="ID" value="<%=ID%>"> |
7540 |
03 Dec 18 |
nicklas |
138 |
<input type="hidden" name="again" value="<%=again?1:0%>"> |
7114 |
16 Mar 16 |
nicklas |
139 |
<input type="hidden" name="useAutoStartPage" value="1"> |
7815 |
05 Jun 20 |
nicklas |
140 |
<input type="hidden" name="deviceToken" value="<%=UUID.randomUUID().toString()%>"> |
5918 |
21 Dec 11 |
nicklas |
141 |
|
7540 |
03 Dec 18 |
nicklas |
142 |
<table style="margin: auto; max-width: 700px; display: none;" id="the-login-form"> |
415 |
18 Apr 05 |
nicklas |
143 |
<tr> |
415 |
18 Apr 05 |
nicklas |
144 |
<td> |
6426 |
27 Feb 14 |
nicklas |
145 |
<% |
7529 |
26 Nov 18 |
nicklas |
146 |
if (allForms.size() > 1) |
7529 |
26 Nov 18 |
nicklas |
147 |
{ |
7529 |
26 Nov 18 |
nicklas |
148 |
%> |
7529 |
26 Nov 18 |
nicklas |
149 |
<div style="text-align: right; margin-bottom: 0.25em;"> |
7529 |
26 Nov 18 |
nicklas |
150 |
<b>Login with</b> |
7529 |
26 Nov 18 |
nicklas |
151 |
<select name="loginForm" id="loginForm" style="min-width: 10em;"> |
7529 |
26 Nov 18 |
nicklas |
152 |
<% |
7529 |
26 Nov 18 |
nicklas |
153 |
for (Map.Entry<String, String> entry : allForms.entrySet()) |
7529 |
26 Nov 18 |
nicklas |
154 |
{ |
7529 |
26 Nov 18 |
nicklas |
155 |
String formId = entry.getKey(); |
7529 |
26 Nov 18 |
nicklas |
156 |
%> |
7529 |
26 Nov 18 |
nicklas |
157 |
<option value="<%=formId%>" <%=formId.equals(selectedLoginForm) ? "selected" : ""%>><%=HTML.encodeTags(entry.getValue()) %> |
7529 |
26 Nov 18 |
nicklas |
158 |
<% |
7529 |
26 Nov 18 |
nicklas |
159 |
} |
7529 |
26 Nov 18 |
nicklas |
160 |
%> |
7529 |
26 Nov 18 |
nicklas |
161 |
</select> |
7529 |
26 Nov 18 |
nicklas |
162 |
</div> |
7529 |
26 Nov 18 |
nicklas |
163 |
<% |
7529 |
26 Nov 18 |
nicklas |
164 |
} |
7529 |
26 Nov 18 |
nicklas |
165 |
else if (selectedLoginForm != null) |
7529 |
26 Nov 18 |
nicklas |
166 |
{ |
7529 |
26 Nov 18 |
nicklas |
167 |
%> |
7529 |
26 Nov 18 |
nicklas |
168 |
<input type="hidden" name="loginForm" value="<%=selectedLoginForm%>"> |
7529 |
26 Nov 18 |
nicklas |
169 |
<% |
7529 |
26 Nov 18 |
nicklas |
170 |
} |
7537 |
28 Nov 18 |
nicklas |
171 |
if (loginAction.getHelp() != null) |
7537 |
28 Nov 18 |
nicklas |
172 |
{ |
7537 |
28 Nov 18 |
nicklas |
173 |
%> |
7537 |
28 Nov 18 |
nicklas |
174 |
<div class="messagecontainer help" style="margin-bottom: 1em; font-style: italic;" id="login-help"> |
7537 |
28 Nov 18 |
nicklas |
175 |
<%=loginAction.getHelp() %> |
7537 |
28 Nov 18 |
nicklas |
176 |
</div> |
7537 |
28 Nov 18 |
nicklas |
177 |
<% |
7537 |
28 Nov 18 |
nicklas |
178 |
} |
6426 |
27 Feb 14 |
nicklas |
179 |
%> |
8045 |
03 Jun 22 |
nicklas |
180 |
<div id="login-error" class="messagecontainer error" |
8045 |
03 Jun 22 |
nicklas |
181 |
style="margin-top: 1em; margin-bottom: 1em;<%=error==null?"display:none;":""%>"> |
8045 |
03 Jun 22 |
nicklas |
182 |
<%=error==null?"":error%> |
8045 |
03 Jun 22 |
nicklas |
183 |
</div> |
7529 |
26 Nov 18 |
nicklas |
184 |
<table style="width: 100%; border-collapse: separate;"> |
415 |
18 Apr 05 |
nicklas |
185 |
<tr> |
6632 |
28 Nov 14 |
nicklas |
186 |
<td class="base-logo"><img src="images/baselogo.png" alt="BASE logo"></td> |
6426 |
27 Feb 14 |
nicklas |
187 |
<td style="width: 515px;"> |
5918 |
21 Dec 11 |
nicklas |
188 |
<div id="loginform"> |
6426 |
27 Feb 14 |
nicklas |
189 |
<table style="width: 100%;"> |
6426 |
27 Feb 14 |
nicklas |
190 |
<tr <%=valueIfNotNull("class=\"", loginField.getClazz(), "\"")%> id="login-row"> |
6610 |
20 Nov 14 |
nicklas |
191 |
<th class="bg-filled-100"><%=loginField.getPrompt() %></th> |
6426 |
27 Feb 14 |
nicklas |
192 |
<td colspan="2"><input class="text" name="login" id="login" |
6426 |
27 Feb 14 |
nicklas |
193 |
type="<%=loginField.hasHiddenCharacters() ? "password" : "text"%>" |
6426 |
27 Feb 14 |
nicklas |
194 |
value="<%=loginAction.rememberLastLogin() ? HTML.encodeTags(login) : ""%>" |
6426 |
27 Feb 14 |
nicklas |
195 |
<%=denyLogin ? "disabled" : ""%> |
6426 |
27 Feb 14 |
nicklas |
196 |
<%=valueIfNotNull("style=\"", loginField.getStyle(), "\"") %> |
6426 |
27 Feb 14 |
nicklas |
197 |
<%=valueIfNotNull("title=\"", loginField.getTooltip(), "\"") %> |
6426 |
27 Feb 14 |
nicklas |
198 |
<%=valueIfNotNull("placeholder=\"", loginField.getPlaceHolder(), "\"") %> |
6426 |
27 Feb 14 |
nicklas |
199 |
<%=loginAction.rememberLastLogin() ? "" : "autocomplete=\"off\" data-use-last-login=\"0\""%> |
6426 |
27 Feb 14 |
nicklas |
200 |
maxlength="100" |
8045 |
03 Jun 22 |
nicklas |
201 |
tabindex="1" |
8045 |
03 Jun 22 |
nicklas |
202 |
<%=DynamicActionAttributeSupport.getAttributesString(loginField)%> |
8045 |
03 Jun 22 |
nicklas |
203 |
> |
5918 |
21 Dec 11 |
nicklas |
204 |
</td> |
5918 |
21 Dec 11 |
nicklas |
205 |
</tr> |
6426 |
27 Feb 14 |
nicklas |
206 |
<tr <%=valueIfNotNull("class=\"", passwordField.getClazz(), "\"")%> id="password-row"> |
6610 |
20 Nov 14 |
nicklas |
207 |
<th class="bg-filled-100"><%=passwordField.getPrompt() %></th> |
6426 |
27 Feb 14 |
nicklas |
208 |
<td><input class="text" name="password" id="password" |
6426 |
27 Feb 14 |
nicklas |
209 |
type="<%=passwordField.hasHiddenCharacters() ? "password" : "text"%>" |
6426 |
27 Feb 14 |
nicklas |
210 |
<%=denyLogin ? "disabled" : ""%> |
6426 |
27 Feb 14 |
nicklas |
211 |
<%=valueIfNotNull("style=\"", passwordField.getStyle(), "\"") %> |
6426 |
27 Feb 14 |
nicklas |
212 |
<%=valueIfNotNull("title=\"", passwordField.getTooltip(), "\"") %> |
6426 |
27 Feb 14 |
nicklas |
213 |
<%=valueIfNotNull("placeholder=\"", passwordField.getPlaceHolder(), "\"") %> |
6426 |
27 Feb 14 |
nicklas |
214 |
maxlength="80" |
8045 |
03 Jun 22 |
nicklas |
215 |
tabindex="2" |
8045 |
03 Jun 22 |
nicklas |
216 |
<%=DynamicActionAttributeSupport.getAttributesString(passwordField)%> |
8045 |
03 Jun 22 |
nicklas |
217 |
> |
5918 |
21 Dec 11 |
nicklas |
218 |
</td> |
7540 |
03 Dec 18 |
nicklas |
219 |
<td <%=extraField != null?"rowspan=\"2\"" : "" %> style="vertical-align: bottom;"> |
7540 |
03 Dec 18 |
nicklas |
220 |
<base:buttongroup> |
7540 |
03 Dec 18 |
nicklas |
221 |
<base:button |
7540 |
03 Dec 18 |
nicklas |
222 |
id="btnLogin" |
7540 |
03 Dec 18 |
nicklas |
223 |
subclass="<%=denyLogin ? "disabled" : ""%>" |
7540 |
03 Dec 18 |
nicklas |
224 |
image="login.png" title="Login" |
7540 |
03 Dec 18 |
nicklas |
225 |
tooltip="<%=HTML.encodeTags(broadcastTitle)%>" tabindex="4" |
7540 |
03 Dec 18 |
nicklas |
226 |
/> |
7540 |
03 Dec 18 |
nicklas |
227 |
<base:button |
7540 |
03 Dec 18 |
nicklas |
228 |
id="close" title="Cancel" tabindex="5" |
7540 |
03 Dec 18 |
nicklas |
229 |
visible="<%=again %>" |
7540 |
03 Dec 18 |
nicklas |
230 |
/> |
7540 |
03 Dec 18 |
nicklas |
231 |
</base:buttongroup> |
7540 |
03 Dec 18 |
nicklas |
232 |
</td> |
5918 |
21 Dec 11 |
nicklas |
233 |
</tr> |
7500 |
08 Aug 18 |
nicklas |
234 |
<% |
7500 |
08 Aug 18 |
nicklas |
235 |
if (extraField != null) |
7500 |
08 Aug 18 |
nicklas |
236 |
{ |
7500 |
08 Aug 18 |
nicklas |
237 |
%> |
7500 |
08 Aug 18 |
nicklas |
238 |
<tr <%=valueIfNotNull("class=\"", extraField.getClazz(), "\"")%> id="extra-row"> |
7500 |
08 Aug 18 |
nicklas |
239 |
<th class="bg-filled-100"><%=extraField.getPrompt() %></th> |
7500 |
08 Aug 18 |
nicklas |
240 |
<td><input class="text" name="extraField" id="extraField" |
7500 |
08 Aug 18 |
nicklas |
241 |
type="<%=extraField.hasHiddenCharacters() ? "password" : "text"%>" |
7500 |
08 Aug 18 |
nicklas |
242 |
<%=denyLogin ? "disabled" : ""%> |
7500 |
08 Aug 18 |
nicklas |
243 |
<%=valueIfNotNull("style=\"", extraField.getStyle(), "\"") %> |
7500 |
08 Aug 18 |
nicklas |
244 |
<%=valueIfNotNull("title=\"", extraField.getTooltip(), "\"") %> |
7500 |
08 Aug 18 |
nicklas |
245 |
<%=valueIfNotNull("placeholder=\"", extraField.getPlaceHolder(), "\"") %> |
7500 |
08 Aug 18 |
nicklas |
246 |
maxlength="80" |
8045 |
03 Jun 22 |
nicklas |
247 |
tabindex="3" |
8045 |
03 Jun 22 |
nicklas |
248 |
<%=DynamicActionAttributeSupport.getAttributesString(extraField)%> |
8045 |
03 Jun 22 |
nicklas |
249 |
> |
7500 |
08 Aug 18 |
nicklas |
250 |
</td> |
7500 |
08 Aug 18 |
nicklas |
251 |
</tr> |
7500 |
08 Aug 18 |
nicklas |
252 |
<% |
7500 |
08 Aug 18 |
nicklas |
253 |
} |
7500 |
08 Aug 18 |
nicklas |
254 |
%> |
5918 |
21 Dec 11 |
nicklas |
255 |
<tr> |
6610 |
20 Nov 14 |
nicklas |
256 |
<th class="bg-filled-100 subprompt"></th> |
5918 |
21 Dec 11 |
nicklas |
257 |
<td colspan="2"> |
415 |
18 Apr 05 |
nicklas |
258 |
<% |
5918 |
21 Dec 11 |
nicklas |
259 |
String forgotPassword = sc.getClientDefaultSetting("server.forgotten.password"); |
5918 |
21 Dec 11 |
nicklas |
260 |
String getAccount = sc.getClientDefaultSetting("server.get.account"); |
5918 |
21 Dec 11 |
nicklas |
261 |
if (forgotPassword != null) |
5918 |
21 Dec 11 |
nicklas |
262 |
{ |
5918 |
21 Dec 11 |
nicklas |
263 |
%> |
6167 |
12 Oct 12 |
nicklas |
264 |
<base:icon id="forgotPassword" image="bullet.png" |
6167 |
12 Oct 12 |
nicklas |
265 |
tooltip="Click here if you have forgotten your password">Forgot your password?</base:icon> |
5918 |
21 Dec 11 |
nicklas |
266 |
<% |
5918 |
21 Dec 11 |
nicklas |
267 |
} |
5918 |
21 Dec 11 |
nicklas |
268 |
if (getAccount != null) |
5918 |
21 Dec 11 |
nicklas |
269 |
{ |
5918 |
21 Dec 11 |
nicklas |
270 |
%> |
6167 |
12 Oct 12 |
nicklas |
271 |
<base:icon id="getAccount" image="bullet.png" |
6167 |
12 Oct 12 |
nicklas |
272 |
tooltip="Click here if you want to get an account on this server">Get an account!</base:icon> |
5918 |
21 Dec 11 |
nicklas |
273 |
<% |
5918 |
21 Dec 11 |
nicklas |
274 |
} |
415 |
18 Apr 05 |
nicklas |
275 |
%> |
5918 |
21 Dec 11 |
nicklas |
276 |
</td> |
5918 |
21 Dec 11 |
nicklas |
277 |
</tr> |
4567 |
07 Oct 08 |
nicklas |
278 |
</table> |
4567 |
07 Oct 08 |
nicklas |
279 |
</div> |
415 |
18 Apr 05 |
nicklas |
280 |
</td> |
415 |
18 Apr 05 |
nicklas |
281 |
</tr> |
415 |
18 Apr 05 |
nicklas |
282 |
</table> |
214 |
22 Mar 05 |
nicklas |
283 |
<% |
5918 |
21 Dec 11 |
nicklas |
284 |
if (denyLogin) |
5918 |
21 Dec 11 |
nicklas |
285 |
{ |
5918 |
21 Dec 11 |
nicklas |
286 |
%> |
6151 |
27 Sep 12 |
nicklas |
287 |
<div class="messagecontainer help" id="denyLogin"> |
5918 |
21 Dec 11 |
nicklas |
288 |
<b><%=HTML.encodeTags(broadcastTitle) %> (login disabled)</b><br> |
5918 |
21 Dec 11 |
nicklas |
289 |
<%=HTML.niceFormat(broadcastMessage)%> |
6167 |
12 Oct 12 |
nicklas |
290 |
<base:buttongroup style="margin-top: 1em;"> |
6167 |
12 Oct 12 |
nicklas |
291 |
<base:button id="btnLoginAnyway" title="Login anyway" image="login.png" tooltip="At your own risk!" /> |
5918 |
21 Dec 11 |
nicklas |
292 |
</base:buttongroup> |
5918 |
21 Dec 11 |
nicklas |
293 |
</div> |
5918 |
21 Dec 11 |
nicklas |
294 |
<% |
5918 |
21 Dec 11 |
nicklas |
295 |
} |
7540 |
03 Dec 18 |
nicklas |
296 |
if (!again) |
367 |
05 Apr 05 |
nicklas |
297 |
{ |
7540 |
03 Dec 18 |
nicklas |
298 |
String aboutServer = sc.getClientDefaultSetting("server.about"); |
7540 |
03 Dec 18 |
nicklas |
299 |
if (aboutServer != null) |
7540 |
03 Dec 18 |
nicklas |
300 |
{ |
7540 |
03 Dec 18 |
nicklas |
301 |
%> |
7540 |
03 Dec 18 |
nicklas |
302 |
<h3 style="margin-top: 1em;">About this server</h3> |
7540 |
03 Dec 18 |
nicklas |
303 |
<p> |
7540 |
03 Dec 18 |
nicklas |
304 |
<%=aboutServer%> |
7540 |
03 Dec 18 |
nicklas |
305 |
</p> |
7540 |
03 Dec 18 |
nicklas |
306 |
<base:icon id="aboutServer" image="bullet.png">More about this server</base:icon> |
7540 |
03 Dec 18 |
nicklas |
307 |
<% |
7540 |
03 Dec 18 |
nicklas |
308 |
} |
367 |
05 Apr 05 |
nicklas |
309 |
%> |
7540 |
03 Dec 18 |
nicklas |
310 |
<h3 style="margin-top: 1em;">News and announcements |
367 |
05 Apr 05 |
nicklas |
311 |
<% |
7540 |
03 Dec 18 |
nicklas |
312 |
if (RssNewsFeed.isEnabled()) |
7540 |
03 Dec 18 |
nicklas |
313 |
{ |
7540 |
03 Dec 18 |
nicklas |
314 |
%> |
7540 |
03 Dec 18 |
nicklas |
315 |
<a href="info/news.rss" |
7540 |
03 Dec 18 |
nicklas |
316 |
title="Subscribe to news from this BASE server" |
7540 |
03 Dec 18 |
nicklas |
317 |
><base:icon image="rss.png" style="float: right;" /></a> |
7540 |
03 Dec 18 |
nicklas |
318 |
<% |
7540 |
03 Dec 18 |
nicklas |
319 |
} |
5479 |
08 Nov 10 |
nicklas |
320 |
%> |
7540 |
03 Dec 18 |
nicklas |
321 |
</h3> |
7540 |
03 Dec 18 |
nicklas |
322 |
<div id="news" class="news"> |
5479 |
08 Nov 10 |
nicklas |
323 |
<% |
7540 |
03 Dec 18 |
nicklas |
324 |
if (broadcastTitle != null) |
7540 |
03 Dec 18 |
nicklas |
325 |
{ |
7540 |
03 Dec 18 |
nicklas |
326 |
%> |
7540 |
03 Dec 18 |
nicklas |
327 |
<div class="item note sticky"> |
7540 |
03 Dec 18 |
nicklas |
328 |
<div class="headline"> |
7540 |
03 Dec 18 |
nicklas |
329 |
<span class="date"><%=dateFormatter.format(new Date())%></span> |
7540 |
03 Dec 18 |
nicklas |
330 |
<%=HTML.encodeTags(broadcastTitle)%><%=denyLogin ? " (login disabled)" : "" %> |
7540 |
03 Dec 18 |
nicklas |
331 |
</div> |
7540 |
03 Dec 18 |
nicklas |
332 |
<div class="text"><%=HTML.niceFormat(broadcastMessage)%></div> |
5970 |
17 Feb 12 |
nicklas |
333 |
</div> |
7540 |
03 Dec 18 |
nicklas |
334 |
<% |
7540 |
03 Dec 18 |
nicklas |
335 |
} |
7540 |
03 Dec 18 |
nicklas |
336 |
|
7540 |
03 Dec 18 |
nicklas |
337 |
ItemQuery<News> query = News.getQuery(); |
7540 |
03 Dec 18 |
nicklas |
338 |
query.order(Orders.desc(Hql.property("sticky"))); |
7540 |
03 Dec 18 |
nicklas |
339 |
query.order(Orders.desc(Hql.property("newsDate"))); |
7540 |
03 Dec 18 |
nicklas |
340 |
query.order(Orders.desc(Hql.property("id"))); |
7540 |
03 Dec 18 |
nicklas |
341 |
query.setCacheResult(true); |
7540 |
03 Dec 18 |
nicklas |
342 |
query.setReturnTotalCount(true); |
7540 |
03 Dec 18 |
nicklas |
343 |
news = query.iterate(dc); |
7540 |
03 Dec 18 |
nicklas |
344 |
int numListed = 0; |
7540 |
03 Dec 18 |
nicklas |
345 |
while (news.hasNext()) |
7540 |
03 Dec 18 |
nicklas |
346 |
{ |
7540 |
03 Dec 18 |
nicklas |
347 |
News n = news.next(); |
7540 |
03 Dec 18 |
nicklas |
348 |
if (numListed >= 10 && !n.isSticky()) break; |
7540 |
03 Dec 18 |
nicklas |
349 |
%> |
7540 |
03 Dec 18 |
nicklas |
350 |
<div class="item <%=n.isSticky() ? "note sticky" : ""%>"> |
7540 |
03 Dec 18 |
nicklas |
351 |
<div class="headline"> |
7540 |
03 Dec 18 |
nicklas |
352 |
<span class="date"><%=dateFormatter.format(n.getNewsDate())%></span> |
7540 |
03 Dec 18 |
nicklas |
353 |
<%=HTML.encodeTags(n.getName())%> |
7540 |
03 Dec 18 |
nicklas |
354 |
</div> |
7540 |
03 Dec 18 |
nicklas |
355 |
<div class="text"><%=HTML.niceFormat(n.getDescription())%></div> |
7540 |
03 Dec 18 |
nicklas |
356 |
</div> |
7540 |
03 Dec 18 |
nicklas |
357 |
<% |
7540 |
03 Dec 18 |
nicklas |
358 |
numListed++; |
7540 |
03 Dec 18 |
nicklas |
359 |
} |
7540 |
03 Dec 18 |
nicklas |
360 |
if (numListed < news.getTotalCount()) |
7540 |
03 Dec 18 |
nicklas |
361 |
{ |
7540 |
03 Dec 18 |
nicklas |
362 |
%> |
7540 |
03 Dec 18 |
nicklas |
363 |
<base:icon image="bullet.png" /><a href="info/news.jsp" |
7540 |
03 Dec 18 |
nicklas |
364 |
title="Show older news..."><%=news.getTotalCount()-numListed%> more</a> |
7540 |
03 Dec 18 |
nicklas |
365 |
<% |
7540 |
03 Dec 18 |
nicklas |
366 |
} |
451 |
25 Apr 05 |
nicklas |
367 |
%> |
451 |
25 Apr 05 |
nicklas |
368 |
</div> |
415 |
18 Apr 05 |
nicklas |
369 |
<% |
451 |
25 Apr 05 |
nicklas |
370 |
} |
451 |
25 Apr 05 |
nicklas |
371 |
%> |
415 |
18 Apr 05 |
nicklas |
372 |
</td> |
415 |
18 Apr 05 |
nicklas |
373 |
</tr> |
415 |
18 Apr 05 |
nicklas |
374 |
</table> |
5918 |
21 Dec 11 |
nicklas |
375 |
|
5918 |
21 Dec 11 |
nicklas |
376 |
</form> |
415 |
18 Apr 05 |
nicklas |
377 |
</base:body> |
204 |
18 Mar 05 |
nicklas |
378 |
</base:page> |
204 |
18 Mar 05 |
nicklas |
379 |
<% |
377 |
08 Apr 05 |
nicklas |
380 |
} |
204 |
18 Mar 05 |
nicklas |
381 |
finally |
204 |
18 Mar 05 |
nicklas |
382 |
{ |
367 |
05 Apr 05 |
nicklas |
383 |
if (dc != null) dc.close(); |
204 |
18 Mar 05 |
nicklas |
384 |
} |
204 |
18 Mar 05 |
nicklas |
385 |
%> |
204 |
18 Mar 05 |
nicklas |
386 |
|