Display warning if show-url-info CGI page
authorFabian Keil <fk@fabiankeil.de>
Sat, 20 Jan 2007 15:31:31 +0000 (15:31 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sat, 20 Jan 2007 15:31:31 +0000 (15:31 +0000)
is used while Privoxy is toggled off.

cgisimple.c
templates/show-url-info

index 4b0e78e..545bedc 100644 (file)
@@ -1,4 +1,4 @@
-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.46 2007/01/02 12:49:46 fabiankeil Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.47 2007/01/12 15:07:10 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
@@ -9,7 +9,7 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.46 2007/01/02 12:49:46 fabian
  *                Functions declared include:
  * 
  *
  *                Functions declared include:
  * 
  *
- * Copyright   :  Written by and Copyright (C) 2001-2006 the SourceForge
+ * Copyright   :  Written by and Copyright (C) 2001-2007 the SourceForge
  *                Privoxy team. http://www.privoxy.org/
  *
  *                Based on the Internet Junkbuster originally written
  *                Privoxy team. http://www.privoxy.org/
  *
  *                Based on the Internet Junkbuster originally written
@@ -36,6 +36,9 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.46 2007/01/02 12:49:46 fabian
  *
  * Revisions   :
  *    $Log: cgisimple.c,v $
  *
  * Revisions   :
  *    $Log: cgisimple.c,v $
+ *    Revision 1.47  2007/01/12 15:07:10  fabiankeil
+ *    Use zalloc in cgi_send_user_manual.
+ *
  *    Revision 1.46  2007/01/02 12:49:46  fabiankeil
  *    Add FEATURE_ZLIB to the list of conditional
  *    defines at the show-status page.
  *    Revision 1.46  2007/01/02 12:49:46  fabiankeil
  *    Add FEATURE_ZLIB to the list of conditional
  *    defines at the show-status page.
@@ -1244,6 +1247,19 @@ jb_err cgi_show_url_info(struct client_state *csp,
       url_param = url_param_prefixed;
    }
 
       url_param = url_param_prefixed;
    }
 
+   /*
+    * Hide "toggle off" warning if Privoxy is toggled on.
+    */
+   if (
+#ifdef FEATURE_TOGGLE
+       (global_toggle_state == 1) &&
+#endif /* def FEATURE_TOGGLE */
+       map_block_killer(exports, "privoxy-is-toggled-off")
+      )
+   {
+      free_map(exports);
+      return JB_ERR_MEMORY;
+   }
 
    if (url_param[0] == '\0')
    {
 
    if (url_param[0] == '\0')
    {
index 913a45a..86d03e8 100644 (file)
@@ -93,7 +93,7 @@
 
 <body>
 
 
 <body>
 
-  <table cellpadding="20" cellspacing="10" border="0" width="100%">
+  <table summary="" cellpadding="20" cellspacing="10" border="0" width="100%">
     <tr>
       <td class="title">
 
     <tr>
       <td class="title">
 
     </tr>
 <!-- if-url-given-end@ -->
 
     </tr>
 <!-- if-url-given-end@ -->
 
+<!-- @if-privoxy-is-toggled-off-start -->
+
+    <tr>
+      <td class="warning">
+        <h2>Warning:</h2>
+        <p>
+          <strong>Privoxy is currently toggled off. Matching actions will not apply
+          unless you <a href="@default-cgi@toggle?set=enable">toggle Privoxy on</a> first.</strong>
+        </p>
+      </td>
+    </tr>
+<!-- if-privoxy-is-toggled-off-end@ -->
+
     <tr>
       <td class="box">
         <h2>Look up the actions for a 
     <tr>
       <td class="box">
         <h2>Look up the actions for a 
       </td>
     </tr>
 <!-- if-have-help-info-end@ -->
       </td>
     </tr>
 <!-- if-have-help-info-end@ -->
-    
 
 
-     <tr>
-      <td>
-        <p class="small">Valid <a href="http://validator.w3.org/">HTML 4.01 Strict</a></p>
-      </td>
-    </tr>   
   </table>
 
 </body>
   </table>
 
 </body>