dolibarr 21.0.0-beta
barcode.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
6 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
7 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
29// Load Dolibarr environment
30require '../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
33
42// Load translation files required by the page
43$langs->load("admin");
44
45// Security Check Access
46if (!$user->admin) {
48}
49
50// Get Parameters
51$action = GETPOST('action', 'aZ09');
52$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
53
54
55/*
56 * Actions
57 */
58
59include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
60
61if ($action == 'setbarcodeproducton') {
62 $barcodenumberingmodule = GETPOST('value', 'alpha');
63 $res = dolibarr_set_const($db, "BARCODE_PRODUCT_ADDON_NUM", $barcodenumberingmodule, 'chaine', 0, '', $conf->entity);
64 if ($barcodenumberingmodule == 'mod_barcode_product_standard' && !getDolGlobalString('BARCODE_STANDARD_PRODUCT_MASK')) {
65 $res = dolibarr_set_const($db, "BARCODE_STANDARD_PRODUCT_MASK", '04{0000000000}', 'chaine', 0, '', $conf->entity);
66 }
67} elseif ($action == 'setbarcodeproductoff') {
68 $res = dolibarr_del_const($db, "BARCODE_PRODUCT_ADDON_NUM", $conf->entity);
69}
70
71if ($action == 'setbarcodethirdpartyon') {
72 $barcodenumberingmodule = GETPOST('value', 'alpha');
73 $res = dolibarr_set_const($db, "BARCODE_THIRDPARTY_ADDON_NUM", $barcodenumberingmodule, 'chaine', 0, '', $conf->entity);
74 if ($barcodenumberingmodule == 'mod_barcode_thirdparty_standard' && !getDolGlobalString('BARCODE_STANDARD_THIRDPARTY_MASK')) {
75 $res = dolibarr_set_const($db, "BARCODE_STANDARD_THIRDPARTY_MASK", '04{0000000000}', 'chaine', 0, '', $conf->entity);
76 }
77} elseif ($action == 'setbarcodethirdpartyoff') {
78 $res = dolibarr_del_const($db, "BARCODE_THIRDPARTY_ADDON_NUM", $conf->entity);
79}
80
81if ($action == 'setcoder') {
82 $coder = GETPOST('coder', 'alpha');
83 $code_id = GETPOSTINT('code_id');
84 $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type";
85 $sqlp .= " SET coder = '".$db->escape($coder)."'";
86 $sqlp .= " WHERE rowid = ".((int) $code_id);
87 $sqlp .= " AND entity = ".$conf->entity;
88
89 $resql = $db->query($sqlp);
90 if (!$resql) {
91 dol_print_error($db);
92 }
93} elseif ($action == 'update') {
94 $location = GETPOST('GENBARCODE_LOCATION', 'alpha');
95 $res = dolibarr_set_const($db, "GENBARCODE_LOCATION", $location, 'chaine', 0, '', $conf->entity);
96 $coder_id = GETPOST('PRODUIT_DEFAULT_BARCODE_TYPE', 'alpha');
97 $res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id, 'chaine', 0, '', $conf->entity);
98 $coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY', 'alpha');
99 $res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id, 'chaine', 0, '', $conf->entity);
100
101 if ($res > 0) {
102 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
103 } else {
104 setEventMessages($langs->trans("Error"), null, 'errors');
105 }
106} elseif ($action == 'updateengine') {
107 $sql = "SELECT rowid, coder";
108 $sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
109 $sql .= " WHERE entity = ".$conf->entity;
110 $sql .= " ORDER BY code";
111
112 $resql = $db->query($sql);
113 if ($resql) {
114 $num = $db->num_rows($resql);
115 $i = 0;
116
117 while ($i < $num) {
118 $obj = $db->fetch_object($resql);
119
120 if (GETPOST('coder'.$obj->rowid, 'alpha')) {
121 $coder = GETPOST('coder'.$obj->rowid, 'alpha');
122 $code_id = $obj->rowid;
123
124 $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type";
125 $sqlp .= " SET coder = '".$db->escape($coder)."'";
126 $sqlp .= " WHERE rowid = ".((int) $code_id);
127 $sqlp .= " AND entity = ".$conf->entity;
128
129 $upsql = $db->query($sqlp);
130 if (!$upsql) {
131 dol_print_error($db);
132 }
133 }
134
135 $i++;
136 }
137 }
138}
139
140
141/*
142 * View
143 */
144
145$form = new Form($db);
146$formbarcode = new FormBarCode($db);
147
148$help_url = 'EN:Module_Barcode|FR:Module_Codes_Barre|ES:Módulo Código de barra|DE:Modul_Barcode';
149llxHeader('', $langs->trans("BarcodeSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-barcode');
150
151$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
152print load_fiche_titre($langs->trans("BarcodeSetup"), $linkback, 'title_setup');
153
154// Detect bar codes modules
155$barcodelist = array();
156
157clearstatcache();
158
159
160// Scan list of all barcode included provided by external modules
161$dirbarcode = array_merge(array("/core/modules/barcode/doc/"), $conf->modules_parts['barcode']);
162
163foreach ($dirbarcode as $reldir) {
164 $dir = dol_buildpath($reldir);
165 $newdir = dol_osencode($dir);
166
167 // Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php)
168 if (!is_dir($newdir)) {
169 continue;
170 }
171
172 $handle = @opendir($newdir);
173 if (is_resource($handle)) {
174 while (($file = readdir($handle)) !== false) {
175 if (substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS') {
176 if (is_readable($newdir.$file)) {
177 if (preg_match('/(.*)\.modules\.php$/i', $file, $reg)) {
178 $filebis = $reg[1];
179
180 // Loading encoding class
181 require_once $newdir.$file;
182 $classname = "mod".ucfirst($filebis);
183 $module = new $classname($db);
184
185 '@phan-var-force ModeleBarCode $module';
186
187 // Show modules according to features level
188 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
189 continue;
190 }
191 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
192 continue;
193 }
194
195 if ($module->isEnabled()) {
196 $barcodelist[$filebis] = $module->info($langs);
197 }
198 }
199 }
200 }
201 }
202 }
203}
204'@phan-var-force array<string,string> $barcodelist';
205
206
207// Select barcode numbering module
208if (isModEnabled('product')) {
209 print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', '');
210
211 print '<div class="div-table-responsive-no-min">';
212 print '<table class="noborder centpercent">';
213 print '<tr class="liste_titre">';
214 print '<td width="140">'.$langs->trans("Name").'</td>';
215 print '<td>'.$langs->trans("Description").'</td>';
216 print '<td>'.$langs->trans("Example").'</td>';
217 print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
218 print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
219 print "</tr>\n";
220
221 $dirbarcodenum = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
222
223 foreach ($dirbarcodenum as $dirroot) {
224 $dir = dol_buildpath($dirroot, 0);
225
226 $handle = @opendir($dir);
227 if (is_resource($handle)) {
228 while (($file = readdir($handle)) !== false) {
229 if (preg_match('/^mod_barcode_product_.*php$/', $file)) {
230 $file = substr($file, 0, dol_strlen($file) - 4);
231
232 try {
233 dol_include_once($dirroot.$file.'.php');
234 } catch (Exception $e) {
235 dol_syslog($e->getMessage(), LOG_ERR);
236 }
237
238 $modBarCode = new $file();
239 '@phan-var-force ModeleNumRefBarCode $modBarCode';
240
241 print '<tr class="oddeven">';
242 print '<td>'.(isset($modBarCode->name) ? $modBarCode->name : $modBarCode->nom)."</td><td>\n";
243 print $modBarCode->info($langs);
244 print '</td>';
245 print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
246
247 if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM') == "$file") {
248 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&token='.newToken().'&amp;value='.urlencode($file).'">';
249 print img_picto($langs->trans("Activated"), 'switch_on');
250 print '</a></td>';
251 } else {
252 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&token='.newToken().'&amp;value='.urlencode($file).'">';
253 print img_picto($langs->trans("Disabled"), 'switch_off');
254 print '</a></td>';
255 }
256 print '<td class="center">';
257 $s = $modBarCode->getToolTip($langs, null, -1);
258 print $form->textwithpicto('', $s, 1);
259 print '</td>';
260 print "</tr>\n";
261 }
262 }
263 closedir($handle);
264 }
265 }
266 print "</table>\n";
267 print '</div>';
268}
269
270// Select barcode numbering module
271if (isModEnabled('societe')) {
272 print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("ThirdParty").")", '', '');
273
274 print '<div class="div-table-responsive-no-min">';
275 print '<table class="noborder centpercent">';
276 print '<tr class="liste_titre">';
277 print '<td width="140">'.$langs->trans("Name").'</td>';
278 print '<td>'.$langs->trans("Description").'</td>';
279 print '<td>'.$langs->trans("Example").'</td>';
280 print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
281 print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
282 print "</tr>\n";
283
284 $dirbarcodenum = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
285
286 foreach ($dirbarcodenum as $dirroot) {
287 $dir = dol_buildpath($dirroot, 0);
288
289 $handle = @opendir($dir);
290 if (is_resource($handle)) {
291 while (($file = readdir($handle)) !== false) {
292 if (preg_match('/^mod_barcode_thirdparty_.*php$/', $file)) {
293 $file = substr($file, 0, dol_strlen($file) - 4);
294
295 try {
296 dol_include_once($dirroot.$file.'.php');
297 } catch (Exception $e) {
298 dol_syslog($e->getMessage(), LOG_ERR);
299 }
300
301 $modBarCode = new $file();
302
303 '@phan-var-force ModeleNumRefBarCode $modBarCode';
304
305 print '<tr class="oddeven">';
306 print '<td>'.(isset($modBarCode->name) ? $modBarCode->name : $modBarCode->nom)."</td><td>\n";
307 print $modBarCode->info($langs);
308 print '</td>';
309 print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
310
311 if (getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM') && $conf->global->BARCODE_THIRDPARTY_ADDON_NUM == "$file") {
312 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodethirdpartyoff&token='.newToken().'&amp;value='.urlencode($file).'">';
313 print img_picto($langs->trans("Activated"), 'switch_on');
314 print '</a></td>';
315 } else {
316 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodethirdpartyon&token='.newToken().'&amp;value='.urlencode($file).'">';
317 print img_picto($langs->trans("Disabled"), 'switch_off');
318 print '</a></td>';
319 }
320 print '<td class="center">';
321 $s = $modBarCode->getToolTip($langs, null, -1);
322 print $form->textwithpicto('', $s, 1);
323 print '</td>';
324 print "</tr>\n";
325 }
326 }
327 closedir($handle);
328 }
329 }
330 print "</table>\n";
331 print '</div>';
332}
333
334/*
335 * CHOIX ENCODAGE
336 */
337
338print '<br>';
339print load_fiche_titre($langs->trans("BarcodeEncodeModule"), '', '');
340
341if (empty($conf->use_javascript_ajax)) {
342 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="form_engine">';
343 print '<input type="hidden" name="token" value="'.newToken().'">';
344 print '<input type="hidden" name="action" value="updateengine">';
345}
346
347print '<div class="div-table-responsive-no-min">';
348print '<table class="noborder centpercent">';
349print '<tr class="liste_titre">';
350print '<td>'.$langs->trans("Name").'</td>';
351print '<td>'.$langs->trans("Description").'</td>';
352print '<td width="200" class="center">'.$langs->trans("Example").'</td>';
353print '<td class="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>';
354print "</tr>\n";
355
356$sql = "SELECT rowid, code as encoding, libelle as label, coder, example";
357$sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
358$sql .= " WHERE entity = ".$conf->entity;
359$sql .= " ORDER BY code";
360
361dol_syslog("admin/barcode.php", LOG_DEBUG);
362$resql = $db->query($sql);
363if ($resql) {
364 $num = $db->num_rows($resql);
365 $i = 0;
366
367 while ($i < $num) {
368 $obj = $db->fetch_object($resql);
369
370 print '<tr class="oddeven">';
371 print '<td width="100">';
372 print dol_escape_htmltag($obj->label);
373 print "</td><td>\n";
374 print $langs->trans('BarcodeDesc'.$obj->encoding);
375 //print "L'EAN se compose de 8 characters, 7 chiffres plus une cle de verification.<br>";
376 //print "L'utilisation des symbologies EAN8 impose la souscription et l'abonnement aupres d'organismes comme GENCOD.<br>";
377 //print "Codes numeriques utilises exclusivement a l'identification des produits susceptibles d'etre vendus au grand public.";
378 print '</td>';
379
380 // Show example
381 print '<td class="center">';
382 if ($obj->coder && $obj->coder != -1) {
383 $result = 0;
384
385 foreach ($dirbarcode as $reldir) {
386 $dir = dol_buildpath($reldir, 0);
387 $newdir = dol_osencode($dir);
388
389 // Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php)
390 if (!is_dir($newdir)) {
391 continue;
392 }
393
394 $result = @include_once $newdir.$obj->coder.'.modules.php';
395 if ($result) {
396 break;
397 }
398 }
399 if ($result) {
400 $classname = "mod".ucfirst($obj->coder);
401 if (class_exists($classname)) {
402 $module = new $classname($db);
403 '@phan-var-force ModeleBarCode $module';
404 if ($module->encodingIsSupported($obj->encoding)) {
405 // Build barcode on disk (not used, this is done to make debug easier)
406 $result = $module->writeBarCode($obj->example, $obj->encoding, 'Y');
407 // Generate on the fly and output barcode with generator
408 $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&amp;generator='.urlencode($obj->coder).'&amp;code='.urlencode($obj->example).'&amp;encoding='.urlencode($obj->encoding);
409 //print $url;
410 print '<img src="'.$url.'" title="'.$obj->example.'" border="0">';
411 } else {
412 print $langs->trans("FormatNotSupportedByGenerator");
413 }
414 } else {
415 print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder;
416 }
417 }
418 } else {
419 print '<span class="opacitymedium">'.$langs->trans("ChooseABarCode").'</span>';
420 }
421 print '</td>';
422
423 print '<td class="center">';
424 print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i);
425 print "</td></tr>\n";
426
427 $i++;
428 }
429}
430print "</table>\n";
431print '</div>';
432
433if (empty($conf->use_javascript_ajax)) {
434 print $form->buttonsSaveCancel("Save", '');
435}
436
437print "<br>";
438
439
440/*
441 * Other options
442 */
443print load_fiche_titre($langs->trans("OtherOptions"), '', '');
444
445print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
446print '<input type="hidden" name="token" value="'.newToken().'">';
447print "<input type=\"hidden\" name=\"action\" value=\"update\">";
448
449print '<div class="div-table-responsive-no-min">';
450print '<table class="noborder centpercent">';
451print '<tr class="liste_titre">';
452print '<td>'.$langs->trans("Parameter").'</td>';
453print '<td width="60" class="center">'.$langs->trans("Value").'</td>';
454print '<td>&nbsp;</td>';
455print '</tr>';
456
457// Chemin du binaire genbarcode sous linux
458if (!isset($_SERVER['WINDIR'])) {
459 print '<tr class="oddeven">';
460 print '<td>'.$langs->trans("GenbarcodeLocation").'</td>';
461 print '<td width="60" class="center">';
462 print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.getDolGlobalString('GENBARCODE_LOCATION').'">';
463 if (getDolGlobalString('GENBARCODE_LOCATION') && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
464 $langs->load("errors");
465 print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", getDolGlobalString('GENBARCODE_LOCATION')).'</span>';
466 }
467 print '</td>';
468 print '<td>&nbsp;</td>';
469 print '</tr>';
470}
471
472// Module products
473if (isModEnabled('product')) {
474 print '<tr class="oddeven">';
475 print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
476 print '<td width="60" class="right">';
477 print $formbarcode->selectBarcodeType(getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
478 print '</td>';
479 print '<td>&nbsp;</td>';
480 print '</tr>';
481}
482
483// Module thirdparty
484if (isModEnabled('societe')) {
485 print '<tr class="oddeven">';
486 print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
487 print '<td width="60" class="right">';
488 print $formbarcode->selectBarcodeType(getDolGlobalString('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
489 print '</td>';
490 print '<td>&nbsp;</td>';
491 print '</tr>';
492}
493
494print "</table>\n";
495print '</div>';
496
497print '<div class="tabsAction">';
498print '<input type="submit" class="button" name="submit_GENBARCODE_BARCODETYPE_THIRDPARTY" value="'.$langs->trans("Modify").'">';
499print "</div>";
500print '</form>';
501
502print '<br>';
503
504
505// End of page
506llxFooter();
507$db->close();
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
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.
Definition wrapper.php:71
Class to manage barcode HTML.
Class to manage generation of HTML components Only common components must be here.
llxFooter()
Footer empty.
Definition document.php:107
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.