From b2895d80a5080d82a208c57fffd29772e8f90a2a Mon Sep 17 00:00:00 2001 From: tnegre Date: Wed, 11 Dec 2024 15:50:37 +0100 Subject: [PATCH] remove duplicate code --- htdocs/document.php | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/htdocs/document.php b/htdocs/document.php index daee2c04fc0c0..2ff8b606090e1 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -63,23 +63,7 @@ } // Some value of modulepart can be used to get resources that are public so no login are required. // Keep $_GET here, GETPOST is not available yet -if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) { - 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 - } -} - -// Deactivate checks for documents when coming from ticket public interface. -if ( - isset($_GET["modulepart"]) - && $_GET["modulepart"] == 'ticket' - ) { +if (isset($_GET["modulepart"]) && in_array($_GET["modulepart"], ['medias', 'ticket'])) { if (!defined("NOLOGIN")) { define("NOLOGIN", 1); }