rename saveAs to name
This commit is contained in:
parent
df4648e12a
commit
8e5f010da0
@ -109,7 +109,7 @@ if ($preset && isset($presets[$preset])) {
|
||||
'-h' => FILTER_VALIDATE_BOOLEAN,
|
||||
'--stylesheet' => FILTER_VALIDATE_URL,
|
||||
// lanScan
|
||||
'saveAs' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]],
|
||||
'name' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]],
|
||||
'originalURL' => FILTER_VALIDATE_URL,
|
||||
'refreshPeriod' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
||||
'sudo' => FILTER_VALIDATE_BOOLEAN,
|
||||
|
@ -632,10 +632,10 @@ foreach (scandir($SCANSDIR) as $filename) {
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="saveAsInput">Enregistrer sous le nom</label>
|
||||
<input id="saveAsInput" type="text" name="saveAs" placeholder="Réseau local" pattern='[^<>:"\\\/\|@?]+'
|
||||
<label for="nameInput">Enregistrer sous le nom</label>
|
||||
<input id="nameInput" type="text" name="name" placeholder="Réseau local" pattern='[^<>:"\\\/\|@?]+'
|
||||
title="Caractères interdits : <>:"\/|@?"
|
||||
value="<?= $options["saveAs"] ?? ""; ?>">
|
||||
value="<?= $options["name"] ?? ""; ?>">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="ui teal submit button">Démarrer</button>
|
||||
|
6
scan.php
6
scan.php
@ -41,7 +41,7 @@ $xml = new DOMDocument();
|
||||
$xml->load($tempPath);
|
||||
`rm "$tempPath"`;
|
||||
|
||||
$thisURL = $options["saveAs"]?? false ? "$BASEDIR/$SCANSDIR/".rawurlencode($options["saveAs"]).".xml" : "";
|
||||
$thisURL = $options["name"]?? false ? "$BASEDIR/$SCANSDIR/".rawurlencode($options["name"]).".xml" : "";
|
||||
$xml->insertBefore($xml->createProcessingInstruction('xslt-param', "name='thisURL' value='".htmlentities($thisURL, ENT_QUOTES)."'"), $xml->documentElement);
|
||||
foreach ($options as $option => $value) {
|
||||
if (substr($option, 0, 1) != '-') {
|
||||
@ -49,8 +49,8 @@ foreach ($options as $option => $value) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($options["saveAs"] ?? false) {
|
||||
$path = "$SCANSDIR/{$options["saveAs"]}.xml";
|
||||
if ($options["name"] ?? false) {
|
||||
$path = "$SCANSDIR/{$options["name"]}.xml";
|
||||
$xml->save($path);
|
||||
|
||||
header("Location: $path");
|
||||
|
@ -24,7 +24,7 @@
|
||||
<xsl:variable name="init" select="document($originalURL)/nmaprun"/>
|
||||
<xsl:variable name="nextComparison">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$thisURL"><xsl:value-of select="$saveAs"/></xsl:when>
|
||||
<xsl:when test="$thisURL"><xsl:value-of select="$thisURL"/></xsl:when>
|
||||
<xsl:when test="$originalURL"><xsl:value-of select="$originalURL"/></xsl:when>
|
||||
<xsl:otherwise></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
Reference in New Issue
Block a user