rename compareWith to original

This commit is contained in:
Adrien MALINGREY 2024-10-22 01:07:08 +02:00
parent f2af893303
commit f1bb88abec
8 changed files with 18 additions and 18 deletions

View File

@ -110,7 +110,7 @@ if ($preset && isset($presets[$preset])) {
'--stylesheet' => FILTER_VALIDATE_URL,
// lanScan
'saveAs' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]],
'compareWith' => FILTER_VALIDATE_URL,
'original' => FILTER_VALIDATE_URL,
'refreshPeriod' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
'sudo' => FILTER_VALIDATE_BOOLEAN,
], false) ?: $presets["default"];

View File

@ -593,8 +593,8 @@ foreach (scandir('templates') as $filename) {
</div>
<div class="field">
<label for="compareWithSelect">Comparer avec un précédent scan</label>
<select id="compareWithSelect" class="ui dropdown" name="compareWith" value="<?= $options["compareWith"] ?? "" ?>">
<label for="originalSelect">Comparer avec un précédent scan</label>
<select id="originalSelect" class="ui dropdown" name="original" value="<?= $options["original"] ?? "" ?>">
<option value="">Précédent scan</option>
<?php
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
@ -602,7 +602,7 @@ foreach (scandir($SCANSDIR) as $filename) {
if (substr($filename, -4) === '.xml') {
$name = substr($filename, 0, -4);
$URL = "$BASEDIR/$SCANSDIR/".rawurlencode($filename);
if (isset($options["compareWith"]) && $URL == $options["compareWith"]) {
if (isset($options["original"]) && $URL == $options["original"]) {
echo " <option value='$URL' selected>$name</option>\n";
} else {
echo " <option value='$URL'>$name</option>\n";

View File

@ -14,18 +14,18 @@
<xsl:strip-space elements='*'/>
<xsl:param name="savedAs" select=""/>
<xsl:param name="compareWith" select=""/>
<xsl:param name="original" select=""/>
<xsl:param name="refreshPeriod" select="0"/>
<xsl:param name="sudo" select="false"/>
<xsl:variable name="current" select="./nmaprun"/>
<xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href=&quot;'),'&quot;')"/>
<xsl:variable name="basedir" select="concat($stylesheetURL, '/../..')"/>
<xsl:variable name="init" select="document($compareWith)/nmaprun"/>
<xsl:variable name="init" select="document($original)/nmaprun"/>
<xsl:variable name="nextCompareWith">
<xsl:choose>
<xsl:when test="$savedAs"><xsl:value-of select="$savedAs"/></xsl:when>
<xsl:when test="$compareWith"><xsl:value-of select="$compareWith"/></xsl:when>
<xsl:when test="$original"><xsl:value-of select="$original"/></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>

View File

@ -13,18 +13,18 @@
<xsl:strip-space elements='*'/>
<xsl:param name="savedAs" select=""/>
<xsl:param name="compareWith" select=""/>
<xsl:param name="original" select=""/>
<xsl:param name="refreshPeriod" select="0"/>
<xsl:param name="sudo" select="false"/>
<xsl:variable name="current" select="./nmaprun"/>
<xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href=&quot;'),'&quot;')"/>
<xsl:variable name="basedir" select="concat($stylesheetURL, '/../..')"/>
<xsl:variable name="init" select="document($compareWith)/nmaprun"/>
<xsl:variable name="init" select="document($original)/nmaprun"/>
<xsl:variable name="nextCompareWith">
<xsl:choose>
<xsl:when test="$savedAs"><xsl:value-of select="$savedAs"/></xsl:when>
<xsl:when test="$compareWith"><xsl:value-of select="$compareWith"/></xsl:when>
<xsl:when test="$original"><xsl:value-of select="$original"/></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>

View File

@ -14,18 +14,18 @@
<xsl:strip-space elements='*'/>
<xsl:param name="savedAs" select=""/>
<xsl:param name="compareWith" select=""/>
<xsl:param name="original" select=""/>
<xsl:param name="refreshPeriod" select="0"/>
<xsl:param name="sudo" select="false"/>
<xsl:variable name="current" select="./nmaprun"/>
<xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href=&quot;'),'&quot;')"/>
<xsl:variable name="basedir" select="concat($stylesheetURL, '/../..')"/>
<xsl:variable name="init" select="document($compareWith)/nmaprun"/>
<xsl:variable name="init" select="document($original)/nmaprun"/>
<xsl:variable name="nextCompareWith">
<xsl:choose>
<xsl:when test="$savedAs"><xsl:value-of select="$savedAs"/></xsl:when>
<xsl:when test="$compareWith"><xsl:value-of select="$compareWith"/></xsl:when>
<xsl:when test="$original"><xsl:value-of select="$original"/></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>

View File

@ -28,7 +28,7 @@
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
<xsl:with-param name="asURL" select="true()"/>
</xsl:call-template>
<xsl:text>compareWith=</xsl:text>
<xsl:text>original=</xsl:text>
<xsl:value-of select="$nextCompareWith"/>
<xsl:text>&amp;refreshPeriod=</xsl:text>
<xsl:value-of select="$refreshPeriod"/>

View File

@ -31,7 +31,7 @@
Exemples: 192.168.1.0/24 scanme.nmap.org 10.0-255.0-255.1-254"/>
<i class="satellite dish icon"></i>
</div>
<input type="hidden" name="compareWith" value="{$nextCompareWith}"/>
<input type="hidden" name="original" value="{$nextCompareWith}"/>
<input type="hidden" name="refreshPeriod" value="{$refreshPeriod}"/>
<input type="hidden" name="sudo" value="{$sudo}"/>
<button id="hiddenButton" style="display: none;" type="submit" formmethod="get" formaction="{$basedir}/scan.php"></button>

View File

@ -13,18 +13,18 @@
<xsl:strip-space elements='*'/>
<xsl:param name="savedAs" select=""/>
<xsl:param name="compareWith" select=""/>
<xsl:param name="original" select=""/>
<xsl:param name="refreshPeriod" select="0"/>
<xsl:param name="sudo" select="false"/>
<xsl:variable name="current" select="./nmaprun"/>
<xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href=&quot;'),'&quot;')"/>
<xsl:variable name="basedir" select="concat($stylesheetURL, '/../..')"/>
<xsl:variable name="init" select="document($compareWith)/nmaprun"/>
<xsl:variable name="init" select="document($original)/nmaprun"/>
<xsl:variable name="nextCompareWith">
<xsl:choose>
<xsl:when test="$savedAs"><xsl:value-of select="$saveAs"/></xsl:when>
<xsl:when test="$compareWith"><xsl:value-of select="$compareWith"/></xsl:when>
<xsl:when test="$original"><xsl:value-of select="$original"/></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>