35if (!defined(
'NOTOKENRENEWAL')) {
36 define(
'NOTOKENRENEWAL', 1);
38if (!defined(
'NOLOGIN')) {
41if (!defined(
'NOCSRFCHECK')) {
42 define(
"NOCSRFCHECK", 1);
44if (!defined(
'NOREQUIREMENU')) {
45 define(
'NOREQUIREMENU',
'1');
47if (!defined(
'NOREQUIREHTML')) {
48 define(
'NOREQUIREHTML',
'1');
50if (!defined(
'NOREQUIREAJAX')) {
51 define(
'NOREQUIREAJAX',
'1');
53if (!defined(
'NOIPCHECK')) {
54 define(
'NOIPCHECK',
'1');
56if (!defined(
'NOBROWSERNOTIF')) {
57 define(
'NOBROWSERNOTIF',
'1');
82function llxHeader($head =
'', $title =
'', $help_url =
'', $target =
'', $disablejs = 0, $disablehead = 0, $arrayofjs =
'', $arrayofcss =
'', $morequerystring =
'', $morecssonbody =
'', $replacemainareaby =
'', $disablenofollow = 0, $disablenoindex = 0)
95function llxFooter($comment =
'', $zone =
'private', $disabledoutputofmessages = 0)
99require
'../../master.inc.php';
100require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
108$websitekey =
GETPOST(
'website',
'alpha');
110$pageref =
GETPOST(
'pageref',
'alphanohtml') ?
GETPOST(
'pageref',
'alphanohtml') :
'';
113if (preg_match(
'/^(\w\w)\/(.*)$/', $pageref, $reg)) {
122 require_once DOL_DOCUMENT_ROOT.
'/website/class/website.class.php';
123 require_once DOL_DOCUMENT_ROOT.
'/website/class/websitepage.class.php';
126 $object->fetch(0, $websitekey);
129 if (empty($pageid)) {
131 header($_SERVER[
"SERVER_PROTOCOL"].
" 404 Not Found",
true, 404);
133 include DOL_DOCUMENT_ROOT.
'/public/error-404.php';
138 $objectpage =
new WebsitePage($db);
142 $result = $objectpage->fetch(0, (
string)
$object->id, $pageref);
144 $pageid = $objectpage->id;
145 } elseif ($result == 0) {
148 $result = $objectpage->fetch(0, (
string)
$object->id,
null, $pageref);
150 $pageid = $objectpage->id;
154 if (
$object->fk_default_home > 0) {
155 $result = $objectpage->fetch(
$object->fk_default_home);
157 $pageid = $objectpage->id;
161 if (empty($pageid)) {
162 $array = $objectpage->fetchAll(
$object->id);
163 if (is_array($array) && count($array) > 0) {
164 $firstrep = reset($array);
165 $pageid = $firstrep->id;
172 header($_SERVER[
"SERVER_PROTOCOL"].
" 404 Not Found",
true, 404);
174 $langs->load(
"website");
176 if (!GETPOSTISSET(
'pageref')) {
177 print $langs->trans(
"PreviewOfSiteNotYetAvailable", $websitekey);
180 include DOL_DOCUMENT_ROOT.
'/public/error-404.php';
183if (empty($pageref)) {
184 $objectpage =
new WebsitePage($db);
185 $result = $objectpage->fetch($pageid);
187 $pageref = (string) $objectpage->ref;
190if (preg_match(
'/^_(library|service)_page_/', $pageref)) {
191 $originalcontentonly = 1;
194$appli = constant(
'DOL_APPLICATION_TITLE');
209global $dolibarr_main_data_root;
211if ($pageid ==
'css') {
212 header(
'Content-type: text/css');
216 header(
'Cache-Control: no-cache');
217 $original_file = $dolibarr_main_data_root.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.$websitekey.
'/styles.css.php';
219 $original_file = $dolibarr_main_data_root.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.$websitekey.
'/page'.$pageid.
'.tpl.php';
223$refname = basename(dirname($original_file).
"/");
227if (!$accessallowed) {
234if (preg_match(
'/\.\./', $original_file) || preg_match(
'/[<>|]/', $original_file)) {
235 dol_syslog(
"Refused to deliver file ".$original_file);
236 $file = basename($original_file);
243$filename = basename($original_file);
246dol_syslog(
"index.php include $original_file $filename content-type=$type");
250if (!file_exists($original_file_osencoded)) {
252 header($_SERVER[
"SERVER_PROTOCOL"].
" 404 Not Found",
true, 404);
254 $langs->load(
"website");
255 print $langs->trans(
"RequestedPageHasNoContentYet", $pageid);
257 include DOL_DOCUMENT_ROOT.
'/public/error-404.php';
263define(
'USEDOLIBARRSERVER', 1);
264if (!isset($originalcontentonly)) {
265 print
'<!-- Page content '.$original_file.
' rendered with DOLIBARR SERVER : Html with CSS link and html header + Body that was saved into tpl dir -->'.
"\n";
267include_once $original_file_osencoded;
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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.