From 973dbe6fb2173cf6abe5e008c170c6c5a974ec1c Mon Sep 17 00:00:00 2001
From: str4d <str4d@mail.i2p>
Date: Thu, 2 Feb 2012 03:43:13 +0000
Subject: [PATCH] Don't display page 4 for server tunnels (tunnel destination)

---
 apps/i2ptunnel/jsp/wizard.jsp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp
index 5d5a4352b4..5870b739ee 100644
--- a/apps/i2ptunnel/jsp/wizard.jsp
+++ b/apps/i2ptunnel/jsp/wizard.jsp
@@ -8,6 +8,7 @@
 <jsp:useBean class="net.i2p.i2ptunnel.web.WizardBean" id="wizardBean" scope="request" />
 <jsp:useBean class="net.i2p.i2ptunnel.web.Messages" id="intl" scope="request" />
 <% String pageStr = request.getParameter("page");
+   /* Get the number of the page we came from */
    int lastPage = 0;
    if (pageStr != null) {
      try {
@@ -19,6 +20,7 @@
        lastPage = 0;
      }
    }
+   /* Determine what page to display now */
    int curPage = 1;
    if ("Previous page".equals(request.getParameter("action"))) {
      curPage = lastPage - 1;
@@ -28,8 +30,17 @@
    if (curPage > 7 || curPage <= 0) {
      curPage = 1;
    }
+   /* Fetch and format a couple of regularly-used values */
    boolean tunnelIsClient = Boolean.valueOf(request.getParameter("isClient"));
    String tunnelType = request.getParameter("type");
+   /* Special case - don't display page 4 for server tunnels */
+   if (curPage == 4 && !tunnelIsClient) {
+     if ("Previous page".equals(request.getParameter("action"))) {
+       curPage = curPage - 1;
+     } else {
+       curPage = curPage + 1;
+     }
+   }
 %>
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
-- 
GitLab