dolibarr 24.0.0-beta
ajaxdirpreview.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
5 * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
6 * Copyright (C) 2010 Pierre Morin <pierre.morin@auguria.net>
7 * Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
8 * Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
9 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
10 * Copyright (C) 2025 Joachim Kueter <git-jk@bloxera.com>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <https://www.gnu.org/licenses/>.
24 */
25
33if (!defined('NOTOKENRENEWAL')) {
34 define('NOTOKENRENEWAL', 1); // Disables token renewal
35}
36if (!defined('NOREQUIREMENU')) {
37 define('NOREQUIREMENU', '1');
38}
39if (!defined('NOREQUIREHTML')) {
40 define('NOREQUIREHTML', '1');
41}
42if (!defined('NOREQUIREAJAX')) {
43 define('NOREQUIREAJAX', '1');
44}
45
60'
61@phan-var-force ?string $mode
62';
63
64if (!isset($mode) || $mode != 'noajax') { // For ajax call
65 require_once '../../main.inc.php';
66 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
67 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
68 require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
69
70 $action = GETPOST('action', 'aZ09');
71 $file = urldecode(GETPOST('file', 'alpha'));
72 $section = GETPOST("section", 'alpha');
73 $module = GETPOST("module", 'alpha');
74 $urlsource = GETPOST("urlsource", 'alpha');
75 $search_doc_ref = GETPOST('search_doc_ref', 'alpha');
76
77 $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
78 $sortfield = GETPOST("sortfield", 'aZ09comma');
79 $sortorder = GETPOST("sortorder", 'aZ09comma');
80 $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
81 $showonrightsize = '';
82
83 if (empty($page) || $page == -1) {
84 $page = 0;
85 } // If $page is not defined, or '' or -1
86 $offset = $limit * $page;
87 $pageprev = $page - 1;
88 $pagenext = $page + 1;
89 if (!$sortorder) {
90 $sortorder = "ASC";
91 }
92 if (!$sortfield) {
93 $sortfield = "name";
94 }
95
96 $rootdirfordoc = $conf->ecm->dir_output;
97
98 $upload_dir = dirname(str_replace("../", "/", $rootdirfordoc.'/'.$file));
99
100 $ecmdir = new EcmDirectory($db);
101 if ($section > 0) {
102 $result = $ecmdir->fetch((int) $section);
103 //if (!($result > 0)) {
104 //dol_print_error($db,$ecmdir->error);
105 //exit;
106 //}
107 }
108} else {
109 // When no an ajax call (include from other file)
119 '
120 @phan-var-force int $section
121 @phan-var-force string $action
122 @phan-var-force string $module
123 @phan-var-force string $showonrightsize
124 @phan-var-force string $sortfield
125 @phan-var-force string $sortorder
126 ';
127
128 $rootdirfordoc = $conf->ecm->dir_output;
129
130 $ecmdir = new EcmDirectory($db);
131 $relativepath = '';
132 if ($section > 0) {
133 $result = $ecmdir->fetch($section);
134 if (!($result > 0)) {
135 dol_print_error($db, $ecmdir->error);
136 exit;
137 }
138
139 $relativepath = $ecmdir->getRelativePath(); // Example 'mydir/'
140 } elseif (GETPOST('section_dir')) {
141 $relativepath = GETPOST('section_dir');
142 }
143 //var_dump($section.'-'.GETPOST('section_dir').'-'.$relativepath);
144
145 $upload_dir = $rootdirfordoc.'/'.$relativepath;
146}
147
148if (empty($url)) { // autoset $url but it is better to have it defined before into filemanager.tpl.php (not possible when in auto tree)
149 if (!empty($module) && $module == 'medias' && !GETPOST('website')) {
150 $url = DOL_URL_ROOT.'/ecm/index_medias.php';
151 } elseif (GETPOSTISSET('website')) {
152 $url = DOL_URL_ROOT.'/website/index.php';
153 } else {
154 $url = DOL_URL_ROOT.'/ecm/index.php';
155 }
156}
157
158// Load translation files required by the page
159$langs->loadLangs(array("ecm", "companies", "other"));
160
161if (empty($modulepart)) {
162 $modulepart = $module;
163}
164
165// Security check
166if ($user->socid > 0) {
167 $socid = $user->socid;
168}
169// On interdit les remontees de repertoire ainsi que les pipe dans les noms de fichiers.
170if (preg_match('/\.\./', $upload_dir) || preg_match('/[<>|]/', $upload_dir)) {
171 dol_syslog("Refused to deliver file ".$upload_dir);
172 // Do no show plain path in shown error message
173 dol_print_error(null, $langs->trans("ErrorFileNameInvalid", $upload_dir));
174 exit;
175}
176// Check permissions
177if ($modulepart == 'ecm') {
178 if (!$user->hasRight('ecm', 'read')) {
180 }
181} elseif ($modulepart == 'medias' || $modulepart == 'website') {
182 // Always allowed
183} else {
185}
186
187
188/*
189 * Action
190 */
191
192// None
193
194
195
196/*
197 * View
198 */
199
200if (!isset($mode) || $mode != 'noajax') {
201 // Ajout directives pour resoudre bug IE
202 header('Cache-Control: Public, must-revalidate');
203 header('Pragma: public');
204
205 top_httphead();
206}
207
208$type = 'directory';
209
210// This test if file exists should be useless. We keep it to find bug more easily
211if (!dol_is_dir($upload_dir)) {
212 //dol_mkdir($upload_dir);
213 /*$langs->load("install");
214 dol_print_error(0,$langs->trans("ErrorDirDoesNotExists",$upload_dir));
215 exit;*/
216}
217
218print '<!-- ajaxdirpreview mode='.$mode.' type='.$type.' module='.$module.' modulepart='.$modulepart.'-->'."\n";
219//print '<!-- Page called with mode='.dol_escape_htmltag(isset($mode)?$mode:'').' type='.dol_escape_htmltag($type).' module='.dol_escape_htmltag($module).' url='.dol_escape_htmltag($url).' '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
220
221$param = ($sortfield ? '&sortfield='.urlencode($sortfield) : '').($sortorder ? '&sortorder='.urlencode($sortorder) : '');
222if (!empty($websitekey)) {
223 $param .= '&website='.urlencode($websitekey);
224}
225if (!empty($pageid)) {
226 $param .= '&pageid='.((int) $pageid);
227}
228
229
230// Dir scan
231if ($type == 'directory') {
232 $formfile = new FormFile($db);
233
234 $maxlengthname = 40;
235 $excludefiles = array('^SPECIMEN\.pdf$', '^\.', '(\.meta|_preview.*\.png)$', '^temp$', '^payments$', '^CVS$', '^thumbs$');
236 $sorting = (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC);
237
238 // Right area. If module is defined here, we are in automatic ecm.
239 $automodules = array(
240 'company',
241 'invoice',
242 'invoice_supplier',
243 'propal',
244 'supplier_proposal',
245 'order',
246 'order_supplier',
247 'contract',
248 'product',
249 'tax',
250 'tax-vat',
251 'salaries',
252 'project',
253 'project_task',
254 'fichinter',
255 'user',
256 'expensereport',
257 'holiday',
258 'recruitment-recruitmentcandidature',
259 'banque',
260 'bank-statement',
261 'chequereceipt',
262 'mrp-mo'
263 );
264
265 $parameters = array('modulepart' => $module);
266 $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
267 if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
268 if (is_array($hookmanager->resArray['module'])) {
269 $automodules = array_merge($automodules, $hookmanager->resArray['module']);
270 } else {
271 $automodules[] = $hookmanager->resArray['module'];
272 }
273 }
274
275 // TODO change for multicompany sharing
276 if ($module == 'company') {
277 $upload_dir = $conf->societe->dir_output;
278 $excludefiles[] = '^contact$'; // The subdir 'contact' contains files of contacts.
279 } elseif ($module == 'invoice') {
280 $upload_dir = $conf->invoice->dir_output;
281 } elseif ($module == 'invoice_supplier') {
282 $upload_dir = $conf->fournisseur->facture->dir_output;
283 } elseif ($module == 'propal') {
284 $upload_dir = $conf->propal->dir_output;
285 } elseif ($module == 'supplier_proposal') {
286 $upload_dir = $conf->supplier_proposal->dir_output;
287 } elseif ($module == 'order') {
288 $upload_dir = $conf->order->dir_output;
289 } elseif ($module == 'order_supplier') {
290 $upload_dir = $conf->fournisseur->commande->dir_output;
291 } elseif ($module == 'contract') {
292 $upload_dir = $conf->contract->dir_output;
293 } elseif ($module == 'product') {
294 $upload_dir = $conf->product->dir_output;
295 } elseif ($module == 'tax') {
296 $upload_dir = $conf->tax->dir_output;
297 $excludefiles[] = '^vat$'; // The subdir 'vat' contains files of vats.
298 } elseif ($module == 'tax-vat') {
299 $upload_dir = $conf->tax->dir_output.'/vat';
300 } elseif ($module == 'salaries') {
301 $upload_dir = $conf->salaries->dir_output;
302 } elseif ($module == 'project') {
303 $upload_dir = $conf->project->dir_output;
304 } elseif ($module == 'project_task') {
305 $upload_dir = $conf->project->dir_output;
306 } elseif ($module == 'fichinter') {
307 $upload_dir = $conf->ficheinter->dir_output;
308 } elseif ($module == 'user') {
309 $upload_dir = $conf->user->dir_output;
310 } elseif ($module == 'expensereport') {
311 $upload_dir = $conf->expensereport->dir_output;
312 } elseif ($module == 'holiday') {
313 $upload_dir = $conf->holiday->dir_output;
314 } elseif ($module == 'recruitment-recruitmentcandidature') {
315 $upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature';
316 } elseif ($module == 'banque') {
317 $upload_dir = $conf->bank->dir_output;
318 } elseif ($module == 'bank-statement') {
319 $upload_dir = $conf->bank->dir_output.'/*/statement';
320 } elseif ($module == 'chequereceipt') {
321 $upload_dir = $conf->bank->dir_output.'/checkdeposits';
322 } elseif ($module == 'mrp-mo') {
323 $upload_dir = $conf->mrp->dir_output;
324 } else {
325 $parameters = array('modulepart' => $module);
326 $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
327 if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
328 $upload_dir = $hookmanager->resArray['directory'];
329 }
330 }
331
332 // Automatic list
333 if (in_array($module, $automodules)) {
334 $param .= '&module='.urlencode($module);
335 if (isset($search_doc_ref) && $search_doc_ref != '') {
336 $param .= '&search_doc_ref='.urlencode($search_doc_ref);
337 }
338
339 $textifempty = ($section ? $langs->trans("NoFileFound") : ($showonrightsize == 'featurenotyetavailable' ? $langs->trans("FeatureNotYetAvailable") : $langs->trans("NoFileFound")));
340
341 $filter = preg_quote((string) $search_doc_ref, '/');
342 $filearray = dol_dir_list($upload_dir, "files", 1, $filter, $excludefiles, $sortfield, $sorting, 1);
343 //var_dump($filearray);
344
345 // To allow external users,we must restrict $filearray to entries the user is a thirdparty.
346 // This can be done by filtering on entries found into llx_ecm
347 if ($user->socid > 0) {
348 $filearrayallowedtoexternal = array(); // 'fullpath' => array(...)
349
350 // Search files in ECM with select filepath.filename where src_object_type = $module and src_object_type EXISTS in (select rowid from $objecttablename WERE fk_soc = '.$user->socid.' and entity in getEntity($objecttbalename)
351 // TODO
352
353 // Now clean $filearray to keep only record also found into $filearrayallowedtoexternal.
354 foreach ($filearray as $key => $val) {
355 if (!in_array($upload_dir.'/'.$val['relativename'], $filearrayallowedtoexternal)) {
356 unset($filearray[$key]);
357 }
358 }
359 }
360
361 $perm = $user->hasRight('ecm', 'upload');
362
363 // Print list of files
364 $formfile->list_of_autoecmfiles($upload_dir, $filearray, $module, $param, 1, '', $perm, 1, $textifempty, $maxlengthname, $url, 1);
365 } else {
366 // Manual list
367 if ($module == 'medias') {
368 /*
369 $_POST is array like
370 'token' => string '062380e11b7dcd009d07318b57b71750' (length=32)
371 'action' => string 'file_manager' (length=12)
372 'website' => string 'template' (length=8)
373 'pageid' => string '124' (length=3)
374 'section_dir' => string 'mydir/' (length=3)
375 'section_id' => string '0' (length=1)
376 'max_file_size' => string '2097152' (length=7)
377 'sendit' => string 'Envoyer fichier' (length=15)
378 */
379 $relativepath = GETPOST('file', 'alpha') ? GETPOST('file', 'alpha') : GETPOST('section_dir', 'alpha');
380 if ($relativepath && $relativepath != '/') {
381 $relativepath .= '/';
382 }
383 $upload_dir = $dolibarr_main_data_root.'/'.$module.'/'.$relativepath;
384 if (GETPOSTISSET('website') || GETPOSTISSET('file_manager')) {
385 $param .= '&file_manager=1';
386 if (!preg_match('/website=/', $param) && GETPOST('website', 'alpha')) {
387 $param .= '&website='.urlencode(GETPOST('website', 'alpha'));
388 }
389 if (!preg_match('/pageid=/', $param)) {
390 $param .= '&pageid='.GETPOSTINT('pageid');
391 }
392 //if (!preg_match('/backtopage=/',$param)) $param.='&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid);
393 }
394 } else {
395 $relativepath = $ecmdir->getRelativePath();
396 $upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
397 }
398
399 // If $section defined with value 0
400 if (($section === '0' || empty($section)) && ($module != 'medias')) {
401 $filearray = array();
402 } else {
403 $filearray = dol_dir_list($upload_dir, "files", 0, '', array('^\.', '(\.meta|_preview.*\.png)$', '^temp$', '^CVS$'), $sortfield, $sorting, 1);
404 }
405
406 if ($section) {
407 $param .= '&section='.$section;
408 if (isset($search_doc_ref) && $search_doc_ref != '') {
409 $param .= '&search_doc_ref='.urlencode($search_doc_ref);
410 }
411
412 $textifempty = $langs->trans('NoFileFound');
413 } elseif ($section === '0') {
414 if ($module == 'ecm') {
415 $textifempty = '<br><div class="center"><span class="warning">'.$langs->trans("DirNotSynchronizedSyncFirst").'</span></div><br>';
416 } else {
417 $textifempty = $langs->trans('NoFileFound');
418 }
419 } else {
420 $textifempty = ($showonrightsize == 'featurenotyetavailable' ? $langs->trans("FeatureNotYetAvailable") : $langs->trans("ECMSelectASection"));
421 }
422
423 $useinecm = 0;
424 if ($module == 'medias') {
425 $useinecm = 6;
426 $modulepart = 'medias';
427 $perm = $user->hasRight("website", "write");
428 $title = 'none';
429 } elseif ($module == 'ecm') { // DMS/ECM -> manual structure
430 if ($user->hasRight("ecm", "read")) {
431 // Buttons: Preview
432 $useinecm = 2;
433 }
434
435 if ($user->hasRight("ecm", "upload")) {
436 // Buttons: Preview + Delete
437 $useinecm = 4;
438 }
439
440 if ($user->hasRight("ecm", "setup")) {
441 // Buttons: Preview + Delete + Edit
442 $useinecm = 5;
443 }
444
445 $perm = $user->hasRight("ecm", "upload");
446 $modulepart = 'ecm';
447 $title = ''; // Use default
448 } else {
449 $useinecm = 5;
450 $modulepart = 'ecm';
451 $perm = $user->hasRight("ecm", "upload");
452 $title = ''; // Use default
453 }
454
455 // When we show list of files for ECM files, $filearray contains file list, and directory is defined with modulepart + section into $param
456 // When we show list of files for a directory, $filearray ciontains file list, and directory is defined with modulepart + $relativepath
457 //var_dump("section=".$section." title=".$title." modulepart=".$modulepart." useinecm=".$useinecm." perm(permtoeditline)=".$perm." relativepath=".$relativepath." upload_dir=".$upload_dir." param=".$param." url=".$url);
458
459 $formfile->list_of_documents($filearray, null, $modulepart, $param, 1, $relativepath, $perm, $useinecm, $textifempty, $maxlengthname, $title, $url, 0, $perm, $upload_dir, $sortfield, $sortorder);
460 }
461}
462
463
464
465// Bottom of page
466$useajax = 1;
467if (!empty($conf->dol_use_jmobile)) {
468 $useajax = 0;
469}
470if (empty($conf->use_javascript_ajax)) {
471 $useajax = 0;
472}
473if (getDolGlobalString('MAIN_ECM_DISABLE_JS')) {
474 $useajax = 0;
475}
476
477//$param.=($param?'?':'').(preg_replace('/^&/','',$param));
478
479if ($useajax || $action == 'deletefile') {
480 $urlfile = '';
481 if ($action == 'deletefile') {
482 $urlfile = GETPOST('urlfile', 'alpha');
483 }
484
485 if (empty($section_dir)) {
486 $section_dir = GETPOST("file", "alpha");
487 }
488 $section_id = $section;
489
490 require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
491
492 $form = new Form($db);
493 $formquestion = array();
494 $formquestion['urlfile'] = array('type' => 'hidden', 'value' => $urlfile, 'name' => 'urlfile'); // We must always put field, even if empty because it is filled by javascript later
495 $formquestion['section'] = array('type' => 'hidden', 'value' => $section, 'name' => 'section'); // We must always put field, even if empty because it is filled by javascript later
496 $formquestion['section_id'] = array('type' => 'hidden', 'value' => $section_id, 'name' => 'section_id'); // We must always put field, even if empty because it is filled by javascript later
497 $formquestion['section_dir'] = array('type' => 'hidden', 'value' => $section_dir, 'name' => 'section_dir'); // We must always put field, even if empty because it is filled by javascript later
498 $formquestion['sortfield'] = array('type' => 'hidden', 'value' => $sortfield, 'name' => 'sortfield'); // We must always put field, even if empty because it is filled by javascript later
499 $formquestion['sortorder'] = array('type' => 'hidden', 'value' => $sortorder, 'name' => 'sortorder'); // We must always put field, even if empty because it is filled by javascript later
500 if (!empty($action) && $action == 'file_manager') {
501 $formquestion['file_manager'] = array('type' => 'hidden', 'value' => 1, 'name' => 'file_manager');
502 }
503 if (!empty($websitekey)) {
504 $formquestion['website'] = array('type' => 'hidden', 'value' => $websitekey, 'name' => 'website');
505 }
506 if (!empty($pageid) && $pageid > 0) {
507 $formquestion['pageid'] = array('type' => 'hidden', 'value' => $pageid, 'name' => 'pageid');
508 }
509
510 print $form->formconfirm($url, $langs->trans("DeleteFile"), $langs->trans("ConfirmDeleteFile"), 'confirm_deletefile', $formquestion, "no", ($useajax ? 'deletefile' : 0));
511}
512
513if ($useajax) {
514 print '<!-- ajaxdirpreview.php: js to manage preview of doc -->'."\n";
515 print '<script nonce="'.getNonce().'" type="text/javascript">';
516
517 // Enable jquery handlers on new generated HTML objects (same code than into lib_footer.js.php)
518 // Because the content is reloaded by ajax call, we must also redefine/reenable some jquery hooks.
519
520 // Handler to manage document_preview on click on a .documentpreview css class.
521 if ($conf->browser->layout != 'phone') {
522 print "\n/* JS CODE TO ENABLE document_preview */\n";
523 print '
524 jQuery(document).ready(function () {
525 jQuery(".documentpreview").click(function () {
526 console.log("We click on preview for element with href="+$(this).attr(\'href\')+" mime="+$(this).attr(\'mime\'));
527 var titledocpreview = $(this).attr(\'data-title\');
528 if (titledocpreview == undefined || titledocpreview == "") {
529 titledocpreview = \''.dol_escape_js($langs->transnoentities("Preview")).'\'
530 }
531 document_preview($(this).attr(\'href\'), $(this).attr(\'mime\'), titledocpreview);
532 return false;
533 });
534 });
535 ' . "\n";
536 }
537
538 // Enable jquery handlers button to delete files
539 print 'jQuery(document).ready(function() {'."\n";
540 print ' jQuery(".deletefilelink").click(function(e) { '."\n";
541 print ' console.log("We click on button with class deletefilelink, param='.$param.', we set urlfile to "+jQuery(this).attr("rel"));'."\n";
542 print ' jQuery("#urlfile").val(jQuery(this).attr("rel"));'."\n";
543 //print ' jQuery("#section_dir").val(\'aaa\');'."\n";
544 print ' jQuery("#dialog-confirm-deletefile").dialog("open");'."\n";
545 print ' return false;'."\n";
546 print ' });'."\n";
547 print '});'."\n";
548 print '</script>'."\n";
549}
550
551// Close db if mode is not noajax
552if ((!isset($mode) || $mode != 'noajax') && is_object($db)) {
553 $db->close();
554}
Class to manage ECM directories.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
document_preview(file, type, title)
Function to show a document preview popup.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
Definition files.lib.php:64
dol_is_dir($folder)
Test if filename is a directory.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.