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']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
66while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
70if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)).
"/main.inc.php")) {
71 $res = @include substr($tmp, 0, ($i + 1)).
"/main.inc.php";
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";
77if (!$res && file_exists(
"../../main.inc.php")) {
78 $res = @include
"../../main.inc.php";
80if (!$res && file_exists(
"../../../main.inc.php")) {
81 $res = @include
"../../../main.inc.php";
84 die(
"Include of main fails");
88header(
'Content-Type: application/javascript');
91if (empty($dolibarr_nocache)) {
92 header(
'Cache-Control: max-age=3600, public, must-revalidate');
94 header(
'Cache-Control: no-cache');