dont include known port on url

This commit is contained in:
Adrien MALINGREY 2024-10-20 00:29:41 +02:00
parent 4928b346b3
commit dba9e2e9b7
4 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,7 @@
<?php
$BASEDIR = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}" . dirname($_SERVER['SCRIPT_NAME']);
$port = (($_SERVER['REQUEST_SCHEME'] == "http" && $_SERVER['SERVER_PORT'] == 80) || ($_SERVER['REQUEST_SCHEME'] == "https" && $_SERVER['SERVER_PORT'] == 443)) ? "" : ":{$_SERVER['SERVER_PORT']}";
$BASEDIR = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}$port" . dirname($_SERVER['SCRIPT_NAME']);
$SCANSDIR = 'scans';
$NMAPDIR = dirname(`which nmap`) . "/../share/nmap";
$DATADIR = "datadir";

View File

@ -112,7 +112,7 @@ Exemples: 192.168.1.0/24 scanme.nmap.org 10.0-255.0-255.1-254"/>
<button id="refreshButton" class="ui teal icon submit button" type="submit" formmethod="get" formaction="{$basedir}/scan.php">
<i class="sync icon"></i>
</button>
<button class="ui teal icon submit button" type="submit" formmethod="get" formaction="{$basedir}/options.php">
<button class="ui teal icon submit button" type="submit" formmethod="get" formaction="{$basedir}/">
<i class="sliders horizontal icon"></i>
</button>
<a class="ui teal icon button" href="https://nmap.org/man/fr/index.html" target="_blank">

View File

@ -98,7 +98,7 @@ Exemples: 192.168.1.0/24 scanme.nmap.org 10.0-255.0-255.1-254"/>
<button id="refreshButton" class="ui teal icon submit button" type="submit" formmethod="get" formaction="{$basedir}/scan.php">
<i class="sync icon"></i>
</button>
<button class="ui teal icon submit button" type="submit" formmethod="get" formaction="{$basedir}/options.php">
<button class="ui teal icon submit button" type="submit" formmethod="get" formaction="{$basedir}/">
<i class="sliders horizontal icon"></i>
</button>
<a class="ui teal icon button" href="https://nmap.org/man/fr/index.html" target="_blank">
@ -307,7 +307,7 @@ function hostScanning(link) {
<a class="ui mini icon teal label">
<xsl:attribute name="href">
<xsl:value-of select="$basedir"/>
<xsl:text>/options.php?preset=host&amp;targets=</xsl:text>
<xsl:text>/?preset=host&amp;targets=</xsl:text>
<xsl:value-of select="$hostAddress"/>
</xsl:attribute>
<i class="sliders horizontal icon"></i>

View File

@ -98,7 +98,7 @@ Exemples: 192.168.1.0/24 scanme.nmap.org 10.0-255.0-255.1-254"/>
<button id="refreshButton" class="ui teal icon submit button" type="submit" formmethod="get" formaction="{$basedir}/scan.php">
<i class="sync icon"></i>
</button>
<button class="ui teal icon submit button" type="submit" formmethod="get" formaction="{$basedir}/options.php">
<button class="ui teal icon submit button" type="submit" formmethod="get" formaction="{$basedir}/">
<i class="sliders horizontal icon"></i>
</button>
<a class="ui teal icon button" href="https://nmap.org/man/fr/index.html" target="_blank">