source: apps/susidns/src/jsp/addressbook.jsp @ f902a63

Last change on this file since f902a63 was f902a63, checked in by zzz <zzz@…>, 4 years ago

Console: Add Referrer-Policy header

  • Property mode set to 100644
File size: 9.7 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    response.setHeader("Referrer-Policy", "no-referrer");
35
36%>
37<%@page pageEncoding="UTF-8"%>
38<%@ page contentType="text/html"%>
39<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
40<jsp:useBean id="version" class="i2p.susi.dns.VersionBean" scope="application" />
41<jsp:useBean id="book" class="i2p.susi.dns.NamingServiceBean" scope="session" />
42<jsp:useBean id="intl" class="i2p.susi.dns.Messages" scope="application" />
43<jsp:setProperty name="book" property="*" />
44<jsp:setProperty name="book" property="resetDeletionMarks" value="1"/>
45<c:forEach items="${paramValues.checked}" var="checked">
46<jsp:setProperty name="book" property="markedForDeletion" value="${checked}"/>
47</c:forEach>
48<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
49<html>
50<head>
51<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
52<title>${book.book} <%=intl._t("address book")%> - susidns</title>
53<link rel="stylesheet" type="text/css" href="<%=book.getTheme()%>susidns.css?<%=net.i2p.CoreVersion.VERSION%>">
54</head>
55<body>
56<div class="page">
57<div id="logo">
58<a href="index"><img src="<%=book.getTheme()%>images/logo.png" alt="" title="<%=intl._t("Overview")%>" border="0"/></a>
59</div>
60<hr>
61<div id="navi">
62<p>
63<%=intl._t("Address books")%>:
64<a href="addressbook?book=private&amp;filter=none&amp;begin=0&amp;end=49"><%=intl._t("private")%></a> |
65<a href="addressbook?book=master&amp;filter=none&amp;begin=0&amp;end=49"><%=intl._t("master")%></a> |
66<a href="addressbook?book=router&amp;filter=none&amp;begin=0&amp;end=49"><%=intl._t("router")%></a> |
67<a href="addressbook?book=published&amp;filter=none&amp;begin=0&amp;end=49"><%=intl._t("published")%></a> *
68<a href="subscriptions"><%=intl._t("Subscriptions")%></a> *
69<a href="config"><%=intl._t("Configuration")%></a> *
70<a href="index"><%=intl._t("Overview")%></a>
71</p>
72</div>
73<hr>
74<div id="headline">
75<h3><%=intl._t("Address book")%>: <%=intl._t(book.getBook())%></h3>
76<h4><%=intl._t("Storage")%>: ${book.displayName}</h4>
77</div>
78
79<div id="messages">${book.messages}</div>
80
81${book.loadBookMessages}
82
83<c:if test="${book.notEmpty}">
84<div id="filter">
85<p><%=intl._t("Filter")%>:
86<a href="addressbook?filter=a&amp;begin=0&amp;end=49">a</a>
87<a href="addressbook?filter=b&amp;begin=0&amp;end=49">b</a>
88<a href="addressbook?filter=c&amp;begin=0&amp;end=49">c</a> 
89<a href="addressbook?filter=d&amp;begin=0&amp;end=49">d</a>
90<a href="addressbook?filter=e&amp;begin=0&amp;end=49">e</a>
91<a href="addressbook?filter=f&amp;begin=0&amp;end=49">f</a>
92<a href="addressbook?filter=g&amp;begin=0&amp;end=49">g</a>
93<a href="addressbook?filter=h&amp;begin=0&amp;end=49">h</a>
94<a href="addressbook?filter=i&amp;begin=0&amp;end=49">i</a>
95<a href="addressbook?filter=j&amp;begin=0&amp;end=49">j</a>
96<a href="addressbook?filter=k&amp;begin=0&amp;end=49">k</a>
97<a href="addressbook?filter=l&amp;begin=0&amp;end=49">l</a>
98<a href="addressbook?filter=m&amp;begin=0&amp;end=49">m</a>
99<a href="addressbook?filter=n&amp;begin=0&amp;end=49">n</a>
100<a href="addressbook?filter=o&amp;begin=0&amp;end=49">o</a>
101<a href="addressbook?filter=p&amp;begin=0&amp;end=49">p</a>
102<a href="addressbook?filter=q&amp;begin=0&amp;end=49">q</a>
103<a href="addressbook?filter=r&amp;begin=0&amp;end=49">r</a>
104<a href="addressbook?filter=s&amp;begin=0&amp;end=49">s</a>
105<a href="addressbook?filter=t&amp;begin=0&amp;end=49">t</a>
106<a href="addressbook?filter=u&amp;begin=0&amp;end=49">u</a>
107<a href="addressbook?filter=v&amp;begin=0&amp;end=49">v</a>
108<a href="addressbook?filter=w&amp;begin=0&amp;end=49">w</a>
109<a href="addressbook?filter=x&amp;begin=0&amp;end=49">x</a>
110<a href="addressbook?filter=y&amp;begin=0&amp;end=49">y</a>
111<a href="addressbook?filter=z&amp;begin=0&amp;end=49">z</a>
112<a href="addressbook?filter=0-9&amp;begin=0&amp;end=49">0-9</a>
113<a href="addressbook?filter=xn--&amp;begin=0&amp;end=49"><%=intl._t("other")%></a>
114<a href="addressbook?filter=none&amp;begin=0&amp;end=49"><%=intl._t("all")%></a></p>
115<c:if test="${book.hasFilter}">
116<p><%=intl._t("Current filter")%>: ${book.filter}
117(<a href="addressbook?filter=none&amp;begin=0&amp;end=49"><%=intl._t("clear filter")%></a>)</p>
118</c:if>
119</div>
120
121<div id="search">
122<form method="POST" action="addressbook">
123<input type="hidden" name="begin" value="0">
124<input type="hidden" name="end" value="49">
125<table><tr>
126<td class="search"><%=intl._t("Search")%>: <input class="search" type="text" name="search" value="${book.search}" size="20" ></td>
127<td class="search"><input class="search" type="submit" name="submitsearch" value="<%=intl._t("Search")%>" ></td>
128</tr>
129</table>
130</form></div>
131</c:if>
132
133<%
134    // have to only do this once per page
135    String susiNonce = book.getSerial();
136%>
137<c:if test="${book.notEmpty}">
138<form method="POST" action="addressbook">
139<input type="hidden" name="serial" value="<%=susiNonce%>">
140<input type="hidden" name="begin" value="0">
141<input type="hidden" name="end" value="49">
142<jsp:setProperty name="book" property="trClass" value="0" />
143<div id="book">
144<table class="book" cellspacing="0" cellpadding="5">
145<tr class="head">
146
147<c:if test="${book.validBook}">
148<th>&nbsp;</th>
149</c:if>
150
151<% if (book.getEntries().length > 0) { /* Don't show if no results. Can't figure out how to do this with c:if */ %>
152<th><%=intl._t("Name")%></th>
153<th colspan="2"><%=intl._t("Links")%></th>
154<th><%=intl._t("Destination")%></th>
155</tr>
156<!-- limit iterator, or "Form too large" may result on submit, and is a huge web page if we don't -->
157<c:forEach items="${book.entries}" var="addr" begin="${book.resultBegin}" end="${book.resultEnd}">
158<tr class="list${book.trClass}">
159<c:if test="${book.validBook}">
160<td class="checkbox"><input type="checkbox" name="checked" value="${addr.name}" title="<%=intl._t("Mark for deletion")%>"></td>
161</c:if>
162<td class="names"><a href="http://${addr.name}/" target="_top">${addr.displayName}</a>
163</td><td class="names">
164<span class="addrhlpr"><a href="http://${addr.b32}/" target="_top" title="<%=intl._t("Base 32 address")%>">b32</a></span>
165</td><td class="names">
166<span class="addrhlpr"><a href="details?h=${addr.name}" title="<%=intl._t("More information on this entry")%>"><%=intl._t("details")%></a></span>
167</td>
168<td class="destinations"><textarea rows="1" style="height:3em;" wrap="off" cols="40" readonly="readonly" name="dest_${addr.name}" >${addr.destination}</textarea></td>
169</tr>
170</c:forEach>
171<% } /* book..getEntries().length() > 0 */ %>
172</table>
173</div>
174
175<% if (book.getEntries().length > 0) { /* Don't show if no results. Can't figure out how to do this with c:if */ %>
176<c:if test="${book.validBook}">
177<div id="buttons">
178<p class="buttons">
179<input class="cancel" type="reset" value="<%=intl._t("Cancel")%>" >
180<input class="delete" type="submit" name="action" value="<%=intl._t("Delete Selected")%>" >
181</p>
182</div>
183</c:if>
184<% } /* book..getEntries().length() > 0 */ %>
185</form>
186
187<% if (book.getEntries().length > 0) { /* Don't show if no results. Can't figure out how to do this with c:if */ %>
188<form action="export" method="GET" target="_top">
189<div id="buttons">
190<p class="buttons">
191<input type="hidden" name="book" value="${book.book}">
192<c:if test="${book.search} != null && ${book.search}.length() > 0">
193<input type="hidden" name="search" value="${book.search}">
194</c:if>
195<c:if test="${book.hasFilter}">
196<input type="hidden" name="filter" value="${book.filter}">
197</c:if>
198<input type="submit" class="export" value="<%=intl._t("Export in hosts.txt format")%>" />
199</p></div></form>
200<% } /* book..getEntries().length() > 0 */ %>
201
202</c:if><% /* book.notEmpty */ %>
203
204<c:if test="${book.isEmpty}">
205<div id="book">
206<p class="book"><%=intl._t("This address book is empty.")%></p>
207</div>
208</c:if>
209
210<form method="POST" action="addressbook">
211<input type="hidden" name="serial" value="<%=susiNonce%>">
212<input type="hidden" name="begin" value="0">
213<input type="hidden" name="end" value="49">
214<div id="add">
215<h3><%=intl._t("Add new destination")%>:</h3>
216<table><tr><td>
217<b><%=intl._t("Host Name")%></b></td><td><input type="text" name="hostname" value="${book.hostname}" size="54">
218</td></tr><tr><td>
219<b><%=intl._t("Destination")%></b></td><td><textarea name="destination" rows="1" style="height:3em" wrap="off" cols="70" spellcheck="false">${book.destination}</textarea>
220</td></tr></table>
221<p class="buttons">
222<input class="cancel" type="reset" value="<%=intl._t("Cancel")%>" >
223<input class="accept" type="submit" name="action" value="<%=intl._t("Replace")%>" >
224<input class="add" type="submit" name="action" value="<%=intl._t("Add")%>" >
225</p>
226</div></form>
227
228<div id="footer">
229<hr>
230<p class="footer">susidns v${version.version} &copy; <a href="${version.url}" target="_top">susi</a> 2005</p>
231</div>
232</div>
233</body>
234</html>
Note: See TracBrowser for help on using the repository browser.