source: apps/susidns/src/jsp/addressbook.jsp @ 248deae

Last change on this file since 248deae was 248deae, checked in by zzz <zzz@…>, 5 years ago

Console: Add X-Content-Type-Options header everywhere (ticket #1763)

  • Property mode set to 100644
File size: 9.8 KB
Line 
1<%
2/*
3 * Created on Sep 02, 2005
4 *
5 *  This file is part of susidns project, see http://susi.i2p/
6 * 
7 *  Copyright (C) 2005 <susi23@mail.i2p>
8 *
9 *  This program is free software; you can redistribute it and/or modify
10 *  it under the terms of the GNU General Public License as published by
11 *  the Free Software Foundation; either version 2 of the License, or
12 *  (at your option) any later version.
13 *
14 *  This program is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *  GNU General Public License for more details.
18 *
19 *  You should have received a copy of the GNU General Public License
20 *  along with this program; if not, write to the Free Software
21 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22 * 
23 * $Revision: 1.3 $
24 */
25
26    // http://www.crazysquirrel.com/computing/general/form-encoding.jspx
27    if (request.getCharacterEncoding() == null)
28        request.setCharacterEncoding("UTF-8");
29
30    response.setHeader("X-Frame-Options", "SAMEORIGIN");
31    response.setHeader("Content-Security-Policy", "default-src 'self'");
32    response.setHeader("X-XSS-Protection", "1; mode=block");
33    response.setHeader("X-Content-Type-Options", "nosniff");
34
35%>
36<%@page pageEncoding="UTF-8"%>
37<%@ page contentType="text/html"%>
38<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
39<jsp:useBean id="version" class="i2p.susi.dns.VersionBean" scope="application" />
40<jsp:useBean id="book" class="i2p.susi.dns.NamingServiceBean" scope="session" />
41<jsp:useBean id="intl" class="i2p.susi.dns.Messages" scope="application" />
42<jsp:setProperty name="book" property="*" />
43<jsp:setProperty name="book" property="resetDeletionMarks" value="1"/>
44<c:forEach items="${paramValues.checked}" var="checked">
45<jsp:setProperty name="book" property="markedForDeletion" value="${checked}"/>
46</c:forEach>
47<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
48<html>
49<head>
50<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
51<title>${book.book} <%=intl._t("address book")%> - susidns</title>
52<link rel="stylesheet" type="text/css" href="<%=book.getTheme()%>susidns.css">
53</head>
54<body>
55<div class="page">
56<div id="logo">
57<a href="index"><img src="<%=book.getTheme()%>images/logo.png" alt="" title="<%=intl._t("Overview")%>" border="0"/></a>
58</div>
59<hr>
60<div id="navi">
61<p>
62<%=intl._t("Address books")%>:
63<a href="addressbook?book=private&amp;filter=none&amp;begin=0&amp;end=49"><%=intl._t("private")%></a> |
64<a href="addressbook?book=master&amp;filter=none&amp;begin=0&amp;end=49"><%=intl._t("master")%></a> |
65<a href="addressbook?book=router&amp;filter=none&amp;begin=0&amp;end=49"><%=intl._t("router")%></a> |
66<a href="addressbook?book=published&amp;filter=none&amp;begin=0&amp;end=49"><%=intl._t("published")%></a> *
67<a href="subscriptions"><%=intl._t("Subscriptions")%></a> *
68<a href="config"><%=intl._t("Configuration")%></a> *
69<a href="index"><%=intl._t("Overview")%></a>
70</p>
71</div>
72<hr>
73<div id="headline">
74<h3><%=intl._t("Address book")%>: <%=intl._t(book.getBook())%></h3>
75<h4><%=intl._t("Storage")%>: ${book.displayName}</h4>
76</div>
77
78<div id="messages">${book.messages}</div>
79
80${book.loadBookMessages}
81
82<c:if test="${book.notEmpty}">
83<div id="filter">
84<p><%=intl._t("Filter")%>:
85<a href="addressbook?filter=a&amp;begin=0&amp;end=49">a</a>
86<a href="addressbook?filter=b&amp;begin=0&amp;end=49">b</a>
87<a href="addressbook?filter=c&amp;begin=0&amp;end=49">c</a> 
88<a href="addressbook?filter=d&amp;begin=0&amp;end=49">d</a>
89<a href="addressbook?filter=e&amp;begin=0&amp;end=49">e</a>
90<a href="addressbook?filter=f&amp;begin=0&amp;end=49">f</a>
91<a href="addressbook?filter=g&amp;begin=0&amp;end=49">g</a>
92<a href="addressbook?filter=h&amp;begin=0&amp;end=49">h</a>
93<a href="addressbook?filter=i&amp;begin=0&amp;end=49">i</a>
94<a href="addressbook?filter=j&amp;begin=0&amp;end=49">j</a>
95<a href="addressbook?filter=k&amp;begin=0&amp;end=49">k</a>
96<a href="addressbook?filter=l&amp;begin=0&amp;end=49">l</a>
97<a href="addressbook?filter=m&amp;begin=0&amp;end=49">m</a>
98<a href="addressbook?filter=n&amp;begin=0&amp;end=49">n</a>
99<a href="addressbook?filter=o&amp;begin=0&amp;end=49">o</a>
100<a href="addressbook?filter=p&amp;begin=0&amp;end=49">p</a>
101<a href="addressbook?filter=q&amp;begin=0&amp;end=49">q</a>
102<a href="addressbook?filter=r&amp;begin=0&amp;end=49">r</a>
103<a href="addressbook?filter=s&amp;begin=0&amp;end=49">s</a>
104<a href="addressbook?filter=t&amp;begin=0&amp;end=49">t</a>
105<a href="addressbook?filter=u&amp;begin=0&amp;end=49">u</a>
106<a href="addressbook?filter=v&amp;begin=0&amp;end=49">v</a>
107<a href="addressbook?filter=w&amp;begin=0&amp;end=49">w</a>
108<a href="addressbook?filter=x&amp;begin=0&amp;end=49">x</a>
109<a href="addressbook?filter=y&amp;begin=0&amp;end=49">y</a>
110<a href="addressbook?filter=z&amp;begin=0&amp;end=49">z</a>
111<a href="addressbook?filter=0-9&amp;begin=0&amp;end=49">0-9</a>
112<a href="addressbook?filter=xn--&amp;begin=0&amp;end=49"><%=intl._t("other")%></a>
113<a href="addressbook?filter=none&amp;begin=0&amp;end=49"><%=intl._t("all")%></a></p>
114<c:if test="${book.hasFilter}">
115<p><%=intl._t("Current filter")%>: ${book.filter}
116(<a href="addressbook?filter=none&amp;begin=0&amp;end=49"><%=intl._t("clear filter")%></a>)</p>
117</c:if>
118</div>
119
120<div id="search">
121<form method="POST" action="addressbook">
122<input type="hidden" name="begin" value="0">
123<input type="hidden" name="end" value="49">
124<table><tr>
125<td class="search"><%=intl._t("Search")%>: <input class="search" type="text" name="search" value="${book.search}" size="20" ></td>
126<td class="search"><input class="search" type="submit" name="submitsearch" value="<%=intl._t("Search")%>" ></td>
127</tr>
128</table>
129</form></div>
130</c:if>
131
132<%
133    // have to only do this once per page
134    String susiNonce = book.getSerial();
135%>
136<c:if test="${book.notEmpty}">
137<form method="POST" action="addressbook">
138<input type="hidden" name="serial" value="<%=susiNonce%>">
139<input type="hidden" name="begin" value="0">
140<input type="hidden" name="end" value="49">
141<jsp:setProperty name="book" property="trClass" value="0" />
142<div id="book">
143<table class="book" cellspacing="0" cellpadding="5">
144<tr class="head">
145
146<c:if test="${book.master || book.router || book.published || book.private}">
147<th>&nbsp;</th>
148</c:if>
149
150<% if (book.getEntries().length > 0) { /* Don't show if no results. Can't figure out how to do this with c:if */ %>
151<th><%=intl._t("Name")%></th>
152<th colspan="2"><%=intl._t("Links")%></th>
153<th><%=intl._t("Destination")%></th>
154</tr>
155<!-- limit iterator, or "Form too large" may result on submit, and is a huge web page if we don't -->
156<c:forEach items="${book.entries}" var="addr" begin="${book.resultBegin}" end="${book.resultEnd}">
157<tr class="list${book.trClass}">
158<c:if test="${book.master || book.router || book.published || book.private}">
159<td class="checkbox"><input type="checkbox" name="checked" value="${addr.name}" title="<%=intl._t("Mark for deletion")%>"></td>
160</c:if>
161<td class="names"><a href="http://${addr.name}/" target="_top">${addr.displayName}</a>
162</td><td class="names">
163<span class="addrhlpr"><a href="http://${addr.b32}/" target="_top" title="<%=intl._t("Base 32 address")%>">b32</a></span>
164</td><td class="names">
165<span class="addrhlpr"><a href="details?h=${addr.name}" title="<%=intl._t("More information on this entry")%>"><%=intl._t("details")%></a></span>
166</td>
167<td class="destinations"><textarea rows="1" style="height:3em;" wrap="off" cols="40" readonly="readonly" name="dest_${addr.name}" >${addr.destination}</textarea></td>
168</tr>
169</c:forEach>
170<% } /* book..getEntries().length() > 0 */ %>
171</table>
172</div>
173
174<% if (book.getEntries().length > 0) { /* Don't show if no results. Can't figure out how to do this with c:if */ %>
175<c:if test="${book.master || book.router || book.published || book.private}">
176<div id="buttons">
177<p class="buttons">
178<input class="cancel" type="reset" value="<%=intl._t("Cancel")%>" >
179<input class="delete" type="submit" name="action" value="<%=intl._t("Delete Selected")%>" >
180</p>
181</div>
182</c:if>
183<% } /* book..getEntries().length() > 0 */ %>
184</form>
185
186<% if (book.getEntries().length > 0) { /* Don't show if no results. Can't figure out how to do this with c:if */ %>
187<form action="export" method="GET" target="_top">
188<div id="buttons">
189<p class="buttons">
190<input type="hidden" name="book" value="${book.book}">
191<c:if test="${book.search} != null && ${book.search}.length() > 0">
192<input type="hidden" name="search" value="${book.search}">
193</c:if>
194<c:if test="${book.hasFilter}">
195<input type="hidden" name="filter" value="${book.filter}">
196</c:if>
197<input type="submit" class="export" value="<%=intl._t("Export in hosts.txt format")%>" />
198</p></div></form>
199<% } /* book..getEntries().length() > 0 */ %>
200
201</c:if><% /* book.notEmpty */ %>
202
203<c:if test="${book.isEmpty}">
204<div id="book">
205<p class="book"><%=intl._t("This address book is empty.")%></p>
206</div>
207</c:if>
208
209<form method="POST" action="addressbook">
210<input type="hidden" name="serial" value="<%=susiNonce%>">
211<input type="hidden" name="begin" value="0">
212<input type="hidden" name="end" value="49">
213<div id="add">
214<h3><%=intl._t("Add new destination")%>:</h3>
215<table><tr><td>
216<b><%=intl._t("Host Name")%></b></td><td><input type="text" name="hostname" value="${book.hostname}" size="54">
217</td></tr><tr><td>
218<b><%=intl._t("Destination")%></b></td><td><textarea name="destination" rows="1" style="height:3em" wrap="off" cols="70" spellcheck="false">${book.destination}</textarea>
219</td></tr></table>
220<p class="buttons">
221<input class="cancel" type="reset" value="<%=intl._t("Cancel")%>" >
222<input class="accept" type="submit" name="action" value="<%=intl._t("Replace")%>" >
223<input class="add" type="submit" name="action" value="<%=intl._t("Add")%>" >
224</p>
225</div></form>
226
227<div id="footer">
228<hr>
229<p class="footer">susidns v${version.version} &copy; <a href="${version.url}" target="_top">susi</a> 2005</p>
230</div>
231</div>
232</body>
233</html>
Note: See TracBrowser for help on using the repository browser.