33 if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL', 1);
34 if (!defined(
'NOLOGIN')) define(
"NOLOGIN", 1);
35 if (!defined(
'NOCSRFCHECK')) define(
"NOCSRFCHECK", 1);
36 if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU',
'1');
37 if (!defined(
'NOREQUIREHTML')) define(
'NOREQUIREHTML',
'1');
38 if (!defined(
'NOREQUIREAJAX')) define(
'NOREQUIREAJAX',
'1');
39 if (!defined(
'NOIPCHECK')) define(
'NOIPCHECK',
'1');
40 if (!defined(
'NOBROWSERNOTIF')) define(
'NOBROWSERNOTIF',
'1');
59 require
'../../master.inc.php';
60 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
64 $websitekey =
GETPOST(
'website',
'alpha');
66 $pageref =
GETPOST(
'pageref',
'alphanohtml') ?
GETPOST(
'pageref',
'alphanohtml') :
'';
74 require_once DOL_DOCUMENT_ROOT.
'/website/class/website.class.php';
75 require_once DOL_DOCUMENT_ROOT.
'/website/class/websitepage.class.php';
78 $object->fetch(0, $websitekey);
80 if (empty($object->id))
85 header(
$_SERVER[
"SERVER_PROTOCOL"].
" 404 Not Found",
true, 404);
87 include DOL_DOCUMENT_ROOT.
'/public/error-404.php';
96 $result = $objectpage->fetch(0, $object->id, $pageref);
99 $pageid = $objectpage->id;
100 } elseif ($result == 0)
103 $result = $objectpage->fetch(0, $object->id, null, $pageref);
106 $pageid = $objectpage->id;
110 if ($object->fk_default_home > 0)
112 $result = $objectpage->fetch($object->fk_default_home);
115 $pageid = $objectpage->id;
121 $array = $objectpage->fetchAll($object->id);
122 if (is_array($array) && count($array) > 0)
124 $firstrep = reset($array);
125 $pageid = $firstrep->id;
133 header(
$_SERVER[
"SERVER_PROTOCOL"].
" 404 Not Found",
true, 404);
135 $langs->load(
"website");
137 if (!
GETPOSTISSET(
'pageref'))
print $langs->trans(
"PreviewOfSiteNotYetAvailable", $websitekey);
139 include DOL_DOCUMENT_ROOT.
'/public/error-404.php';
143 $appli = constant(
'DOL_APPLICATION_TITLE');
144 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_APPLICATION_TITLE;
156 global $dolibarr_main_data_root;
158 if ($pageid ==
'css')
160 header(
'Content-type: text/css');
164 header(
'Cache-Control: no-cache');
165 $original_file = $dolibarr_main_data_root.
'/website/'.$websitekey.
'/styles.css.php';
167 $original_file = $dolibarr_main_data_root.
'/website/'.$websitekey.
'/page'.$pageid.
'.tpl.php';
171 $refname = basename(dirname($original_file).
"/");
183 if (preg_match(
'/\.\./', $original_file) || preg_match(
'/[<>|]/', $original_file))
185 dol_syslog(
"Refused to deliver file ".$original_file);
186 $file = basename($original_file);
193 $filename = basename($original_file);
196 dol_syslog(
"index.php include $original_file $filename content-type=$type");
197 $original_file_osencoded =
dol_osencode($original_file);
200 if (!file_exists($original_file_osencoded))
203 header(
$_SERVER[
"SERVER_PROTOCOL"].
" 404 Not Found",
true, 404);
205 $langs->load(
"website");
206 print $langs->trans(
"RequestedPageHasNoContentYet", $pageid);
208 include DOL_DOCUMENT_ROOT.
'/public/error-404.php';
214 define(
'USEDOLIBARRSERVER', 1);
215 print '<!-- Page content '.$original_file.
' rendered with DOLIBARR SERVER : Html with CSS link and html header + Body that was saved into tpl dir -->'.
"\n";
216 include_once $original_file_osencoded;
218 if (is_object($db)) $db->close();
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...