diff --git a/htdocs/document.php b/htdocs/document.php index 0a6e5593f62..725d079a9f6 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -38,22 +38,25 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // For bittorent link, we don't need to load/check we are into a login session -if (isset($_GET["modulepart"]) && $_GET["modulepart"] == 'bittorrent' && ! defined("NOLOGIN")) +if (isset($_GET["modulepart"]) && $_GET["modulepart"] == 'bittorrent') { - define("NOLOGIN",1); - define("NOCSRFCHECK",1); // We accept to go on this page from external web site. + 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 } // For direct external download link, we don't need to load/check we are into a login session -if (isset($_GET["hashp"]) && ! defined("NOLOGIN")) +if (isset($_GET["hashp"])) { - define("NOLOGIN",1); - define("NOCSRFCHECK",1); // We accept to go on this page from external web site. + 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 } // Some value of modulepart can be used to get resources that are public so no login are required. -if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') && ! defined("NOLOGIN")) +if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) { - define("NOLOGIN",1); - define("NOCSRFCHECK",1); // We accept to go on this page from external web site. + 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 } /** diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index a53db61a83c..ffc0f3a6af5 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -37,19 +37,25 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Some value of modulepart can be used to get resources that are public so no login are required. -if ((isset($_GET["modulepart"]) && ($_GET["modulepart"] == 'mycompany' || $_GET["modulepart"] == 'companylogo')) && ! defined("NOLOGIN")) +if ((isset($_GET["modulepart"]) && ($_GET["modulepart"] == 'mycompany' || $_GET["modulepart"] == 'companylogo'))) { - define("NOLOGIN",'1'); + 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 } // For direct external download link, we don't need to load/check we are into a login session if (isset($_GET["hashp"]) && ! defined("NOLOGIN")) { - define("NOLOGIN",1); + 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 } // Some value of modulepart can be used to get resources that are public so no login are required. -if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') && ! defined("NOLOGIN")) +if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) { - define("NOLOGIN",'1'); + 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 // For multicompany $entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); if (is_numeric($entity)) define("DOLENTITY", $entity);