20if (!defined(
'NOREQUIREUSER')) {
21 define(
'NOREQUIREUSER',
'1');
23if (!defined(
'NOREQUIREDB')) {
24 define(
'NOREQUIREDB',
'1');
26if (!defined(
'NOREQUIRESOC')) {
27 define(
'NOREQUIRESOC',
'1');
29if (!defined(
'NOREQUIRETRAN')) {
30 define(
'NOREQUIRETRAN',
'1');
32if (!defined(
'NOCSRFCHECK')) {
33 define(
'NOCSRFCHECK', 1);
35if (!defined(
'NOTOKENRENEWAL')) {
36 define(
'NOTOKENRENEWAL', 1);
38if (!defined(
'NOLOGIN')) {
41if (!defined(
'NOREQUIREMENU')) {
42 define(
'NOREQUIREMENU', 1);
44if (!defined(
'NOREQUIREHTML')) {
45 define(
'NOREQUIREHTML', 1);
47if (!defined(
'NOREQUIREAJAX')) {
48 define(
'NOREQUIREAJAX',
'1');
61if (!$res && !empty($_SERVER[
"CONTEXT_DOCUMENT_ROOT"])) {
62 $res = @include $_SERVER[
"CONTEXT_DOCUMENT_ROOT"].
"/main.inc.php";
65$tmp = empty($_SERVER[
'SCRIPT_FILENAME']) ?
'' : $_SERVER[
'SCRIPT_FILENAME'];
66$tmp2 = realpath(__FILE__);
68$j = strlen($tmp2) - 1;
69while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
73if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)).
"/main.inc.php")) {
74 $res = @include substr($tmp, 0, ($i + 1)).
"/main.inc.php";
76if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)).
"/../main.inc.php")) {
77 $res = @include substr($tmp, 0, ($i + 1)).
"/../main.inc.php";
80if (!$res && file_exists(
"../../main.inc.php")) {
81 $res = @include
"../../main.inc.php";
83if (!$res && file_exists(
"../../../main.inc.php")) {
84 $res = @include
"../../../main.inc.php";
87 die(
"Include of main fails");
91header(
'Content-Type: application/javascript');
94if (empty($dolibarr_nocache)) {
95 header(
'Cache-Control: max-age=3600, public, must-revalidate');
97 header(
'Cache-Control: no-cache');