source: apps/syndie/jsp/addaddress.jsp @ d4a8595

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

2005-09-04 jrandom

  • Don't persist peer profiles until we are shutting down, as the persistence process gobbles RAM and wall time.
  • Bugfix to allow you to check/uncheck the sharedClient setting on the I2PTunnel web interface.
  • Be more careful when expiring a failed tunnel message fragment so we don't drop the data while attempting to read it.
  • Property mode set to 100644
File size: 2.4 KB
Line 
1<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="net.i2p.data.*, net.i2p.syndie.web.*, net.i2p.syndie.sml.*, net.i2p.syndie.*" %>
2<% request.setCharacterEncoding("UTF-8"); %>
3<jsp:useBean scope="session" class="net.i2p.syndie.User" id="user" />
4<html>
5<head>
6<title>SyndieMedia</title>
7<link href="style.jsp" rel="stylesheet" type="text/css" />
8</head>
9<body>
10<table border="1" cellpadding="0" cellspacing="0" width="100%">
11<tr><td colspan="5" valign="top" align="left"><jsp:include page="_toplogo.jsp" /></td></tr>
12<tr><td valign="top" align="left" rowspan="2"><jsp:include page="_leftnav.jsp" /></td>
13    <jsp:include page="_topnav.jsp" />
14    <td valign="top" align="left" rowspan="2"><jsp:include page="_rightnav.jsp" /></td></tr>
15<tr><td valign="top" align="left" colspan="3"><%
16String nameStr = request.getParameter("name");
17String protoStr = request.getParameter("proto");
18String locStr = request.getParameter("location");
19String schemaStr = request.getParameter("schema");
20String name = null;
21String proto = null;
22String location = null;
23String schema = null;
24try {
25    name = DataHelper.getUTF8(Base64.decode(nameStr));
26    if ( (protoStr != null) && (protoStr.trim().length() > 0) )
27      proto = DataHelper.getUTF8(Base64.decode(protoStr));
28    location = DataHelper.getUTF8(Base64.decode(locStr));
29    schema = DataHelper.getUTF8(Base64.decode(schemaStr));
30} catch (NullPointerException npe) {
31    // ignore
32}
33
34if ( (name == null) || (location == null) || (schema == null) ) {
35  out.write("<b>No location specified</b>");
36} else if (user.getAuthenticated() && ("Add".equals(request.getParameter("action"))) ) {
37  out.write("<b>" + BlogManager.instance().addAddress(user, name, proto, location, schema) + "</b>");
38} else { %>Are you sure you really want to add the
39addressbook mapping of <%=HTMLRenderer.sanitizeString(name)%> to
40<input type="text" size="20" value="<%=HTMLRenderer.sanitizeString(location)%>" />, applicable within the
41schema <%=HTMLRenderer.sanitizeString(schema)%>
42<%  if (!user.getAuthenticated()) { %>
43<p />If so, add the line
44<input type="text" size="20" value="<%=HTMLRenderer.sanitizeString(name)%>=<%=HTMLRenderer.sanitizeString(location)%>" />
45to your <code>userhosts.txt</code>.
46<%   } else { %><br />
47<a href="addaddress.jsp?name=<%=HTMLRenderer.sanitizeURL(name)%>&location=<%=HTMLRenderer.sanitizeURL(location)%>&schema=<%=HTMLRenderer.sanitizeURL(schema)%>&action=Add">Yes, add it</a>.
48<%   } 
49} %></td></tr>
50</table>
51</body>
Note: See TracBrowser for help on using the repository browser.