annotate src/global/web/tools/Index.java @ 64:f8a307aa811f

fix security hole
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 16 Sep 2024 20:53:23 -0600
parents 7ecd1a4ef557
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 package global.web.tools;
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 import java.io.IOException;
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 import java.io.PrintWriter;
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 import java.util.Date;
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 import javax.servlet.http.HttpServlet;
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 import javax.servlet.http.HttpServletRequest;
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 import javax.servlet.http.HttpServletResponse;
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 import global.Site;
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 public final class Index extends HttpServlet {
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 protected void service(HttpServletRequest request,HttpServletResponse response)
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 throws IOException
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 {
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 PrintWriter out = response.getWriter();
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 out.print( "\r\n<html>\r\n <head>\r\n <title>Nabble Global</title>\r\n <script type=\"text/javascript\">\r\n var months = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];\r\n function fmt(i) { return i <= 9? \"0\" + i : i; };\r\n function formatTime(date) {\r\n var hours = date.getHours();\r\n if( hours < 12 ) {\r\n var xm = \"am\";\r\n if (hours==0)\r\n hours = 12;\r\n } else {\r\n var xm = \"pm\";\r\n if (hours > 12)\r\n hours -= 12;\r\n }\r\n return fmt(hours) + \":\" + fmt(date.getMinutes()) + xm;\r\n };\r\n function formatDate(date) {\r\n return months[date.getMonth()] + \" \" + fmt(date.getDate()) + \", \" + date.getFullYear();\r\n };\r\n function formatDateTime(date) {\r\n return formatDate(date) + \"; \" + formatTime(date);\r\n };\r\n </script>\r\n </head>\r\n <body>\r\n <h1>Nabble Global</h1>\r\n <p class=\"gray\">\r\n Built time =\r\n <b>\r\n <script type=\"text/javascript\">\r\n document.write(formatDateTime(new Date(" );
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21 out.print( (new Date(ClassLoader.getSystemResource("global/web/Index.class").openConnection().getLastModified()).getTime()) );
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22 out.print( ")));\r\n </script>\r\n </b>\r\n </p>\r\n <form action=\"Search.jtp\">\r\n Search for: <input name=\"query\" />\r\n </form>\r\n <p><a href=\"Reindex.jtp\">Reindex</a></p>\r\n <p><a href=\"shell.luan\">Shell</a></p>\r\n <p><a href=\"run.luan\">Run Batch</a></p>\r\n <p><a href=\"/tools2\">Generic tools</a></p>\r\n </body>\r\n</html>\r\n" );
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
23
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24 }
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 }
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
27