Firewall-Masquerade avec interface http

crabs_firewall-3.0.1 ©2005-2011 - Christophe CAZAJUS (crabs-mettre_le_signe_at-crabs-world.com)

~~ / WWW / SITE / OLD / firewall.xsl
Makefile index.cgi graph.cgi firewall.xsl firewall.css firewall.js
    1 <?xml version="1.0" encoding="iso-8859-1" ?>
    2 <!--GPL-->
    3 <!--
    4    =============================================================================
    5     crabs_firewall-3.0.1 : Firewall-Masquerade avec interface http
    6     Copyright (C) 2005-2011 : Christophe CAZAJUS (crabs-mettre_le_signe_at-crabs-world.com)
    7 
    8     Ce source fait partie d'un projet logiciel libre. Vous pouvez le distribuer
    9     et/ou le modifier en respectant les termes de la GNU General Public License
   10     version 2 ou (suite a votre propre choix) une version ulterieure.
   11 
   12     Ce programme est distribue dans l'espoir qu'il puisse etre utile, mais
   13     sans aucune garantie, meme si il est associe a un produit qui vous en
   14     propose une. Conformez-vous a la GNU General Public License pour avoir
   15     plus de precisions.
   16 
   17     L'auteur ne peut etre tenu responsable de l'utilisation faite des
   18     composantes associees a ce projet (en partie ou dans leur totalite).
   19 
   20     Une copie du fichier de la GNU GPL est fournie dans le repertoire DOC
   21     de ce projet sous le nom gnu_gpl.txt
   22 
   23    =============================================================================
   24 -->
   25 <xsl:stylesheet
   26     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   27     version="1.0">
   28 <xsl:output encoding="iso-8859-1" method="html"
   29     doctype-public="-//W3C//DTD HTML 4.01//EN"
   30     doctype-system="http://www.w3.org/TR/html4/strict.dtd" />
   31 <xsl:preserve-space elements="table" />
   32 
   33 <!--
   34 ******
   35 ******  MENU: LES ITEMS, LES LISTE
   36 ******
   37 -->
   38 <xsl:template match="item">
   39     <p><a href="?mode={@mode}" onclick="return charge(this);">
   40         <xsl:value-of select="@nom"/>
   41     </a></p>
   42 </xsl:template>
   43 
   44 <xsl:template match="choix">
   45     <xsl:element name="option">
   46         <xsl:attribute name="value">
   47             <xsl:value-of select="@val"/>
   48         </xsl:attribute>
   49         <xsl:if test="//firewall/actif/@mode = ../@role">
   50             <xsl:if test="//firewall/actif/@courant = @val">
   51                 <xsl:attribute name="selected">selected</xsl:attribute>
   52             </xsl:if>
   53         </xsl:if>
   54         <xsl:value-of select="@nom"/>
   55     </xsl:element>
   56 </xsl:template>
   57 
   58 <xsl:template match="liste">
   59     <p class="liste"><xsl:value-of select="@nom"/> :</p>
   60     <div id="id_{@role}">
   61         <select size="2" onchange="change(this,'{@role}');">
   62             <xsl:apply-templates />
   63         </select>
   64     </div>
   65 </xsl:template>
   66 
   67 <!--
   68 ******
   69 ******  CONTENU: LES INLINES
   70 ******
   71 -->
   72 <xsl:template match="EM">
   73     <span class="EM"><xsl:apply-templates /></span>
   74 </xsl:template>
   75 <xsl:template match="em">
   76     <span class="em"><xsl:apply-templates /></span>
   77 </xsl:template>
   78 
   79 <!--
   80 ******
   81 ******  CONTENU: LES PARAGRAPHES
   82 ******
   83 -->
   84 <xsl:template match="info">
   85     <p class="info"><xsl:apply-templates /></p>
   86 </xsl:template>
   87 <xsl:template match="table">
   88     <h2>table : <xsl:value-of select="@nom"/></h2>
   89     <pre class="iptables"><xsl:apply-templates /></pre>
   90 </xsl:template>
   91 <xsl:template match="conf">
   92     <pre class="conf"><xsl:apply-templates /></pre>
   93 </xsl:template>
   94 <xsl:template match="log">
   95     <h2>fichier : <xsl:value-of select="@nom"/></h2>
   96     <pre class="log"><xsl:apply-templates /></pre>
   97 </xsl:template>
   98 <!--
   99 ******
  100 ******  CONTENU: LES STAT : saisie et affichage
  101 ******
  102 -->
  103 <xsl:template match="saisie">
  104     <form class="date" method="post" action="."><table>
  105         <tr><td>
  106             <b><xsl:text>Vmin : </xsl:text></b>
  107             <input type="text" name="pvi" size="8" value="{vi}"/>
  108         </td><td>
  109             <b><xsl:text>Vmax : </xsl:text></b>
  110             <input type="text" name="pva" size="8" value="{va}"/>
  111         </td><td>
  112             <b><xsl:text>Début : </xsl:text></b>
  113             <input type="text" name="pdd" size="8" value="{dd}"/>
  114         </td><td>
  115             <b><xsl:text>Fin : </xsl:text></b>
  116             <input type="text" name="pdf" size="8" value="{df}"/>
  117         </td><td>
  118             <input type="submit" name="ok" value="  Tracer  "/>
  119         </td><td>
  120             <input type="submit" name="auto" value="  Auto  "/>
  121         </td></tr>
  122         <input type="hidden" name="mode" value="stat"/>
  123         <input type="hidden" name="val" value="{dt}"/>
  124         <input type="hidden" name="last" value="{last}"/>
  125     </table></form>
  126 </xsl:template>
  127 
  128 <xsl:template match="graphique">
  129     <p class="image"><img style="{../@style}" alt="@nom"
  130         src="graph.cgi?{/firewall/ck}&amp;dt={../@date}&amp;wh={@type}"/></p>
  131 </xsl:template>
  132 
  133 <!--
  134 ******
  135 ******  LA PAGE
  136 ******
  137 -->
  138 <xsl:template match="/">
  139 <html>
  140 <head>
  141     <title><xsl:value-of select="firewall/nom"/> :
  142         <xsl:value-of select="firewall/page"/></title>
  143     <link rel="stylesheet" href="firewall.css" type="text/css" />
  144     <link rel="icon" href="../favicon.ico" type="image/x-icon"/>
  145     <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/>
  146 </head>
  147 <script type="text/javascript">
  148 var ck='<xsl:value-of select="firewall/ck"/>' ;
  149 </script>
  150 <script type="text/javascript" src="firewall.js">
  151 </script>
  152 <body>
  153     <h1><xsl:value-of select="firewall/nom"/> :
  154         <xsl:value-of select="firewall/page"/></h1>
  155     <div id="menu">
  156         <div class="carton">
  157             Mode : <xsl:value-of select="/firewall/@etat"/>
  158         </div>
  159         <xsl:apply-templates select="firewall/menu" />
  160     </div>
  161     <div id="contenu"><xsl:choose>
  162         <xsl:when test="/firewall/@mode = 'accueil'">
  163             <div class="cartouche">
  164             <xsl:apply-templates select="firewall/accueil" />
  165             </div>
  166         </xsl:when>
  167         <xsl:when test="/firewall/@mode = 'iptables'">
  168             <xsl:apply-templates select="firewall/iptables" />
  169         </xsl:when>
  170         <xsl:when test="/firewall/@mode = 'config'">
  171             <xsl:apply-templates select="firewall/configuration" />
  172         </xsl:when>
  173         <xsl:when test="/firewall/@mode = 'log'">
  174             <xsl:apply-templates select="firewall/logs" />
  175         </xsl:when>
  176         <xsl:when test="/firewall/@mode = 'stat'">
  177             <xsl:apply-templates select="firewall/stat" />
  178             <xsl:apply-templates select="firewall/graphiques" />
  179         </xsl:when>
  180         <xsl:otherwise>
  181             <p>Mode inconnu</p>
  182         </xsl:otherwise>
  183     </xsl:choose></div>
  184     <xsl:choose>
  185         <xsl:when test="/firewall/refresh">
  186 <script type="text/javascript">
  187 url='<xsl:value-of select="/firewall/refresh_url"/>' ;
  188 tm=<xsl:value-of select="/firewall/refresh"/> ;
  189 setTimeout('window.location.replace("'+url+'")', tm ) ;
  190 </script>
  191         </xsl:when>
  192     </xsl:choose>
  193 </body>
  194 </html>
  195 </xsl:template>
  196 
  197 </xsl:stylesheet>
  198 
Makefile index.cgi graph.cgi firewall.xsl firewall.css firewall.js
~~ / WWW / SITE / OLD / firewall.xsl

Haut de page

Contacter crabs

Date de génération : 22/09/2011 21:48