source: apps/susidns/src/jsp/details.jsp @ cee45e3

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

SusiDNS: Add notes form (ticket #1433)

  • Property mode set to 100644
File size: 7.7 KB
Line 
1<%
2/*
3 *  This file is part of susidns project, see http://susi.i2p/
4 * 
5 *  Copyright (C) 2005 <susi23@mail.i2p>
6 *
7 *  This program is free software; you can redistribute it and/or modify
8 *  it under the terms of the GNU General Public License as published by
9 *  the Free Software Foundation; either version 2 of the License, or
10 *  (at your option) any later version.
11 *
12 *  This program is distributed in the hope that it will be useful,
13 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 *  GNU General Public License for more details.
16 *
17 *  You should have received a copy of the GNU General Public License
18 *  along with this program; if not, write to the Free Software
19 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20 * 
21 */
22
23    // http://www.crazysquirrel.com/computing/general/form-encoding.jspx
24    if (request.getCharacterEncoding() == null)
25        request.setCharacterEncoding("UTF-8");
26
27    response.setHeader("X-Frame-Options", "SAMEORIGIN");
28    response.setHeader("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'");
29    response.setHeader("X-XSS-Protection", "1; mode=block");
30    response.setHeader("X-Content-Type-Options", "nosniff");
31    response.setHeader("Referrer-Policy", "no-referrer");
32    response.setHeader("Accept-Ranges", "none");
33
34%>
35<%@page pageEncoding="UTF-8"%>
36<%@ page contentType="text/html"%>
37<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
38<jsp:useBean id="version" class="i2p.susi.dns.VersionBean" scope="application" />
39<jsp:useBean id="book" class="i2p.susi.dns.NamingServiceBean" scope="session" />
40<jsp:useBean id="intl" class="i2p.susi.dns.Messages" scope="application" />
41<jsp:setProperty name="book" property="*" />
42<jsp:setProperty name="book" property="resetDeletionMarks" value="1"/>
43<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
44<html>
45<head>
46<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
47<title>${book.book} <%=intl._t("addressbook")%> - susidns</title>
48<link rel="stylesheet" type="text/css" href="<%=book.getTheme()%>susidns.css?<%=net.i2p.CoreVersion.VERSION%>">
49</head>
50<body>
51<div class="page">
52<div id="logo">
53<a href="index"><img src="<%=book.getTheme()%>images/logo.png" alt="" title="<%=intl._t("Overview")%>" border="0"/></a>
54</div>
55<hr>
56<div id="navi">
57<a id="overview" href="index"><%=intl._t("Overview")%></a>&nbsp;
58<a class="abook" href="addressbook?book=private&amp;filter=none"><%=intl._t("Private")%></a>&nbsp;
59<a class="abook" href="addressbook?book=master&amp;filter=none"><%=intl._t("Master")%></a>&nbsp;
60<a class="abook" href="addressbook?book=router&amp;filter=none"><%=intl._t("Router")%></a>&nbsp;
61<a class="abook" href="addressbook?book=published&amp;filter=none"><%=intl._t("Published")%></a>&nbsp;
62<a id="subs" href="subscriptions"><%=intl._t("Subscriptions")%></a>&nbsp;
63<a id="config" href="config"><%=intl._t("Configuration")%></a>
64</div>
65<hr>
66<div class="headline">
67<h3><%=intl._t("Address book")%>: <%=intl._t(book.getBook())%></h3>
68<h4><%=intl._t("Storage")%>: ${book.displayName}</h4>
69</div>
70<div id="book">
71<%
72    String detail = request.getParameter("h");
73    if (detail == null) {
74        %><p>No host specified</p><%
75    } else {
76        // process save notes form
77        book.saveNotes();
78        detail = net.i2p.data.DataHelper.stripHTML(detail);
79        java.util.List<i2p.susi.dns.AddressBean> addrs = book.getLookupAll();
80        if (addrs == null) {
81            %><p>Not found: <%=detail%></p><%
82        } else {
83            boolean haveImagegen = book.haveImagegen();
84            // use one nonce for all
85            String nonce = book.getSerial();
86            for (i2p.susi.dns.AddressBean addr : addrs) {
87                String b32 = addr.getB32();
88%>
89<jsp:setProperty name="book" property="trClass" value="0" />
90<form method="POST" action="details">
91<input type="hidden" name="book" value="${book.book}">
92<input type="hidden" name="serial" value="<%=nonce%>">
93<input type="hidden" name="h" value="<%=detail%>">
94<input type="hidden" name="destination" value="<%=addr.getDestination()%>">
95<table class="book" id="host_details" cellspacing="0" cellpadding="5">
96<tr class="list${book.trClass}">
97<td><%=intl._t("Hostname")%></td>
98<td><a href="http://<%=addr.getName()%>/" target="_top"><%=addr.getDisplayName()%></a></td>
99</tr>
100<tr class="list${book.trClass}">
101<%
102    if (addr.isIDN()) {
103%>
104<td><%=intl._t("Encoded Name")%></td>
105<td><a href="http://<%=addr.getName()%>/" target="_top"><%=addr.getName()%></a></td>
106</tr>
107<tr class="list${book.trClass}">
108<%
109    }
110%>
111<td><%=intl._t("Base 32 Address")%></td>
112<td><a href="http://<%=b32%>/" target="_top"><%=b32%></a></td>
113</tr>
114<tr class="list${book.trClass}">
115<td><%=intl._t("Base 64 Hash")%></td>
116<td><%=addr.getB64()%></td>
117</tr>
118<tr class="list${book.trClass}">
119<td><%=intl._t("Address Helper")%></td>
120<td><a href="http://<%=addr.getName()%>/?i2paddresshelper=<%=addr.getDestination()%>" target="_top"><%=intl._t("link")%></a></td>
121</tr>
122<tr class="list${book.trClass}">
123<td><%=intl._t("Public Key")%></td>
124<td><%=intl._t("ElGamal 2048 bit")%></td>
125</tr>
126<tr class="list${book.trClass}">
127<td><%=intl._t("Signing Key")%></td>
128<td><%=addr.getSigType()%></td>
129</tr>
130<tr class="list${book.trClass}">
131<td><%=intl._t("Certificate")%></td>
132<td><%=addr.getCert()%></td>
133</tr>
134<tr class="list${book.trClass}">
135<td><%=intl._t("Added Date")%></td>
136<td><%=addr.getAdded()%></td>
137</tr>
138<tr class="list${book.trClass}">
139<td><%=intl._t("Validated")%></td>
140<td><%=addr.isValidated() ? intl._t("yes") : intl._t("no")%></td>
141</tr>
142<tr class="list${book.trClass}">
143<td><%=intl._t("Source")%></td>
144<td><%=addr.getSource()%></td>
145</tr>
146<tr class="list${book.trClass}">
147<td><%=intl._t("Last Modified")%></td>
148<td><%=addr.getModded()%></td>
149</tr>
150<tr class="list${book.trClass}">
151<td><%=intl._t("Destination")%></td>
152<td class="destinations"><div class="destaddress" tabindex="0"><%=addr.getDestination()%></div></td>
153</tr>
154<tr class="list${book.trClass}">
155<td><%=intl._t("Notes")%><br>
156<input class="accept" type="submit" name="action" value="<%=intl._t("Save Notes")%>"></td>
157<td><textarea name="nofilter_notes" rows="3" style="height:6em" wrap="off" cols="70"><%=addr.getNotes()%></textarea></td>
158</tr>
159</table>
160</form>
161<div id="buttons">
162<form method="POST" action="addressbook">
163<p class="buttons">
164<input type="hidden" name="book" value="${book.book}">
165<input type="hidden" name="serial" value="<%=nonce%>">
166<input type="hidden" name="begin" value="0">
167<input type="hidden" name="end" value="49">
168<input type="hidden" name="checked" value="<%=detail%>">
169<input type="hidden" name="destination" value="<%=addr.getDestination()%>">
170<input class="delete" type="submit" name="action" value="<%=intl._t("Delete Entry")%>" >
171</p>
172</form>
173</div><%-- buttons --%>
174<%
175                if (haveImagegen) {
176%>
177<div id="visualid">
178<h3><%=intl._t("Visual Identification for")%> <span id="idAddress"><%=addr.getName()%></span></h3>
179<table>
180<tr>
181<td><img src="/imagegen/id?s=256&amp;c=<%=addr.getB64().replace("=", "%3d")%>" width="256" height="256"></td>
182<td><img src="/imagegen/qr?s=384&amp;t=<%=addr.getName()%>&amp;c=http%3a%2f%2f<%=addr.getName()%>%2f%3fi2paddresshelper%3d<%=addr.getDestination()%>"></td>
183</tr>
184<tr>
185<td colspan="2"><a class="fakebutton" href="/imagegen" title="<%=intl._t("Create your own identification images")%>" target="_blank"><%=intl._t("Launch Image Generator")%></a></td>
186</tr>
187</table>
188</div><%-- visualid --%>
189<%
190                }  // haveImagegen
191%>
192<hr>
193<%
194            }  // foreach addr
195        }  // addrs == null
196    }  // detail == null
197%>
198</div><%-- book --%>
199<div id="footer">
200<p class="footer">susidns v${version.version} &copy; <a href="${version.url}" target="_top">susi</a> 2005</p>
201</div>
202</div><%-- page --%>
203</body>
204</html>
Note: See TracBrowser for help on using the repository browser.