If the provided URL isn't valid, don't show the
[privoxy.git] / templates / show-url-info
1 ########################################################################
2 #
3 # File        :  $Source: /cvsroot/ijbswa/current/templates/show-url-info,v $
4 #
5 # Purpose     :  Template for Privoxy's show-url-info CGI page.
6 #
7 # Copyright   :  Written by and Copyright (C) 2001-2007 the SourceForge
8 #                Privoxy team. http://www.privoxy.org/
9 #
10 #                This program is free software; you can redistribute it 
11 #                and/or modify it under the terms of the GNU General
12 #                Public License as published by the Free Software
13 #                Foundation; either version 2 of the License, or (at
14 #                your option) any later version.
15 #
16 #                This program is distributed in the hope that it will
17 #                be useful, but WITHOUT ANY WARRANTY; without even the
18 #                implied warranty of MERCHANTABILITY or FITNESS FOR A
19 #                PARTICULAR PURPOSE.  See the GNU General Public
20 #                License for more details.
21 #
22 #                The GNU General Public License should be included with
23 #                this file.  If not, you can view it at
24 #                http://www.gnu.org/copyleft/gpl.html
25 #                or write to the Free Software Foundation, Inc., 59
26 #                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27 #
28 # Revisions   :
29 #    $Log: show-url-info,v $
30 #    Revision 1.25  2008/04/26 10:34:18  fabiankeil
31 #    If zlib support is unavailable and there are content filters active
32 #    but the prevent-compression action is disabled, include a warning
33 #    on the show-url-info page that compression might prevent filtering.
34 #
35 #    Revision 1.24  2008/02/10 17:26:52  fabiankeil
36 #    Reduce superfluous white space by not marking
37 #    up the final results list as paragraph.
38 #
39 #    Revision 1.23  2008/02/01 06:04:31  fabiankeil
40 #    If edit buttons on the show-url-info CGI page are hidden, explain why.
41 #
42 #    Revision 1.22  2007/12/08 14:29:06  fabiankeil
43 #    Use CSS to let the URL and pattern input fields scale with
44 #    the browser width and try to prevent vertical scroll bars
45 #    if the width is less than 80 characters. Closes #1843596,
46 #    thanks to Gerry Murphy and Lee.
47 #
48 #    Revision 1.21  2007/11/15 19:11:11  fabiankeil
49 #    Reword HTTPS URL information.
50 #
51 #    Revision 1.20  2007/07/21 12:19:50  fabiankeil
52 #    If show-url-info is called with an URL that Privoxy
53 #    would reject as invalid, don't show unresolved forwarding
54 #    variables, "final matches" or claim the site's secure.
55 #
56 #    Revision 1.19  2007/02/10 16:55:22  fabiankeil
57 #    - Show forwarding settings on the show-url-info page
58 #    - Fix some HTML syntax errors.
59 #
60 #
61 #########################################################################
62 # USING HTML TEMPLATES:
63 # ---------------------
64 #
65 # Template files are written win plain HTML, with a few
66 # additions:
67
68 # - Lines that start with a '#' character like this one
69 #   are ignored
70 #
71 # - Each item in the below list of exported symbols will
72 #   be replaced by dynamically generated text, if they
73 #   are enclosed in '@'-characters. E.g. The string @version@
74 #   will be replaced by the version number of Privoxy.
75 #
76 # - One special application of this is to make whole blocks
77 #   of the HTML template disappear if the condition <name>
78 #   is not given. Simply enclose the block between the two
79 #   strings @if-<name>start and if-<name>-end@. The strings
80 #   should be placed in HTML comments (<!-- -->), so the
81 #   html structure won't be messed when the magic happens.
82 #   
83 # USABLE SYMBOLS IN THIS TEMPLATE:
84 # --------------------------------
85 #
86 #  my-ip-addr:
87 #    The IP-address that the client used to reach Privoxy
88 #  my-hostname:
89 #    The hostname associated with my-ip-addr
90 #  admin-address:
91 #    The email address of the Privoxy administrator, as configured
92 #    in the config file
93 #  default-cgi:
94 #    The URL for Privoxy's "main menu" builtin CGI page
95 #  menu:
96 #    List of <li> elements linking to the other available CGIs
97 #  version:
98 #    Privoxy's version number
99 #  code-status:
100 #    Privoxy's development status: "alpha", "beta", or "stable".
101 #  homepage:
102 #    The Privoxy web site.
103 #
104 # CONDITIONAL SYMBOLS FOR THIS TEMPLATE AND THEIR DEPANDANT SYMBOLS:
105 # ------------------------------------------------------------------
106 #
107 #  unstable:
108 #    this is an alpha or beta release of the proxy software
109 #  have-adminaddr-info:
110 #    An e-mail address for the local Privoxy adminstrator has
111 #    been specified and is available through the "admin-address"
112 #    symbol
113 #  have-proxy-info:
114 #    A URL for online documentation about this proxy has been
115 #    specified and is available through the "proxy-info-url"
116 #    symbol
117 #  have-help-info:
118 #    If either have-proxy-info is true or have-adminaddr-info is
119 #    true, have-help-info is true.  Used to conditionally include
120 #    a grey box for any and all help info.
121 #  url-given:
122 #    The CGI was called with a url parameter. In that case, the
123 #    following symbols are available:
124 #    url:
125 #      The given URL
126 #    default:
127 #      The system default for actions
128 #    matches:
129 #      The list of all matches in the actions file that this URL
130 #      produced, along with the actions that were triggered by
131 #      these matches
132 #    final:
133 #      The actions that are associated with the URL at the end of
134 #      the matching process
135 #  no-forwarder: Requests to url will be made directly.
136 #  http-forwarder:
137 #      Requests to url will be made through a HTTP proxy
138 #      forward-host:
139 #         The IP address or its hostname
140 #      forward-port.
141 #         The proxy port
142 #  socks-forwarder:
143 #      Requests to url will be made through a socks proxy
144 #      socks-type:
145 #         The socks type: socks4 or socks4a
146 #      gateway-host:
147 #         The IP address or its hostname
148 #      gateway-port:
149 #         The proxy port.
150 #
151 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
152 <html>
153
154 <head>
155   <title>Privoxy@@my-hostname@ URL Info</title>
156   <meta http-equiv="Content-Style-Type" content="text/css">
157   <meta http-equiv="Content-Script-Type" content="text/javascript">
158   <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
159   <meta name="robots" content="noindex,nofollow">
160   <link rel="stylesheet" type="text/css" href="@default-cgi@send-stylesheet">
161   <link rel="shortcut icon" href="@default-cgi@favicon.ico" type="image/x-icon">
162 </head>
163
164 <body>
165
166   <table summary="" cellpadding="20" cellspacing="10" border="0" width="100%">
167     <tr>
168       <td class="title">
169
170 #include mod-title
171
172       </td>
173     </tr>
174
175 <!-- @if-unstable-start -->
176 # This will only appear if CODE_STATUS is "alpha" or "beta". See configure.in
177     <tr>
178       <td class="warning">
179
180 #include mod-unstable-warning
181
182       </td>
183     </tr>
184 <!-- if-unstable-end@ -->
185
186 <!-- @if-url-given-start -->
187     <tr>
188       <td class="box">
189 <!-- @if-valid-url-start -->
190         <h2>Forwarding settings:</h2>
191         <p>
192           Requests for <a href="@url@">@url@</a> will be <!--
193
194 # "Interesting" formatting to prevent white space at the end of the sentence.
195
196           @if-no-forwarder-start -->
197
198              made <b>directly</b>, no forwarding settings apply<!--
199
200           if-no-forwarder-end@--><!--
201           @if-http-forwarder-start --><!-- @if-socks-forwarder-start -->
202
203              first <!--
204
205           if-socks-forwarder-end@ --><!-- if-http-forwarder-end@ --><!--
206           @if-socks-forwarder-start -->
207
208              forwarded through <b>@socks-type@-proxy @gateway-host@:@gateway-port@</b><!--
209
210           if-socks-forwarder-end@ --><!--
211           @if-http-forwarder-start --><!-- @if-socks-forwarder-start -->
212
213              and then <!--
214
215           if-socks-forwarder-end@ --><!-- if-http-forwarder-end@ --><!--
216           @if-http-forwarder-start -->
217
218              forwarded through <b>HTTP-proxy @forward-host@:@forward-port@</b><!--
219
220           if-http-forwarder-end@ -->.
221       </td>
222     </tr>
223     <tr>
224       <td class="box">
225 <!-- @if-https-start -->
226         <h2>NOTE:</h2>
227         <p>This is a HTTPS URL, so the part after the "/" is ignored
228           as Privoxy doesn't see the path for real HTTPS requests either.</p>
229 <!-- if-https-end@ -->
230 <!-- if-valid-url-end@ -->
231         <h2>Matches for <a href="@url@">@url@</a>:</h2>
232         @matches@
233 <!-- @if-valid-url-start -->
234 <!-- @if-cgi-editor-is-disabled-start -->
235         <p>
236           The CGI editor is currently disabled, thus no edit buttons are shown.<br>
237           Please have a look at the
238            <a href="@user-manual@config.html#ENABLE-EDIT-ACTIONS">enable-edit-actions documentation</a>
239           to learn how to enable it and what the risks are.
240         </p>
241 <!--  if-cgi-editor-is-disabled-end@ -->
242 <!-- @if-valid-url-end -->
243       </td>
244     </tr>
245 <!-- @if-valid-url-start -->
246 <!-- @if-filters-might-be-ineffective-start -->
247     <tr>
248       <td class="warning">
249         <h2>Warning:</h2>
250         <p>
251           This Privoxy version has been build without zlib support,
252           <strong>content filters will not work if the server sends compressed content.</strong>
253           Consider enabling the <a title="prevent-compression documentation"
254            href="@user-manual@actions-file.html#PREVENT-COMPRESSION">prevent-compression</a>
255           action for this URL or rebuild Privoxy with zlib support.
256         </p>
257       </td>
258     </tr>
259 <!-- if-filters-might-be-ineffective-end@ -->
260     <tr>
261       <td class="box">
262         <h2>Final results:</h2>
263         <b>@final@</b>
264       </td>
265     </tr>
266 <!-- if-valid-url-end@ -->
267 <!-- if-url-given-end@ -->
268
269 <!-- @if-privoxy-is-toggled-off-start -->
270
271     <tr>
272       <td class="warning">
273         <h2>Warning:</h2>
274         <p>
275           <strong>Privoxy is currently toggled off. Matching actions will not apply
276           unless you <a href="@default-cgi@toggle?set=enable">toggle Privoxy on</a> first.</strong>
277         </p>
278       </td>
279     </tr>
280 <!-- if-privoxy-is-toggled-off-end@ -->
281
282     <tr>
283       <td class="box">
284         <h2>Look up the actions for a 
285 <!-- @if-url-given-start -->new<!-- if-url-given-end@ -->
286           URL:</h2>
287         <form method="GET" action="@default-cgi@show-url-info">
288           <p>
289             <input type="text" name="url" size="80" value="@url@" class="url"> 
290             <input type="submit" value="Go">
291           </p>
292         </form>
293       </td>
294     </tr>
295
296     <tr>
297       <td class="box">
298         <h2>More Privoxy:</h2>
299         <ul>@menu@<li><a href="@user-manual@">Documentation</a></li></ul>
300       </td>
301     </tr>
302
303     <tr>
304       <td class="info">
305
306 #include mod-support-and-service
307
308       </td>
309     </tr>
310
311 <!-- @if-have-help-info-start -->
312     <tr>
313       <td class="info">
314
315 #include mod-local-help
316
317       </td>
318     </tr>
319 <!-- if-have-help-info-end@ -->
320
321   </table>
322
323 </body>
324 </html>