Allow to view ticket linked files from public interface (#32410)

This commit is contained in:
ThomasNgr-OpenDSI
2025-11-19 15:26:59 +01:00
committed by GitHub
parent a605244dea
commit eaa05a482f
3 changed files with 61 additions and 4 deletions

View File

@@ -74,6 +74,16 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) {
if (!defined("NOIPCHECK")) {
define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
}
} elseif (isset($_GET["modulepart"]) && $_GET["modulepart"] == 'ticket' && strpos($_SERVER['HTTP_REFERER'], 'public/ticket') !== false) {
if (!defined("NOLOGIN")) {
define("NOLOGIN", 1);
}
if (!defined("NOCSRFCHECK")) {
define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
}
if (!defined("NOIPCHECK")) {
define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
}
}
/**
@@ -295,6 +305,16 @@ if (!empty($hashp)) {
}
}
}
} elseif ($modulepart == 'ticket' && !getDolGlobalString('TICKET_EMAIL_MUST_EXISTS')) {
if ($sqlprotectagainstexternals) {
$resql = $db->query($sqlprotectagainstexternals);
if ($resql) {
$num = $db->num_rows($resql);
if ($num > 0) {
$accessallowed = 1;
}
}
}
}
}