42 $micro_start_time = 0;
43 if (!empty($_SERVER[
'MAIN_SHOW_TUNING_INFO'])) {
44 list($usec, $sec) = explode(
" ", microtime());
45 $micro_start_time = ((
float) $usec + (
float) $sec);
48 if (defined(
'XDEBUGCOVERAGE')) {
49 xdebug_start_code_coverage();
63 $newstringnumentity = preg_replace(
'/;$/',
'', $matches[1]);
66 if (preg_match(
'/^x/i', $newstringnumentity)) {
67 $newstringnumentity = hexdec(preg_replace(
'/^x/i',
'', $newstringnumentity));
71 if (($newstringnumentity >= 65 && $newstringnumentity <= 90) || ($newstringnumentity >= 97 && $newstringnumentity <= 122)) {
72 return chr((
int) $newstringnumentity);
75 return '&#'.$matches[1];
99 $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5);
101 $val = preg_replace_callback(
'/&#(x?[0-9][0-9a-f]+;?)/i',
function ($m) {
106 $val = preg_replace(
'/<!--[^>]*-->/',
'', $val);
107 $val = preg_replace(
'/[\r\n\t]/',
'', $val);
108 }
while ($oldval != $val);
119 $newval = preg_replace(
'/[\x00-\x08\x0B-\x0C\x0E-\x1F\x7F]/u',
'', $val);
122 if ($newval != $val) {
129 if ($type == 1 || $type == 3) {
131 $inj += preg_match(
'/delete\s*from/i', $val);
132 $inj += preg_match(
'/create\s*table/i', $val);
133 $inj += preg_match(
'/insert\s*into/i', $val);
134 $inj += preg_match(
'/select\s*from/i', $val);
135 $inj += preg_match(
'/into\s*(outfile|dumpfile)/i', $val);
136 $inj += preg_match(
'/user\s*\(/i', $val);
137 $inj += preg_match(
'/information_schema/i', $val);
138 $inj += preg_match(
'/<svg/i', $val);
139 $inj += preg_match(
'/update[^&].*set.+=/i', $val);
140 $inj += preg_match(
'/union.+select/i', $val);
144 $inj += preg_match(
'/select|update|delete|truncate|replace|group\s*by|concat|count|from|union/i', $val);
147 $inj += preg_match(
'/updatexml\(/i', $val);
148 $inj += preg_match(
'/(\.\.%2f)+/i', $val);
149 $inj += preg_match(
'/\s@@/', $val);
152 $inj += preg_match(
'/<\/textarea/i', $val);
158 $inj += preg_match(
'/<audio/i', $val);
159 $inj += preg_match(
'/<embed/i', $val);
160 $inj += preg_match(
'/<iframe/i', $val);
161 $inj += preg_match(
'/<object/i', $val);
162 $inj += preg_match(
'/<script/i', $val);
163 $inj += preg_match(
'/Set\.constructor/i', $val);
164 if (!defined(
'NOSTYLECHECK')) {
165 $inj += preg_match(
'/<style/i', $val);
167 $inj += preg_match(
'/base\s+href/si', $val);
168 $inj += preg_match(
'/=data:/si', $val);
170 $inj += preg_match(
'/on(mouse|drag|key|load|touch|pointer|select|transition)([a-z]*)\s*=/i', $val);
171 $inj += preg_match(
'/on(abort|afterprint|animation|auxclick|beforecopy|beforecut|beforeprint|beforeunload|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|copy|cut)\s*=/i', $val);
172 $inj += preg_match(
'/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)\s*=/i', $val);
173 $inj += preg_match(
'/on(lostpointercapture|offline|online|pagehide|pageshow)\s*=/i', $val);
174 $inj += preg_match(
'/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeked|seeking|show|stalled|start|submit|suspend)\s*=/i', $val);
175 $inj += preg_match(
'/on(timeupdate|toggle|unload|volumechange|waiting|wheel)\s*=/i', $val);
178 $tmpval = preg_replace(
'/<[^<]+>/',
'', $val);
180 $inj += preg_match(
'/on(mouse|drag|key|load|touch|pointer|select|transition)([a-z]*)\s*=/i', $val);
181 $inj += preg_match(
'/on(abort|afterprint|animation|auxclick|beforecopy|beforecut|beforeprint|beforeunload|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|copy|cut)\s*=/i', $tmpval);
182 $inj += preg_match(
'/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)\s*=/i', $tmpval);
183 $inj += preg_match(
'/on(lostpointercapture|offline|online|pagehide|pageshow)\s*=/i', $tmpval);
184 $inj += preg_match(
'/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeked|seeking|show|stalled|start|submit|suspend)\s*=/i', $tmpval);
185 $inj += preg_match(
'/on(timeupdate|toggle|unload|volumechange|waiting|wheel)\s*=/i', $tmpval);
188 $inj += preg_match(
'/:|:|:/i', $val);
189 $inj += preg_match(
'/j\s*a\s*v\s*a\s*s\s*c\s*r\s*i\s*p\s*t\s*:/i', $val);
190 $inj += preg_match(
'/vbscript\s*:/i', $val);
192 if ($type == 1 || $type == 3) {
193 $val = str_replace(
'enclosure="',
'enclosure=X', $val);
194 $inj += preg_match(
'/"/i', $val);
197 $inj += preg_match(
'/[:;"\'<>\?\(\){}\$%]/', $val);
212 if (is_array($var)) {
213 foreach ($var as $key => $value) {
218 $ip = (empty($_SERVER[
'REMOTE_ADDR']) ?
'unknown' : $_SERVER[
'REMOTE_ADDR']);
219 $errormessage =
'Access refused to '.htmlentities($ip, ENT_COMPAT,
'UTF-8').
' by SQL or Script injection protection in main.inc.php - GETPOST type='.htmlentities($type, ENT_COMPAT,
'UTF-8').
' paramkey='.htmlentities($key, ENT_COMPAT,
'UTF-8').
' paramvalue='.htmlentities($value, ENT_COMPAT,
'UTF-8').
' page='.htmlentities($_SERVER[
"REQUEST_URI"], ENT_COMPAT,
'UTF-8');
222 if (function_exists(
'error_log')) {
223 error_log($errormessage);
241 if ((defined(
'NOREQUIREDB') || defined(
'NOREQUIRETRAN')) && !defined(
'NOREQUIREMENU')) {
242 print
'If define NOREQUIREDB or NOREQUIRETRAN are set, you must also set NOREQUIREMENU or not set them.';
245 if (defined(
'NOREQUIREUSER') && !defined(
'NOREQUIREMENU')) {
246 print
'If define NOREQUIREUSER is set, you must also set NOREQUIREMENU or not set it.';
251 if (!defined(
'NOSCANPHPSELFFORINJECTION') && !empty($_SERVER[
"PHP_SELF"])) {
252 $morevaltochecklikepost = array($_SERVER[
"PHP_SELF"]);
256 if (!defined(
'NOSCANGETFORINJECTION') && !empty($_SERVER[
"QUERY_STRING"])) {
260 $morevaltochecklikeget = array(urldecode($_SERVER[
"QUERY_STRING"]));
264 if (!defined(
'NOSCANPOSTFORINJECTION')) {
269 if (!empty($_SERVER[
'DOCUMENT_ROOT']) && substr($_SERVER[
'DOCUMENT_ROOT'], -6) !==
'htdocs') {
270 set_include_path($_SERVER[
'DOCUMENT_ROOT'].
'/htdocs');
274 require_once
'filefunc.inc.php';
279 if (!empty($_POST[
"DOL_AUTOSET_COOKIE"])) {
280 $tmpautoset = explode(
':', $_POST[
"DOL_AUTOSET_COOKIE"], 2);
281 $tmplist = explode(
',', $tmpautoset[1]);
282 $cookiearrayvalue = array();
283 foreach ($tmplist as $tmpkey) {
284 $postkey = $tmpautoset[0].
'_'.$tmpkey;
286 if (!empty($_POST[$postkey])) {
287 $cookiearrayvalue[$tmpkey] = $_POST[$postkey];
290 $cookiename = $tmpautoset[0];
291 $cookievalue = json_encode($cookiearrayvalue);
293 if (PHP_VERSION_ID < 70300) {
294 setcookie($cookiename, empty($cookievalue) ?
'' : $cookievalue, empty($cookievalue) ? 0 : (time() + (86400 * 354)),
'/',
null, ((empty($dolibarr_main_force_https) &&
isHTTPS() ===
false) ?
false :
true),
true);
297 $cookieparams = array(
298 'expires' => empty($cookievalue) ? 0 : (time() + (86400 * 354)),
301 'secure' => ((empty($dolibarr_main_force_https) &&
isHTTPS() ===
false) ?
false :
true),
305 setcookie($cookiename, empty($cookievalue) ?
'' : $cookievalue, $cookieparams);
307 if (empty($cookievalue)) {
308 unset($_COOKIE[$cookiename]);
314 if (!empty($php_session_save_handler) && $php_session_save_handler ==
'db') {
315 require_once
'core/lib/phpsessionin'.$php_session_save_handler.
'.lib.php';
321 $prefix = dol_getprefix(
'');
322 $sessionname =
'DOLSESSID_'.$prefix;
323 $sessiontimeout =
'DOLSESSTIMEOUT_'.$prefix;
324 if (!empty($_COOKIE[$sessiontimeout])) {
325 ini_set(
'session.gc_maxlifetime', $_COOKIE[$sessiontimeout]);
330 if (!defined(
'NOSESSION')) {
331 if (PHP_VERSION_ID < 70300) {
332 session_set_cookie_params(0,
'/',
null, ((empty($dolibarr_main_force_https) &&
isHTTPS() ===
false) ?
false :
true),
true);
335 $sessioncookieparams = array(
339 'secure' => ((empty($dolibarr_main_force_https) &&
isHTTPS() ===
false) ?
false :
true),
343 session_set_cookie_params($sessioncookieparams);
345 session_name($sessionname);
352 require_once
'master.inc.php';
355 if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) {
357 if ((!session_id() || !isset($_SESSION[
"dol_login"])) && !isset($_POST[
"username"]) && !empty($_SERVER[
"GATEWAY_INTERFACE"])) {
359 } elseif (isset($_POST[
"username"]) && $_POST[
"username"] == $conf->global->MAIN_ONLY_LOGIN_ALLOWED) {
361 } elseif (defined(
'NOREQUIREDB')) {
363 } elseif (defined(
'EVEN_IF_ONLY_LOGIN_ALLOWED')) {
365 } elseif (session_id() && isset($_SESSION[
"dol_login"]) && $_SESSION[
"dol_login"] == $conf->global->MAIN_ONLY_LOGIN_ALLOWED) {
369 if (session_id() && isset($_SESSION[
"dol_login"]) && $_SESSION[
"dol_login"] != $conf->global->MAIN_ONLY_LOGIN_ALLOWED) {
370 print
'Sorry, your application is offline.'.
"\n";
371 print
'You are logged with user "'.$_SESSION[
"dol_login"].
'" and only administrator user "'.$conf->global->MAIN_ONLY_LOGIN_ALLOWED.
'" is allowed to connect for the moment.'.
"\n";
372 $nexturl = DOL_URL_ROOT.
'/user/logout.php?token='.
newToken();
373 print
'Please try later or <a href="'.$nexturl.
'">click here to disconnect and change login user</a>...'.
"\n";
375 print
'Sorry, your application is offline. Only administrator user "'.$conf->global->MAIN_ONLY_LOGIN_ALLOWED.
'" is allowed to connect for the moment.'.
"\n";
376 $nexturl = DOL_URL_ROOT.
'/';
377 print
'Please try later or <a href="'.$nexturl.
'">click here to change login user</a>...'.
"\n";
385 register_shutdown_function(
'dol_shutdown');
388 if (
isModEnabled(
'debugbar') && !
GETPOST(
'dol_use_jmobile') && empty($_SESSION[
'dol_use_jmobile'])) {
390 include_once DOL_DOCUMENT_ROOT.
'/debugbar/class/DebugBar.php';
392 $renderer = $debugbar->getRenderer();
393 if (empty($conf->global->MAIN_HTML_HEADER)) {
394 $conf->global->MAIN_HTML_HEADER =
'';
396 $conf->global->MAIN_HTML_HEADER .= $renderer->renderHead();
398 $debugbar[
'time']->startMeasure(
'pageaftermaster',
'Page generation (after environment init)');
402 if (isset($_SERVER[
"HTTP_USER_AGENT"])) {
404 $conf->browser->name = $tmp[
'browsername'];
405 $conf->browser->os = $tmp[
'browseros'];
406 $conf->browser->version = $tmp[
'browserversion'];
407 $conf->browser->layout = $tmp[
'layout'];
410 if ($conf->browser->layout ==
'phone') {
411 $conf->dol_no_mouse_hover = 1;
416 if (
GETPOST(
'theme',
'aZ09')) {
417 $conf->theme =
GETPOST(
'theme',
'aZ09');
418 $conf->css =
"/theme/".$conf->theme.
"/style.css.php";
422 if (
GETPOST(
'textbrowser',
'int') || (!empty($conf->browser->name) && $conf->browser->name ==
'lynxlinks')) {
423 $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = 1;
428 if (!empty($conf->file->main_force_https) && (empty($_SERVER[
"HTTPS"]) || $_SERVER[
"HTTPS"] !=
'on')) {
430 if (is_numeric($conf->file->main_force_https)) {
431 if ($conf->file->main_force_https ==
'1' && !empty($_SERVER[
"SCRIPT_URI"])) {
432 if (preg_match(
'/^http:/i', $_SERVER[
"SCRIPT_URI"]) && !preg_match(
'/^https:/i', $_SERVER[
"SCRIPT_URI"])) {
433 $newurl = preg_replace(
'/^http:/i',
'https:', $_SERVER[
"SCRIPT_URI"]);
437 $newurl = preg_replace(
'/^http:/i',
'https:', DOL_MAIN_URL_ROOT).$_SERVER[
"REQUEST_URI"];
441 $newurl = $conf->file->main_force_https.$_SERVER[
"REQUEST_URI"];
446 dol_syslog(
"main.inc: dolibarr_main_force_https is on, we make a redirect to ".$newurl);
447 header(
"Location: ".$newurl);
450 dol_syslog(
"main.inc: dolibarr_main_force_https is on but we failed to forge new https url so no redirect is done", LOG_WARNING);
454 if (!defined(
'NOLOGIN') && !defined(
'NOIPCHECK') && !empty($dolibarr_main_restrict_ip)) {
455 $listofip = explode(
',', $dolibarr_main_restrict_ip);
457 foreach ($listofip as $ip) {
459 if ($ip == $_SERVER[
'REMOTE_ADDR']) {
465 print
'Access refused by IP protection. Your detected IP is '.$_SERVER[
'REMOTE_ADDR'];
471 if (!defined(
'NOREQUIREHTML')) {
472 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
474 if (!defined(
'NOREQUIREAJAX')) {
475 require_once DOL_DOCUMENT_ROOT.
'/core/lib/ajax.lib.php';
479 if (!empty($conf->global->MAIN_NOT_INSTALLED) || !empty($conf->global->MAIN_NOT_UPGRADED)) {
480 dol_syslog(
"main.inc: A previous install or upgrade was not complete. Redirect to install page.", LOG_WARNING);
481 header(
"Location: ".DOL_URL_ROOT.
"/install/index.php");
485 if ((!empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && ($conf->global->MAIN_VERSION_LAST_UPGRADE != DOL_VERSION))
486 || (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && !empty($conf->global->MAIN_VERSION_LAST_INSTALL) && ($conf->global->MAIN_VERSION_LAST_INSTALL != DOL_VERSION))) {
487 $versiontocompare = empty($conf->global->MAIN_VERSION_LAST_UPGRADE) ? $conf->global->MAIN_VERSION_LAST_INSTALL : $conf->global->MAIN_VERSION_LAST_UPGRADE;
488 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
489 $dolibarrversionlastupgrade = preg_split(
'/[.-]/', $versiontocompare);
490 $dolibarrversionprogram = preg_split(
'/[.-]/', DOL_VERSION);
491 $rescomp =
versioncompare($dolibarrversionprogram, $dolibarrversionlastupgrade);
493 if (empty($conf->global->MAIN_NO_UPGRADE_REDIRECT_ON_LEVEL_3_CHANGE) || $rescomp < 3) {
495 dol_syslog(
"main.inc: database version ".$versiontocompare.
" is lower than programs version ".DOL_VERSION.
". Redirect to install/upgrade page.", LOG_WARNING);
496 header(
"Location: ".DOL_URL_ROOT.
"/install/index.php");
503 if (!defined(
'NOTOKENRENEWAL') && !defined(
'NOSESSION')) {
505 if (!preg_match(
'/\.(css|js|json)\.php$/', $_SERVER[
"PHP_SELF"])) {
507 if (isset($_SESSION[
'newtoken'])) {
508 $_SESSION[
'token'] = $_SESSION[
'newtoken'];
511 if (!isset($_SESSION[
'newtoken']) ||
getDolGlobalInt(
'MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL')) {
515 $token =
dol_hash(uniqid(mt_rand(),
false),
'md5');
516 $_SESSION[
'newtoken'] = $token;
517 dol_syslog(
"NEW TOKEN generated by : ".$_SERVER[
'PHP_SELF'], LOG_DEBUG);
525 if ((!defined(
'NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) &&
getDolGlobalInt(
'MAIN_SECURITY_CSRF_WITH_TOKEN')) || defined(
'CSRFCHECK_WITH_TOKEN')) {
527 $sensitiveget =
false;
530 if (
GETPOSTISSET(
'massaction') || !in_array(
GETPOST(
'action',
'aZ09'), array(
'create',
'createsite',
'createcard',
'edit',
'editvalidator',
'file_manager',
'presend',
'presend_addmessage',
'preview',
'specimen'))) {
531 $sensitiveget =
true;
535 $arrayofactiontoforcetokencheck = array(
537 'doprev',
'donext',
'dvprev',
'dvnext',
538 'freezone',
'install',
541 if (in_array(
GETPOST(
'action',
'aZ09'), $arrayofactiontoforcetokencheck)) {
542 $sensitiveget =
true;
545 if (preg_match(
'/^(add|classify|close|confirm|copy|del|disable|enable|remove|set|unset|update|save)/',
GETPOST(
'action',
'aZ09'))) {
546 $sensitiveget =
true;
553 $_SERVER[
'REQUEST_METHOD'] ==
'POST' ||
559 if (!
GETPOST(
'token',
'alpha') ||
GETPOST(
'token',
'alpha') ==
'notrequired') {
561 if (
GETPOST(
'uploadform',
'int')) {
562 dol_syslog(
"--- Access to ".(empty($_SERVER[
"REQUEST_METHOD"]) ?
'' : $_SERVER[
"REQUEST_METHOD"].
' ').$_SERVER[
"PHP_SELF"].
" refused. File size too large or not provided.");
563 $langs->loadLangs(array(
"errors",
"install"));
564 print $langs->trans(
"ErrorFileSizeTooLarge").
' ';
565 print $langs->trans(
"ErrorGoBackAndCorrectParameters");
567 http_response_code(403);
568 if (defined(
'CSRFCHECK_WITH_TOKEN')) {
569 dol_syslog(
"--- Access to ".(empty($_SERVER[
"REQUEST_METHOD"]) ?
'' : $_SERVER[
"REQUEST_METHOD"].
' ').$_SERVER[
"PHP_SELF"].
" refused by CSRF protection (CSRFCHECK_WITH_TOKEN protection) in main.inc.php. Token not provided.", LOG_WARNING);
570 print
"Access to a page that needs a token (constant CSRFCHECK_WITH_TOKEN is defined) is refused by CSRF protection in main.inc.php. Token not provided.\n";
572 dol_syslog(
"--- Access to ".(empty($_SERVER[
"REQUEST_METHOD"]) ?
'' : $_SERVER[
"REQUEST_METHOD"].
' ').$_SERVER[
"PHP_SELF"].
" refused by CSRF protection (POST method or GET with a sensible value for 'action' parameter) in main.inc.php. Token not provided.", LOG_WARNING);
573 print
"Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n";
574 print
"If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0";
575 if (!empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
576 print
" instead of ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN;
578 print
" into setup).\n";
585 $sessiontokenforthisurl = (empty($_SESSION[
'token']) ?
'' : $_SESSION[
'token']);
588 dol_syslog(
"--- Access to ".(empty($_SERVER[
"REQUEST_METHOD"]) ?
'' : $_SERVER[
"REQUEST_METHOD"].
' ').$_SERVER[
"PHP_SELF"].
" refused by CSRF protection (invalid token), so we disable POST and some GET parameters - referer=".(empty($_SERVER[
'HTTP_REFERER'])?
'':$_SERVER[
'HTTP_REFERER']).
", action=".
GETPOST(
'action',
'aZ09').
", _GET|POST['token']=".
GETPOST(
'token',
'alpha'), LOG_WARNING);
591 setEventMessages(
'SecurityTokenHasExpiredSoActionHasBeenCanceledPleaseRetry',
null,
'warnings');
593 if (isset($_POST[
'id'])) {
594 $savid = ((int) $_POST[
'id']);
599 unset($_GET[
'confirm']);
600 unset($_GET[
'action']);
601 unset($_GET[
'confirmmassaction']);
602 unset($_GET[
'massaction']);
603 unset($_GET[
'token']);
605 $_POST[
'id'] = ((int) $savid);
614 $_SESSION[
"disablemodules"] =
GETPOST(
'disablemodules',
'alpha');
616 if (!empty($_SESSION[
"disablemodules"])) {
617 $modulepartkeys = array(
'css',
'js',
'tabs',
'triggers',
'login',
'substitutions',
'menus',
'theme',
'sms',
'tpl',
'barcode',
'models',
'societe',
'hooks',
'dir',
'syslog',
'tpllinkable',
'contactelement',
'moduleforexternal');
619 $disabled_modules = explode(
',', $_SESSION[
"disablemodules"]);
620 foreach ($disabled_modules as $module) {
622 if (empty($conf->$module)) {
623 $conf->$module =
new stdClass();
625 $conf->$module->enabled =
false;
626 foreach ($modulepartkeys as $modulepartkey) {
627 unset($conf->modules_parts[$modulepartkey][$module]);
629 if ($module ==
'fournisseur') {
630 $conf->supplier_order->enabled = 0;
631 $conf->supplier_invoice->enabled = 0;
638 $modulepart = explode(
"/", $_SERVER[
"PHP_SELF"]);
639 if (is_array($modulepart) && count($modulepart) > 0) {
640 foreach ($conf->modules as $module) {
641 if (in_array($module, $modulepart)) {
642 $modulepart = $module;
647 if (is_array($modulepart)) {
656 if (!defined(
'NOLOGIN')) {
660 if (defined(
'MAIN_AUTHENTICATION_MODE')) {
661 $dolibarr_main_authentication = constant(
'MAIN_AUTHENTICATION_MODE');
664 if (empty($dolibarr_main_authentication)) {
665 $dolibarr_main_authentication =
'http,dolibarr';
668 if ($dolibarr_main_authentication ==
'forceuser' && empty($dolibarr_auto_user)) {
669 $dolibarr_auto_user =
'auto';
673 $authmode = explode(
',', $dolibarr_main_authentication);
676 if (!count($authmode)) {
677 $langs->load(
'main');
678 dol_print_error(
'', $langs->trans(
"ErrorConfigParameterNotDefined",
'dolibarr_main_authentication'));
685 $resultFetchUser =
'';
687 if (!isset($_SESSION[
"dol_login"])) {
689 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
691 $dol_dst_observed =
GETPOST(
"dst_observed",
'int', 3);
692 $dol_dst_first =
GETPOST(
"dst_first",
'int', 3);
693 $dol_dst_second =
GETPOST(
"dst_second",
'int', 3);
694 $dol_screenwidth =
GETPOST(
"screenwidth",
'int', 3);
695 $dol_screenheight =
GETPOST(
"screenheight",
'int', 3);
696 $dol_hide_topmenu =
GETPOST(
'dol_hide_topmenu',
'int', 3);
697 $dol_hide_leftmenu =
GETPOST(
'dol_hide_leftmenu',
'int', 3);
698 $dol_optimize_smallscreen =
GETPOST(
'dol_optimize_smallscreen',
'int', 3);
699 $dol_no_mouse_hover =
GETPOST(
'dol_no_mouse_hover',
'int', 3);
700 $dol_use_jmobile =
GETPOST(
'dol_use_jmobile',
'int', 3);
704 if (!empty($dolibarr_main_demo) && $_SERVER[
'PHP_SELF'] == DOL_URL_ROOT.
'/index.php') {
705 if (empty($_SERVER[
'HTTP_REFERER']) || !preg_match(
'/public/', $_SERVER[
'HTTP_REFERER'])) {
706 dol_syslog(
"Call index page from another url than demo page (call is done from page ".$_SERVER[
'HTTP_REFERER'].
")");
708 $url .= ($url ?
'&' :
'').($dol_hide_topmenu ?
'dol_hide_topmenu='.$dol_hide_topmenu :
'');
709 $url .= ($url ?
'&' :
'').($dol_hide_leftmenu ?
'dol_hide_leftmenu='.$dol_hide_leftmenu :
'');
710 $url .= ($url ?
'&' :
'').($dol_optimize_smallscreen ?
'dol_optimize_smallscreen='.$dol_optimize_smallscreen :
'');
711 $url .= ($url ?
'&' :
'').($dol_no_mouse_hover ?
'dol_no_mouse_hover='.$dol_no_mouse_hover :
'');
712 $url .= ($url ?
'&' :
'').($dol_use_jmobile ?
'dol_use_jmobile='.$dol_use_jmobile :
'');
713 $url = DOL_URL_ROOT.
'/public/demo/index.php'.($url ?
'?'.$url :
'');
714 header(
"Location: ".$url);
721 $hookmanager->initHooks(array(
'login'));
722 $parameters = array();
723 $reshook = $hookmanager->executeHooks(
'beforeLoginAuthentication', $parameters, $user, $action);
730 if ($test &&
GETPOST(
"username",
"alpha", 2) && !empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) && !isset($_SESSION[
'dol_bypass_antispam'])) {
731 $sessionkey =
'dol_antispam_value';
732 $ok = (array_key_exists($sessionkey, $_SESSION) ===
true && (strtolower($_SESSION[$sessionkey]) === strtolower(
GETPOST(
'code',
'restricthtml'))));
736 dol_syslog(
'Bad value for code, connexion refused');
738 $langs->loadLangs(array(
'main',
'errors'));
740 $_SESSION[
"dol_loginmesg"] = $langs->transnoentitiesnoconv(
"ErrorBadValueForCode");
744 $user->trigger_mesg =
'ErrorBadValueForCode - login='.GETPOST(
"username",
"alpha", 2);
747 $result = $user->call_trigger(
'USER_LOGIN_FAILED', $user);
755 $hookmanager->initHooks(array(
'login'));
756 $parameters = array(
'dol_authmode'=>$authmode,
'dol_loginmesg'=>$_SESSION[
"dol_loginmesg"]);
757 $reshook = $hookmanager->executeHooks(
'afterLoginFailed', $parameters, $user, $action);
766 $allowedmethodtopostusername = 2;
767 if (defined(
'MAIN_AUTHENTICATION_POST_METHOD')) {
768 $allowedmethodtopostusername = constant(
'MAIN_AUTHENTICATION_POST_METHOD');
770 $usertotest = (!empty($_COOKIE[
'login_dolibarr']) ? preg_replace(
'/[^a-zA-Z0-9_\-]/',
'', $_COOKIE[
'login_dolibarr']) :
GETPOST(
"username",
"alpha", $allowedmethodtopostusername));
771 $passwordtotest =
GETPOST(
'password',
'none', $allowedmethodtopostusername);
772 $entitytotest = (
GETPOST(
'entity',
'int') ?
GETPOST(
'entity',
'int') : (!empty($conf->entity) ? $conf->entity : 1));
775 $goontestloop =
false;
776 if (isset($_SERVER[
"REMOTE_USER"]) && in_array(
'http', $authmode)) {
777 $goontestloop =
true;
779 if ($dolibarr_main_authentication ==
'forceuser' && !empty($dolibarr_auto_user)) {
780 $goontestloop =
true;
782 if (
GETPOST(
"username",
"alpha", $allowedmethodtopostusername) || !empty($_COOKIE[
'login_dolibarr']) ||
GETPOST(
'openid_mode',
'alpha', 1)) {
783 $goontestloop =
true;
786 if (!is_object($langs)) {
787 include_once DOL_DOCUMENT_ROOT.
'/core/class/translate.class.php';
789 $langcode = (
GETPOST(
'lang',
'aZ09', 1) ?
GETPOST(
'lang',
'aZ09', 1) : (empty($conf->global->MAIN_LANG_DEFAULT) ?
'auto' : $conf->global->MAIN_LANG_DEFAULT));
790 if (defined(
'MAIN_LANG_DEFAULT')) {
791 $langcode = constant(
'MAIN_LANG_DEFAULT');
793 $langs->setDefaultLang($langcode);
800 if ($test && $goontestloop && (
GETPOST(
'actionlogin',
'aZ09') ==
'login' || $dolibarr_main_authentication !=
'dolibarr')) {
802 if ($login ===
'--bad-login-validity--') {
809 $dol_authmode = $conf->authmode;
810 $dol_tz = $_POST[
"tz"];
811 $dol_tz_string = $_POST[
"tz_string"];
812 $dol_tz_string = preg_replace(
'/\s*\(.+\)$/',
'', $dol_tz_string);
813 $dol_tz_string = preg_replace(
'/,/',
'/', $dol_tz_string);
814 $dol_tz_string = preg_replace(
'/\s/',
'_', $dol_tz_string);
817 if (isset($_POST[
"dst_first"]) && isset($_POST[
"dst_second"])) {
818 include_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
822 if ($datenow >= $datefirst && $datenow < $datesecond) {
830 dol_syslog(
'Bad password, connexion refused', LOG_DEBUG);
832 $langs->loadLangs(array(
'main',
'errors'));
836 if (empty($_SESSION[
"dol_loginmesg"])) {
837 $_SESSION[
"dol_loginmesg"] = $langs->transnoentitiesnoconv(
"ErrorBadLoginPassword");
841 $user->trigger_mesg = $langs->trans(
"ErrorBadLoginPassword").
' - login='.
GETPOST(
"username",
"alpha", 2);
844 $result = $user->call_trigger(
'USER_LOGIN_FAILED', $user);
852 $hookmanager->initHooks(array(
'login'));
853 $parameters = array(
'dol_authmode'=>$dol_authmode,
'dol_loginmesg'=>$_SESSION[
"dol_loginmesg"]);
854 $reshook = $hookmanager->executeHooks(
'afterLoginFailed', $parameters, $user, $action);
864 if (!$login || (in_array(
'ldap', $authmode) && empty($passwordtotest))) {
866 dol_syslog(
"--- Access to ".(empty($_SERVER[
"REQUEST_METHOD"]) ?
'' : $_SERVER[
"REQUEST_METHOD"].
' ').$_SERVER[
"PHP_SELF"].
" - action=".
GETPOST(
'action',
'aZ09').
" - actionlogin=".
GETPOST(
'actionlogin',
'aZ09').
" - showing the login form and exit", LOG_NOTICE);
867 if (defined(
'NOREDIRECTBYMAINTOLOGIN')) {
872 return 'ERROR_NOT_LOGGED';
874 if ($_SERVER[
"HTTP_USER_AGENT"] ==
'securitytest') {
875 http_response_code(401);
877 dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc :
''));
882 $resultFetchUser = $user->fetch(
'', $login,
'', 1, ($entitytotest > 0 ? $entitytotest : -1));
883 if ($resultFetchUser <= 0) {
884 dol_syslog(
'User not found, connexion refused');
886 session_set_cookie_params(0,
'/',
null, (empty($dolibarr_main_force_https) ?
false :
true),
true);
887 session_name($sessionname);
890 if ($resultFetchUser == 0) {
892 $langs->loadLangs(array(
'main',
'errors'));
894 $_SESSION[
"dol_loginmesg"] = $langs->transnoentitiesnoconv(
"ErrorCantLoadUserFromDolibarrDatabase", $login);
896 $user->trigger_mesg =
'ErrorCantLoadUserFromDolibarrDatabase - login='.$login;
898 if ($resultFetchUser < 0) {
899 $_SESSION[
"dol_loginmesg"] = $user->error;
901 $user->trigger_mesg = $user->error;
905 $result = $user->call_trigger(
'USER_LOGIN_FAILED', $user);
914 $hookmanager->initHooks(array(
'login'));
915 $parameters = array(
'dol_authmode'=>$dol_authmode,
'dol_loginmesg'=>$_SESSION[
"dol_loginmesg"]);
916 $reshook = $hookmanager->executeHooks(
'afterLoginFailed', $parameters, $user, $action);
921 $paramsurl = array();
922 if (
GETPOST(
'textbrowser',
'int')) {
923 $paramsurl[] =
'textbrowser='.GETPOST(
'textbrowser',
'int');
926 $paramsurl[] =
'nojs='.GETPOST(
'nojs',
'int');
929 $paramsurl[] =
'lang='.GETPOST(
'lang',
'aZ09');
931 header(
'Location: '.DOL_URL_ROOT.
'/index.php'.(count($paramsurl) ?
'?'.implode(
'&', $paramsurl) :
''));
935 if (!empty($user->conf->MAIN_LANG_DEFAULT)) {
936 $langs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT);
941 $login = $_SESSION[
"dol_login"];
942 $entity = isset($_SESSION[
"dol_entity"]) ? $_SESSION[
"dol_entity"] : 0;
943 dol_syslog(
"- This is an already logged session. _SESSION['dol_login']=".$login.
" _SESSION['dol_entity']=".$entity, LOG_DEBUG);
945 $resultFetchUser = $user->fetch(
'', $login,
'', 1, ($entity > 0 ? $entity : -1));
946 if ($resultFetchUser <= 0) {
948 dol_syslog(
"Can't load user even if session logged. _SESSION['dol_login']=".$login, LOG_WARNING);
950 session_set_cookie_params(0,
'/',
null, (empty($dolibarr_main_force_https) ?
false :
true),
true);
951 session_name($sessionname);
954 if ($resultFetchUser == 0) {
956 $langs->loadLangs(array(
'main',
'errors'));
958 $_SESSION[
"dol_loginmesg"] = $langs->transnoentitiesnoconv(
"ErrorCantLoadUserFromDolibarrDatabase", $login);
960 $user->trigger_mesg =
'ErrorCantLoadUserFromDolibarrDatabase - login='.$login;
962 if ($resultFetchUser < 0) {
963 $_SESSION[
"dol_loginmesg"] = $user->error;
965 $user->trigger_mesg = $user->error;
969 $result = $user->call_trigger(
'USER_LOGIN_FAILED', $user);
977 $hookmanager->initHooks(array(
'login'));
978 $parameters = array(
'dol_authmode'=>$dol_authmode,
'dol_loginmesg'=>$_SESSION[
"dol_loginmesg"]);
979 $reshook = $hookmanager->executeHooks(
'afterLoginFailed', $parameters, $user, $action);
984 $paramsurl = array();
985 if (
GETPOST(
'textbrowser',
'int')) {
986 $paramsurl[] =
'textbrowser='.GETPOST(
'textbrowser',
'int');
989 $paramsurl[] =
'nojs='.GETPOST(
'nojs',
'int');
992 $paramsurl[] =
'lang='.GETPOST(
'lang',
'aZ09');
994 header(
'Location: '.DOL_URL_ROOT.
'/index.php'.(count($paramsurl) ?
'?'.implode(
'&', $paramsurl) :
''));
998 $hookmanager->initHooks(array(
'main'));
1001 if (!empty($_GET[
'save_lastsearch_values']) && !empty($_SERVER[
"HTTP_REFERER"])) {
1002 $relativepathstring = preg_replace(
'/\?.*$/',
'', $_SERVER[
"HTTP_REFERER"]);
1003 $relativepathstring = preg_replace(
'/^https?:\/\/[^\/]*/',
'', $relativepathstring);
1005 if (constant(
'DOL_URL_ROOT')) {
1006 $relativepathstring = preg_replace(
'/^'.preg_quote(constant(
'DOL_URL_ROOT'),
'/').
'/',
'', $relativepathstring);
1008 $relativepathstring = preg_replace(
'/^\//',
'', $relativepathstring);
1009 $relativepathstring = preg_replace(
'/^custom\//',
'', $relativepathstring);
1013 if (!empty($_SESSION[
'lastsearch_values_tmp_'.$relativepathstring])) {
1014 $_SESSION[
'lastsearch_values_'.$relativepathstring] = $_SESSION[
'lastsearch_values_tmp_'.$relativepathstring];
1015 unset($_SESSION[
'lastsearch_values_tmp_'.$relativepathstring]);
1017 if (!empty($_SESSION[
'lastsearch_contextpage_tmp_'.$relativepathstring])) {
1018 $_SESSION[
'lastsearch_contextpage_'.$relativepathstring] = $_SESSION[
'lastsearch_contextpage_tmp_'.$relativepathstring];
1019 unset($_SESSION[
'lastsearch_contextpage_tmp_'.$relativepathstring]);
1021 if (!empty($_SESSION[
'lastsearch_limit_tmp_'.$relativepathstring]) && $_SESSION[
'lastsearch_limit_tmp_'.$relativepathstring] != $conf->liste_limit) {
1022 $_SESSION[
'lastsearch_limit_'.$relativepathstring] = $_SESSION[
'lastsearch_limit_tmp_'.$relativepathstring];
1023 unset($_SESSION[
'lastsearch_limit_tmp_'.$relativepathstring]);
1025 if (!empty($_SESSION[
'lastsearch_page_tmp_'.$relativepathstring]) && $_SESSION[
'lastsearch_page_tmp_'.$relativepathstring] > 0) {
1026 $_SESSION[
'lastsearch_page_'.$relativepathstring] = $_SESSION[
'lastsearch_page_tmp_'.$relativepathstring];
1027 unset($_SESSION[
'lastsearch_page_tmp_'.$relativepathstring]);
1029 if (!empty($_SESSION[
'lastsearch_mode_tmp_'.$relativepathstring])) {
1030 $_SESSION[
'lastsearch_mode_'.$relativepathstring] = $_SESSION[
'lastsearch_mode_tmp_'.$relativepathstring];
1031 unset($_SESSION[
'lastsearch_mode_tmp_'.$relativepathstring]);
1036 $reshook = $hookmanager->executeHooks(
'updateSession', array(), $user, $action);
1045 if (!isset($_SESSION[
"dol_login"])) {
1050 $_SESSION[
"dol_login"] = $user->login;
1051 $_SESSION[
"dol_authmode"] = isset($dol_authmode) ? $dol_authmode :
'';
1052 $_SESSION[
"dol_tz"] = isset($dol_tz) ? $dol_tz :
'';
1053 $_SESSION[
"dol_tz_string"] = isset($dol_tz_string) ? $dol_tz_string :
'';
1054 $_SESSION[
"dol_dst"] = isset($dol_dst) ? $dol_dst :
'';
1055 $_SESSION[
"dol_dst_observed"] = isset($dol_dst_observed) ? $dol_dst_observed :
'';
1056 $_SESSION[
"dol_dst_first"] = isset($dol_dst_first) ? $dol_dst_first :
'';
1057 $_SESSION[
"dol_dst_second"] = isset($dol_dst_second) ? $dol_dst_second :
'';
1058 $_SESSION[
"dol_screenwidth"] = isset($dol_screenwidth) ? $dol_screenwidth :
'';
1059 $_SESSION[
"dol_screenheight"] = isset($dol_screenheight) ? $dol_screenheight :
'';
1061 $_SESSION[
"dol_entity"] = $conf->entity;
1063 if (!empty($dol_hide_topmenu)) {
1064 $_SESSION[
'dol_hide_topmenu'] = $dol_hide_topmenu;
1066 if (!empty($dol_hide_leftmenu)) {
1067 $_SESSION[
'dol_hide_leftmenu'] = $dol_hide_leftmenu;
1069 if (!empty($dol_optimize_smallscreen)) {
1070 $_SESSION[
'dol_optimize_smallscreen'] = $dol_optimize_smallscreen;
1072 if (!empty($dol_no_mouse_hover)) {
1073 $_SESSION[
'dol_no_mouse_hover'] = $dol_no_mouse_hover;
1075 if (!empty($dol_use_jmobile)) {
1076 $_SESSION[
'dol_use_jmobile'] = $dol_use_jmobile;
1079 dol_syslog(
"This is a new started user session. _SESSION['dol_login']=".$_SESSION[
"dol_login"].
" Session id=".session_id());
1083 $user->update_last_login_date();
1085 $loginfo =
'TZ='.$_SESSION[
"dol_tz"].
';TZString='.$_SESSION[
"dol_tz_string"].
';Screen='.$_SESSION[
"dol_screenwidth"].
'x'.$_SESSION[
"dol_screenheight"];
1088 $user->trigger_mesg = $loginfo;
1091 $result = $user->call_trigger(
'USER_LOGIN', $user);
1099 $hookmanager->initHooks(array(
'login'));
1100 $parameters = array(
'dol_authmode'=>$dol_authmode,
'dol_loginfo'=>$loginfo);
1101 $reshook = $hookmanager->executeHooks(
'afterLogin', $parameters, $user, $action);
1109 dol_print_error($db,
'Error in some triggers USER_LOGIN or in some hooks afterLogin');
1116 $landingpage = (empty($user->conf->MAIN_LANDING_PAGE) ? (empty($conf->global->MAIN_LANDING_PAGE) ?
'' : $conf->global->MAIN_LANDING_PAGE) : $user->conf->MAIN_LANDING_PAGE);
1117 if (!empty($landingpage)) {
1119 if ($_SERVER[
"PHP_SELF"] != $newpath) {
1120 header(
'Location: '.$newpath);
1129 $user->rights->user->user->lire = 1;
1130 $user->rights->user->user->creer = 1;
1131 $user->rights->user->user->password = 1;
1132 $user->rights->user->user->supprimer = 1;
1133 $user->rights->user->self->creer = 1;
1134 $user->rights->user->self->password = 1;
1137 if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
1138 if (empty($user->rights->user->user_advance)) {
1139 $user->rights->user->user_advance =
new stdClass();
1141 if (empty($user->rights->user->self_advance)) {
1142 $user->rights->user->self_advance =
new stdClass();
1144 if (empty($user->rights->user->group_advance)) {
1145 $user->rights->user->group_advance =
new stdClass();
1148 $user->rights->user->user_advance->readperms = 1;
1149 $user->rights->user->user_advance->write = 1;
1150 $user->rights->user->self_advance->readperms = 1;
1151 $user->rights->user->self_advance->writeperms = 1;
1152 $user->rights->user->group_advance->read = 1;
1153 $user->rights->user->group_advance->readperms = 1;
1154 $user->rights->user->group_advance->write = 1;
1155 $user->rights->user->group_advance->delete = 1;
1164 if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT)) {
1165 $conf->liste_limit = $user->conf->MAIN_SIZE_LISTE_LIMIT;
1167 if (isset($user->conf->PRODUIT_LIMIT_SIZE)) {
1168 $conf->product->limit_size = $user->conf->PRODUIT_LIMIT_SIZE;
1172 if (empty($conf->global->MAIN_FORCETHEME) && !empty($user->conf->MAIN_THEME)) {
1173 $conf->theme = $user->conf->MAIN_THEME;
1174 $conf->css =
"/theme/".$conf->theme.
"/style.css.php";
1178 if (!empty($user) && method_exists($user,
'loadDefaultValues')) {
1179 $user->loadDefaultValues();
1185 if (
GETPOST(
'theme',
'aZ09')) {
1186 $conf->theme =
GETPOST(
'theme',
'aZ09', 1);
1187 $conf->css =
"/theme/".$conf->theme.
"/style.css.php";
1192 $conf->use_javascript_ajax = 0;
1194 if (!empty($user->conf->MAIN_DISABLE_JAVASCRIPT)) {
1195 $conf->use_javascript_ajax = !$user->conf->MAIN_DISABLE_JAVASCRIPT;
1200 if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) {
1201 $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = $user->conf->MAIN_OPTIMIZEFORTEXTBROWSER;
1205 $conf->global->MAIN_OPTIMIZEFORCOLORBLIND = empty($user->conf->MAIN_OPTIMIZEFORCOLORBLIND) ?
'' : $user->conf->MAIN_OPTIMIZEFORCOLORBLIND;
1208 if (
GETPOST(
'dol_hide_leftmenu',
'int') || !empty($_SESSION[
'dol_hide_leftmenu'])) {
1209 $conf->dol_hide_leftmenu = 1;
1211 if (
GETPOST(
'dol_hide_topmenu',
'int') || !empty($_SESSION[
'dol_hide_topmenu'])) {
1212 $conf->dol_hide_topmenu = 1;
1214 if (
GETPOST(
'dol_optimize_smallscreen',
'int') || !empty($_SESSION[
'dol_optimize_smallscreen'])) {
1215 $conf->dol_optimize_smallscreen = 1;
1217 if (
GETPOST(
'dol_no_mouse_hover',
'int') || !empty($_SESSION[
'dol_no_mouse_hover'])) {
1218 $conf->dol_no_mouse_hover = 1;
1220 if (
GETPOST(
'dol_use_jmobile',
'int') || !empty($_SESSION[
'dol_use_jmobile'])) {
1221 $conf->dol_use_jmobile = 1;
1224 if (!empty($conf->browser->layout) && $conf->browser->layout !=
'classic') {
1225 $conf->dol_no_mouse_hover = 1;
1229 if ((!empty($conf->browser->layout) && $conf->browser->layout ==
'phone')
1230 || (!empty($_SESSION[
'dol_screenwidth']) && $_SESSION[
'dol_screenwidth'] < 400)
1231 || (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] < 400
1232 || !empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
1234 $conf->dol_optimize_smallscreen = 1;
1236 if (isset($conf->global->PRODUIT_DESC_IN_FORM) && $conf->global->PRODUIT_DESC_IN_FORM == 1) {
1237 $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0;
1241 if (!empty($conf->dol_use_jmobile) && in_array($conf->theme, array(
'bureau2crea',
'cameleo',
'amarok'))) {
1242 $conf->theme =
'eldy';
1243 $conf->css =
"/theme/".$conf->theme.
"/style.css.php";
1246 if (!defined(
'NOREQUIRETRAN')) {
1247 if (!
GETPOST(
'lang',
'aZ09')) {
1249 if (!empty($user->conf->MAIN_LANG_DEFAULT)) {
1252 if ($langs->getDefaultLang() != $user->conf->MAIN_LANG_DEFAULT) {
1253 $langs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT);
1259 if (!defined(
'NOLOGIN')) {
1262 if (!$user->login) {
1267 if ($user->statut < 1) {
1269 $langs->loadLangs(array(
"errors",
"other"));
1270 dol_syslog(
"Authentication KO as login is disabled", LOG_NOTICE);
1278 dol_syslog(
"--- Access to ".(empty($_SERVER[
"REQUEST_METHOD"]) ?
'' : $_SERVER[
"REQUEST_METHOD"].
' ').$_SERVER[
"PHP_SELF"].
' - action='.
GETPOST(
'action',
'aZ09').
', massaction='.
GETPOST(
'massaction',
'aZ09').(defined(
'NOTOKENRENEWAL') ?
' NOTOKENRENEWAL='.constant(
'NOTOKENRENEWAL') :
''), LOG_NOTICE);
1283 if (!defined(
'NOREQUIRETRAN')) {
1285 $langs->loadLangs(array(
'main',
'dict'));
1289 $bc = array(0=>
'class="impair"', 1=>
'class="pair"');
1290 $bcdd = array(0=>
'class="drag drop oddeven"', 1=>
'class="drag drop oddeven"');
1291 $bcnd = array(0=>
'class="nodrag nodrop nohover"', 1=>
'class="nodrag nodrop nohoverpair"');
1292 $bctag = array(0=>
'class="impair tagtr"', 1=>
'class="pair tagtr"');
1295 $mesg =
''; $warning =
''; $error = 0;
1297 $mesgs = array(); $warnings = array(); $errors = array();
1300 if (empty($conf->browser->firefox)) {
1301 define(
'ROWS_1', 1);
1302 define(
'ROWS_2', 2);
1303 define(
'ROWS_3', 3);
1304 define(
'ROWS_4', 4);
1305 define(
'ROWS_5', 5);
1306 define(
'ROWS_6', 6);
1307 define(
'ROWS_7', 7);
1308 define(
'ROWS_8', 8);
1309 define(
'ROWS_9', 9);
1311 define(
'ROWS_1', 0);
1312 define(
'ROWS_2', 1);
1313 define(
'ROWS_3', 2);
1314 define(
'ROWS_4', 3);
1315 define(
'ROWS_5', 4);
1316 define(
'ROWS_6', 5);
1317 define(
'ROWS_7', 6);
1318 define(
'ROWS_8', 7);
1319 define(
'ROWS_9', 8);
1322 $heightforframes = 50;
1325 if (!defined(
'NOREQUIREMENU')) {
1326 if (empty($user->socid)) {
1327 $conf->standard_menu = (empty($conf->global->MAIN_MENU_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENU_STANDARD) ?
'eldy_menu.php' : $conf->global->MAIN_MENU_STANDARD) : $conf->global->MAIN_MENU_STANDARD_FORCED);
1330 $conf->standard_menu = (empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENUFRONT_STANDARD) ?
'eldy_menu.php' : $conf->global->MAIN_MENUFRONT_STANDARD) : $conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
1334 $file_menu = $conf->standard_menu;
1335 if (
GETPOST(
'menu',
'alpha')) {
1336 $file_menu =
GETPOST(
'menu',
'alpha');
1338 if (!class_exists(
'MenuManager')) {
1340 $dirmenus = array_merge(array(
"/core/menus/"), (array) $conf->modules_parts[
'menus']);
1341 foreach ($dirmenus as $dirmenu) {
1343 if (class_exists(
'MenuManager')) {
1347 if (!class_exists(
'MenuManager')) {
1348 dol_syslog(
"You define a menu manager '".$file_menu.
"' that can not be loaded.", LOG_WARNING);
1349 $file_menu =
'eldy_menu.php';
1350 include_once DOL_DOCUMENT_ROOT.
"/core/menus/standard/".$file_menu;
1353 $menumanager =
new MenuManager($db, empty($user->socid) ? 0 : 1);
1354 $menumanager->loadMenu();
1361 if (!function_exists(
"llxHeader")) {
1382 function llxHeader($head =
'', $title =
'',
$help_url =
'', $target =
'', $disablejs = 0, $disablehead = 0, $arrayofjs =
'', $arrayofcss =
'', $morequerystring =
'', $morecssonbody =
'', $replacemainareaby =
'', $disablenofollow = 0, $disablenoindex = 0)
1384 global $conf, $hookmanager;
1387 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, $disablenofollow, $disablenoindex);
1389 $tmpcsstouse =
'sidebar-collapse'.($morecssonbody ?
' '.$morecssonbody :
'');
1391 if ($conf->theme ==
'md' && !in_array($conf->browser->layout, array(
'phone',
'tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
1393 if ($mainmenu !=
'website') {
1394 $tmpcsstouse = $morecssonbody;
1398 if (!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)) {
1399 $tmpcsstouse .=
' colorblind-'.strip_tags($conf->global->MAIN_OPTIMIZEFORCOLORBLIND);
1402 print
'<body id="mainbody" class="'.$tmpcsstouse.
'">'.
"\n";
1404 $parameters = array(
'help_url' =>
$help_url);
1405 $reshook = $hookmanager->executeHooks(
'changeHelpURL', $parameters);
1411 if ((empty($conf->dol_hide_topmenu) ||
GETPOST(
'dol_invisible_topmenu',
'int')) && !
GETPOST(
'dol_openinpopup',
'aZ09')) {
1412 top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss, $morequerystring,
$help_url);
1415 if (empty($conf->dol_hide_leftmenu) && !
GETPOST(
'dol_openinpopup',
'aZ09')) {
1420 if ($replacemainareaby) {
1421 print $replacemainareaby;
1438 global $db, $conf, $hookmanager;
1440 if ($contenttype ==
'text/html') {
1441 header(
"Content-Type: text/html; charset=".$conf->file->character_set_client);
1443 header(
"Content-Type: ".$contenttype);
1449 header(
"X-Content-Type-Options: nosniff");
1452 if (!defined(
'XFRAMEOPTIONS_ALLOWALL')) {
1453 header(
"X-Frame-Options: SAMEORIGIN");
1455 header(
"X-Frame-Options: ALLOWALL");
1462 if (!defined(
'MAIN_SECURITY_FORCECSP')) {
1469 if (!is_object($hookmanager)) {
1470 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
1473 $hookmanager->initHooks(array(
"main"));
1475 $parameters = array(
'contentsecuritypolicy'=>$contentsecuritypolicy);
1476 $result = $hookmanager->executeHooks(
'setContentSecurityPolicy', $parameters);
1478 $contentsecuritypolicy = $hookmanager->resPrint;
1480 $contentsecuritypolicy .= $hookmanager->resPrint;
1483 if (!empty($contentsecuritypolicy)) {
1492 header(
"Content-Security-Policy: ".$contentsecuritypolicy);
1495 header(
"Content-Security-Policy: ".constant(
'MAIN_SECURITY_FORCECSP'));
1501 if (!defined(
'MAIN_SECURITY_FORCERP')) {
1504 header(
"Referrer-Policy: ".$referrerpolicy);
1507 if ($forcenocache) {
1508 header(
"Cache-Control: no-cache, no-store, must-revalidate, max-age=0");
1530 function top_htmlhead($head, $title =
'', $disablejs = 0, $disablehead = 0, $arrayofjs =
'', $arrayofcss =
'', $disableforlogin = 0, $disablenofollow = 0, $disablenoindex = 0)
1532 global $db, $conf, $langs, $user, $mysoc, $hookmanager;
1536 if (empty($conf->css)) {
1537 $conf->css =
'/theme/eldy/style.css.php';
1540 print
'<!doctype html>'.
"\n";
1542 print
'<html lang="'.substr($langs->defaultlang, 0, 2).
'">'.
"\n";
1545 if (empty($disablehead)) {
1546 if (!is_object($hookmanager)) {
1549 $hookmanager->initHooks(array(
"main"));
1551 $ext =
'layout='.$conf->browser->layout.
'&version='.urlencode(DOL_VERSION);
1555 if (
GETPOST(
'dol_basehref',
'alpha')) {
1556 print
'<base href="'.dol_escape_htmltag(
GETPOST(
'dol_basehref',
'alpha')).
'">'.
"\n";
1560 print
'<meta charset="utf-8">'.
"\n";
1561 print
'<meta name="robots" content="'.($disablenoindex ?
'index' :
'noindex').($disablenofollow ?
',follow' :
',nofollow').
'">'.
"\n";
1562 print
'<meta name="viewport" content="width=device-width, initial-scale=1.0">'.
"\n";
1563 print
'<meta name="author" content="Dolibarr Development Team">'.
"\n";
1564 print
'<meta name="anti-csrf-token" content="'.newToken().
'">'.
"\n";
1566 print
'<meta name="MAIN_FEATURES_LEVEL" content="'.getDolGlobalInt(
'MAIN_FEATURES_LEVEL').
'">'.
"\n";
1569 $favicon = DOL_URL_ROOT.
'/theme/dolibarr_256x256_color.png';
1570 if (!empty($mysoc->logo_squarred_mini)) {
1571 $favicon = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.$mysoc->logo_squarred_mini);
1576 if (empty($conf->dol_use_jmobile)) {
1577 print
'<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.
'"/>'.
"\n";
1585 $manifest = DOL_URL_ROOT.
'/theme/'.$conf->theme.
'/manifest.json.php';
1586 if (!empty($manifest)) {
1587 print
'<link rel="manifest" href="'.$manifest.
'" />'.
"\n";
1590 if (!empty($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
1592 print
'<meta name="theme-color" content="rgb('.$conf->global->THEME_ELDY_TOPMENU_BACK1.
')">'.
"\n";
1596 if (
GETPOST(
'autorefresh',
'int') > 0) {
1597 print
'<meta http-equiv="refresh" content="'.GETPOST(
'autorefresh',
'int').
'">';
1601 $appli = constant(
'DOL_APPLICATION_TITLE');
1602 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
1603 $appli = $conf->global->MAIN_APPLICATION_TITLE;
1608 if ($title && !empty($conf->global->MAIN_HTML_TITLE) && preg_match(
'/noapp/', $conf->global->MAIN_HTML_TITLE)) {
1616 $parameters = array(
'title'=>$titletoshow);
1617 $result = $hookmanager->executeHooks(
'setHtmlTitle', $parameters);
1619 $titletoshow = $hookmanager->resPrint;
1621 $titletoshow .= $hookmanager->resPrint;
1629 if (
GETPOST(
'version',
'int')) {
1630 $ext =
'version='.GETPOST(
'version',
'int');
1633 if (
GETPOST(
'dol_resetcache')) {
1634 dolibarr_set_const($db,
"MAIN_IHM_PARAMS_REV", ((
int) $conf->global->MAIN_IHM_PARAMS_REV) + 1,
'chaine', 0,
'', $conf->entity);
1637 $themeparam =
'?lang='.$langs->defaultlang.
'&theme='.$conf->theme.(GETPOST(
'optioncss',
'aZ09') ?
'&optioncss='.GETPOST(
'optioncss',
'aZ09', 1) :
'').(empty($user->id) ?
'' : (
'&userid='.$user->id)).
'&entity='.$conf->entity;
1639 $themeparam .= ($ext ?
'&'.$ext :
'').
'&revision='.
getDolGlobalInt(
"MAIN_IHM_PARAMS_REV");
1641 $themeparam .=
'&dol_hide_topmenu='.GETPOST(
'dol_hide_topmenu',
'int');
1644 $themeparam .=
'&dol_hide_leftmenu='.GETPOST(
'dol_hide_leftmenu',
'int');
1647 $themeparam .=
'&dol_optimize_smallscreen='.GETPOST(
'dol_optimize_smallscreen',
'int');
1650 $themeparam .=
'&dol_no_mouse_hover='.GETPOST(
'dol_no_mouse_hover',
'int');
1653 $themeparam .=
'&dol_use_jmobile='.GETPOST(
'dol_use_jmobile',
'int'); $conf->dol_use_jmobile =
GETPOST(
'dol_use_jmobile',
'int');
1656 $themeparam .=
'&THEME_DARKMODEENABLED='.GETPOST(
'THEME_DARKMODEENABLED',
'int');
1659 $themeparam .=
'&THEME_SATURATE_RATIO='.GETPOST(
'THEME_SATURATE_RATIO',
'int');
1662 if (!empty($conf->global->MAIN_ENABLE_FONT_ROBOTO)) {
1663 print
'<link rel="preconnect" href="https://fonts.gstatic.com">'.
"\n";
1664 print
'<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@200;300;400;500;600&display=swap" rel="stylesheet">'.
"\n";
1667 if (!defined(
'DISABLE_JQUERY') && !$disablejs && $conf->use_javascript_ajax) {
1668 print
'<!-- Includes CSS for JQuery (Ajax library) -->'.
"\n";
1669 $jquerytheme =
'base';
1670 if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) {
1671 $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
1673 if (constant(
'JS_JQUERY_UI')) {
1674 print
'<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.
'css/'.$jquerytheme.
'/jquery-ui.min.css'.($ext ?
'?'.$ext :
'').
'">'.
"\n";
1676 print
'<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.
'/includes/jquery/css/'.$jquerytheme.
'/jquery-ui.css'.($ext ?
'?'.$ext :
'').
'">'.
"\n";
1678 if (!defined(
'DISABLE_JQUERY_JNOTIFY')) {
1679 print
'<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.
'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css'.($ext ?
'?'.$ext :
'').
'">'.
"\n";
1681 if (!defined(
'DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined(
'REQUIRE_JQUERY_MULTISELECT'))) {
1682 $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant(
'REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
1683 print
'<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.
'/includes/jquery/plugins/'.$tmpplugin.
'/dist/css/'.$tmpplugin.
'.css'.($ext ?
'?'.$ext :
'').
'">'.
"\n";
1687 if (!defined(
'DISABLE_FONT_AWSOME')) {
1688 print
'<!-- Includes CSS for font awesome -->'.
"\n";
1689 print
'<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.
'/theme/common/fontawesome-5/css/all.min.css'.($ext ?
'?'.$ext :
'').
'">'.
"\n";
1690 print
'<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.
'/theme/common/fontawesome-5/css/v4-shims.min.css'.($ext ?
'?'.$ext :
'').
'">'.
"\n";
1693 print
'<!-- Includes CSS for Dolibarr theme -->'.
"\n";
1697 if (!empty($conf->modules_parts[
'theme'])) {
1698 foreach ($conf->modules_parts[
'theme'] as $reldir) {
1701 $themesubdir = $reldir;
1708 print
'<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.
'">'.
"\n";
1709 if (!empty($conf->global->MAIN_FIX_FLASH_ON_CHROME)) {
1710 print
'<!-- Includes CSS that does not exists as a workaround of flash bug of chrome -->'.
"\n".
'<link rel="stylesheet" type="text/css" href="filethatdoesnotexiststosolvechromeflashbug">'.
"\n";
1714 if (!empty($conf->modules_parts[
'css'])) {
1715 $arraycss = (array) $conf->modules_parts[
'css'];
1716 foreach ($arraycss as $modcss => $filescss) {
1717 $filescss = (array) $filescss;
1718 foreach ($filescss as $cssfile) {
1719 if (empty($cssfile)) {
1720 dol_syslog(
"Warning: module ".$modcss.
" declared a css path file into its descriptor that is empty.", LOG_WARNING);
1724 if ($urlforcss && $urlforcss !=
'/') {
1725 print
'<!-- Includes CSS added by module '.$modcss.
' -->'.
"\n".
'<link rel="stylesheet" type="text/css" href="'.$urlforcss;
1727 if (!preg_match(
'/\.css$/i', $cssfile)) {
1732 dol_syslog(
"Warning: module ".$modcss.
" declared a css path file for a file we can't find.", LOG_WARNING);
1738 if (is_array($arrayofcss)) {
1739 foreach ($arrayofcss as $cssfile) {
1740 if (preg_match(
'/^(http|\/\/)/i', $cssfile)) {
1741 $urltofile = $cssfile;
1745 print
'<!-- Includes CSS added by page -->'.
"\n".
'<link rel="stylesheet" type="text/css" title="default" href="'.$urltofile;
1747 if (!preg_match(
'/\.css$/i', $cssfile)) {
1755 if (!defined(
'DISABLE_JQUERY') && !$disablejs && !empty($conf->use_javascript_ajax)) {
1757 print
'<!-- Includes JS for JQuery -->'.
"\n";
1758 if (defined(
'JS_JQUERY') && constant(
'JS_JQUERY')) {
1759 print
'<script src="'.JS_JQUERY.
'jquery.min.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1761 print
'<script src="'.DOL_URL_ROOT.
'/includes/jquery/js/jquery.min.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1763 if (defined(
'JS_JQUERY_UI') && constant(
'JS_JQUERY_UI')) {
1764 print
'<script src="'.JS_JQUERY_UI.
'jquery-ui.min.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1766 print
'<script src="'.DOL_URL_ROOT.
'/includes/jquery/js/jquery-ui.min.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1769 if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined(
'DISABLE_JQUERY_JNOTIFY')) {
1770 print
'<script src="'.DOL_URL_ROOT.
'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1773 if (empty($disableforlogin) && !defined(
'DISABLE_JQUERY_TABLEDND')) {
1774 print
'<script src="'.DOL_URL_ROOT.
'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1777 if (empty($disableforlogin) && (empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH ==
'chart') && !defined(
'DISABLE_JS_GRAPH')) {
1778 print
'<script src="'.DOL_URL_ROOT.
'/includes/nnnick/chartjs/dist/chart.min.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1782 if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !defined(
'DISABLE_JQUERY_JEDITABLE')) {
1783 print
'<!-- JS to manage editInPlace feature -->'.
"\n";
1784 print
'<script src="'.DOL_URL_ROOT.
'/includes/jquery/plugins/jeditable/jquery.jeditable.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1785 print
'<script src="'.DOL_URL_ROOT.
'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1786 print
'<script src="'.DOL_URL_ROOT.
'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1787 print
'<script>'.
"\n";
1788 print
'var urlSaveInPlace = \''.DOL_URL_ROOT.
'/core/ajax/saveinplace.php\';'.
"\n";
1789 print
'var urlLoadInPlace = \''.DOL_URL_ROOT.
'/core/ajax/loadinplace.php\';'.
"\n";
1790 print
'var tooltipInPlace = \''.$langs->transnoentities(
'ClickToEdit').
'\';
'."\n"; // Added in title attribute of span
1791 print 'var placeholderInPlace = \
' \';'.
"\n";
1792 print
'var cancelInPlace = \''.$langs->trans(
"Cancel").
'\';
'."\n";
1793 print 'var submitInPlace = \
''.$langs->trans(
'Ok').
'\';
'."\n";
1794 print 'var indicatorInPlace = \
'<img src="'.DOL_URL_ROOT.
"/theme/".$conf->theme.
"/img/working.gif".
'">\';'.
"\n";
1795 print
'var withInPlace = 300;';
1796 print
'</script>'.
"\n";
1797 print
'<script src="'.DOL_URL_ROOT.
'/core/js/editinplace.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1798 print
'<script src="'.DOL_URL_ROOT.
'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1801 if (!empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined(
'REQUIRE_JQUERY_TIMEPICKER')) {
1802 print
'<script src="'.DOL_URL_ROOT.
'/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1803 print
'<script src="'.DOL_URL_ROOT.
'/core/js/timepicker.js.php?lang='.$langs->defaultlang.($ext ?
'&'.$ext :
'').
'"></script>'.
"\n";
1805 if (!defined(
'DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined(
'REQUIRE_JQUERY_MULTISELECT'))) {
1807 $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant(
'REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
1808 print
'<script src="'.DOL_URL_ROOT.
'/includes/jquery/plugins/'.$tmpplugin.
'/dist/js/'.$tmpplugin.
'.full.min.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1810 if (!defined(
'DISABLE_MULTISELECT')) {
1811 print
'<script src="'.DOL_URL_ROOT.
'/includes/jquery/plugins/multiselect/jquery.multi-select.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1815 if (!$disablejs && !empty($conf->use_javascript_ajax)) {
1817 if (empty($disableforlogin) && (
isModEnabled(
'fckeditor') && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME ==
'ckeditor') && !defined(
'DISABLE_CKEDITOR')) || defined(
'FORCE_CKEDITOR')) {
1818 print
'<!-- Includes JS for CKEditor -->'.
"\n";
1819 $pathckeditor = DOL_URL_ROOT.
'/includes/ckeditor/ckeditor/';
1820 $jsckeditor =
'ckeditor.js';
1821 if (constant(
'JS_CKEDITOR')) {
1823 $pathckeditor = constant(
'JS_CKEDITOR');
1826 print
'/* enable ckeditor by main.inc.php */';
1827 print
'var CKEDITOR_BASEPATH = \''.dol_escape_js($pathckeditor).
'\';
'."\n";
1828 print 'var ckeditorConfig = \
''.dol_escape_js(
dol_buildpath($themesubdir.
'/theme/'.$conf->theme.
'/ckeditor/config.js'.($ext ?
'?'.$ext :
''), 1)).
'\';
'."\n"; // $themesubdir='' in standard usage
1829 print 'var ckeditorFilebrowserBrowseUrl = \
''.DOL_URL_ROOT.
'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_URL_ROOT.
'/core/filemanagerdol/connectors/php/connector.php\';'.
"\n";
1830 print
'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.
'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.
'/core/filemanagerdol/connectors/php/connector.php\';'.
"\n";
1831 print
'</script>'.
"\n";
1832 print
'<script src="'.$pathckeditor.$jsckeditor.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1834 if (
GETPOST(
'mode',
'aZ09') ==
'Full_inline') {
1835 print
'CKEDITOR.disableAutoInline = false;'.
"\n";
1837 print
'CKEDITOR.disableAutoInline = true;'.
"\n";
1839 print
'</script>'.
"\n";
1843 if (!defined(
'NOBROWSERNOTIF') && !defined(
'NOREQUIREMENU') && !defined(
'NOLOGIN')) {
1844 $enablebrowsernotif =
false;
1845 if (
isModEnabled(
'agenda') && !empty($conf->global->AGENDA_REMINDER_BROWSER)) {
1846 $enablebrowsernotif =
true;
1848 if ($conf->browser->layout ==
'phone') {
1849 $enablebrowsernotif =
false;
1851 if ($enablebrowsernotif) {
1852 print
'<!-- Includes JS of Dolibarr (browser layout = '.$conf->browser->layout.
')-->'.
"\n";
1853 print
'<script src="'.DOL_URL_ROOT.
'/core/js/lib_notification.js.php'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1858 print
'<!-- Includes JS of Dolibarr -->'.
"\n";
1859 print
'<script src="'.DOL_URL_ROOT.
'/core/js/lib_head.js.php?lang='.$langs->defaultlang.($ext ?
'&'.$ext :
'').
'"></script>'.
"\n";
1862 if (!empty($conf->modules_parts[
'js'])) {
1863 $arrayjs = (array) $conf->modules_parts[
'js'];
1864 foreach ($arrayjs as $modjs => $filesjs) {
1865 $filesjs = (array) $filesjs;
1866 foreach ($filesjs as $jsfile) {
1869 if ($urlforjs && $urlforjs !=
'/') {
1870 print
'<!-- Include JS added by module '.$modjs.
'-->'.
"\n".
'<script src="'.$urlforjs.((strpos($jsfile,
'?') ===
false) ?
'?' :
'&').
'lang='.$langs->defaultlang.
'"></script>'.
"\n";
1872 dol_syslog(
"Warning: module ".$modjs.
" declared a js path file for a file we can't find.", LOG_WARNING);
1878 if (is_array($arrayofjs)) {
1879 print
'<!-- Includes JS added by page -->'.
"\n";
1880 foreach ($arrayofjs as $jsfile) {
1881 if (preg_match(
'/^(http|\/\/)/i', $jsfile)) {
1882 print
'<script src="'.$jsfile.((strpos($jsfile,
'?') ===
false) ?
'?' :
'&').
'lang='.$langs->defaultlang.
'"></script>'.
"\n";
1884 print
'<script src="'.dol_buildpath($jsfile, 1).((strpos($jsfile,
'?') ===
false) ?
'?' :
'&').
'lang='.$langs->defaultlang.
'"></script>'.
"\n";
1891 if (!empty($conf->global->ALLOW_THEME_JS)) {
1892 $theme_js =
dol_buildpath(
'/theme/'.$conf->theme.
'/'.$conf->theme.
'.js', 0);
1893 if (file_exists($theme_js)) {
1894 print
'<script src="'.DOL_URL_ROOT.
'/theme/'.$conf->theme.
'/'.$conf->theme.
'.js'.($ext ?
'?'.$ext :
'').
'"></script>'.
"\n";
1898 if (!empty($head)) {
1901 if (!empty($conf->global->MAIN_HTML_HEADER)) {
1902 print $conf->global->MAIN_HTML_HEADER.
"\n";
1905 $parameters = array();
1906 $result = $hookmanager->executeHooks(
'addHtmlHeader', $parameters);
1907 print $hookmanager->resPrint;
1909 print
"</head>\n\n";
1912 $conf->headerdone = 1;
1932 function top_menu($head, $title =
'', $target =
'', $disablejs = 0, $disablehead = 0, $arrayofjs =
'', $arrayofcss =
'', $morequerystring =
'', $helppagename =
'')
1934 global $user, $conf, $langs, $db;
1935 global $dolibarr_main_authentication, $dolibarr_main_demo;
1936 global $hookmanager, $menumanager;
1941 $hookmanager->initHooks(array(
'toprightmenu'));
1946 if (empty($conf->headerdone)) {
1947 $disablenofollow = 0;
1948 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, $disablenofollow);
1949 print
'<body id="mainbody">';
1955 if ((empty($conf->dol_hide_topmenu) ||
GETPOST(
'dol_invisible_topmenu',
'int')) && (!defined(
'NOREQUIREMENU') || !constant(
'NOREQUIREMENU'))) {
1957 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
1961 print
"\n".
'<!-- Start top horizontal -->'.
"\n";
1963 print
'<header id="id-top" class="side-nav-vert'.(GETPOST(
'dol_invisible_topmenu',
'int') ?
' hidden' :
'').
'">';
1966 print
'<div id="tmenu_tooltip'.(empty($conf->global->MAIN_MENU_INVERT) ?
'' :
'invert').
'" class="tmenu">'.
"\n";
1967 $menumanager->atarget = $target;
1968 $menumanager->showmenu(
'top', array(
'searchform'=>$searchform));
1972 $appli = constant(
'DOL_APPLICATION_TITLE');
1973 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
1974 $appli = $conf->global->MAIN_APPLICATION_TITLE;
1975 if (preg_match(
'/\d\.\d/', $appli)) {
1976 if (!preg_match(
'/'.preg_quote(DOL_VERSION).
'/', $appli)) {
1977 $appli .=
" (".DOL_VERSION.
")";
1980 $appli .=
" ".DOL_VERSION;
1983 $appli .=
" ".DOL_VERSION;
1987 $appli .=
"<br>".$langs->trans(
"LevelOfFeature").
': '.
getDolGlobalInt(
'MAIN_FEATURES_LEVEL');
1991 $logouthtmltext =
'';
1992 if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
1994 if ($_SESSION[
"dol_authmode"] !=
'forceuser' && $_SESSION[
"dol_authmode"] !=
'http') {
1995 $logouthtmltext .= $langs->trans(
"Logout").
'<br>';
1997 $logouttext .=
'<a accesskey="l" href="'.DOL_URL_ROOT.
'/user/logout.php?token='.
newToken().
'">';
1998 $logouttext .=
img_picto($langs->trans(
'Logout'),
'sign-out',
'',
false, 0, 0,
'',
'atoplogin');
1999 $logouttext .=
'</a>';
2001 $logouthtmltext .= $langs->trans(
"NoLogoutProcessWithAuthMode", $_SESSION[
"dol_authmode"]);
2002 $logouttext .=
img_picto($langs->trans(
'Logout'),
'sign-out',
'',
false, 0, 0,
'',
'atoplogin opacitymedium');
2006 print
'<div class="login_block usedropdown">'.
"\n";
2008 $toprightmenu .=
'<div class="login_block_other">';
2011 $parameters = array();
2012 $result = $hookmanager->executeHooks(
'printTopRightMenu', $parameters);
2013 if (is_numeric($result)) {
2015 $toprightmenu .= $hookmanager->resPrint;
2017 $toprightmenu = $hookmanager->resPrint;
2020 $toprightmenu .= $result;
2025 $text =
'<a href="'.DOL_URL_ROOT.
'/modulebuilder/index.php?mainmenu=home&leftmenu=admintools" target="modulebuilder">';
2027 $text .=
'<span class="fa fa-bug atoplogin valignmiddle"></span>';
2029 $toprightmenu .=
$form->textwithtooltip(
'', $langs->trans(
"ModuleBuilder"), 2, 1, $text,
'login_block_elem', 2);
2033 if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
2036 if (isset($_POST) && is_array($_POST)) {
2037 foreach ($_POST as $key => $value) {
2038 if ($key !==
'action' && $key !==
'password' && !is_array($value)) {
2039 $qs .=
'&'.$key.
'='.urlencode($value);
2043 $qs .= (($qs && $morequerystring) ?
'&' :
'').$morequerystring;
2044 $text =
'<a href="'.dol_escape_htmltag($_SERVER[
"PHP_SELF"]).
'?'.$qs.($qs ?
'&' :
'').
'optioncss=print" target="_blank" rel="noopener noreferrer">';
2046 $text .=
'<span class="fa fa-print atoplogin valignmiddle"></span>';
2048 $toprightmenu .=
$form->textwithtooltip(
'', $langs->trans(
"PrintContentArea"), 2, 1, $text,
'login_block_elem', 2);
2052 if (empty($conf->global->MAIN_HELP_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
2053 $langs->load(
"help");
2060 if (empty($helppagename)) {
2061 $helppagename =
'EN:User_documentation|FR:Documentation_utilisateur|ES:Documentación_usuarios';
2063 $helppresent =
'helppresent';
2068 $helpbaseurl = $arrayres[
'helpbaseurl'];
2069 $helppage = $arrayres[
'helppage'];
2070 $mode = $arrayres[
'mode'];
2073 if ($helpbaseurl && $helppage) {
2075 $title = $langs->trans($mode ==
'wiki' ?
'GoToWikiHelpPage' :
'GoToHelpPage').
', ';
2076 if ($mode ==
'wiki') {
2077 $title .=
'<br>'.img_picto(
'',
'globe',
'class="pictofixedwidth"').$langs->trans(
"PageWiki").
' '.
dol_escape_htmltag(
'"'.strtr($helppage,
'_',
' ').
'"');
2079 $title .=
' <span class="opacitymedium">('.$langs->trans(
"DedicatedPageAvailable").
')</span>';
2081 $title .=
' <span class="opacitymedium">('.$langs->trans(
"HomePage").
')</span>';
2084 $text .=
'<a class="help" target="_blank" rel="noopener noreferrer" href="';
2085 if ($mode ==
'wiki') {
2086 $text .= sprintf($helpbaseurl, urlencode(html_entity_decode($helppage)));
2088 $text .= sprintf($helpbaseurl, $helppage);
2091 $text .=
'<span class="fa fa-question-circle atoplogin valignmiddle'.($helppresent ?
' '.$helppresent :
'').
'"></span>';
2092 $text .=
'<span class="fa fa-long-arrow-alt-up helppresentcircle'.($helppresent ?
'' :
' unvisible').
'"></span>';
2094 $toprightmenu .=
$form->textwithtooltip(
'', $title, 2, 1, $text,
'login_block_elem', 2);
2098 if (!empty($conf->global->MAIN_SHOWDATABASENAMEINHELPPAGESLINK)) {
2099 $langs->load(
'admin');
2100 $appli .=
'<br>'.$langs->trans(
"Database").
': '.$db->database_name;
2104 if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
2105 $text =
'<span class="aversion"><span class="hideonsmartphone small">'.DOL_VERSION.
'</span></span>';
2106 $toprightmenu .=
$form->textwithtooltip(
'', $appli, 2, 1, $text,
'login_block_elem', 2);
2110 $toprightmenu .=
$form->textwithtooltip(
'', $logouthtmltext, 2, 1, $logouttext,
'login_block_elem logout-btn', 2);
2112 $toprightmenu .=
'</div>';
2116 $toprightmenu .=
'<div class="login_block_user">';
2120 $toprightmenu .=
'<div class="inline-block nowrap"><div class="inline-block login_block_elem login_block_elem_name" style="padding: 0px;">';
2122 if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) {
2127 if (!empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) {
2138 $toprightmenu .=
'</div></div>';
2140 $toprightmenu .=
'</div>'.
"\n";
2143 print $toprightmenu;
2150 print
'<div style="clear: both;"></div>';
2151 print
"<!-- End top horizontal menu -->\n\n";
2154 if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile)) {
2155 print
'<!-- Begin div id-container --><div id="id-container" class="id-container">';
2169 global $langs, $conf, $db, $hookmanager, $user, $mysoc;
2170 global $dolibarr_main_authentication, $dolibarr_main_demo;
2171 global $menumanager;
2173 $langs->load(
'companies');
2175 $userImage = $userDropDownImage =
'';
2176 if (!empty($user->photo)) {
2177 $userImage =
Form::showphoto(
'userphoto', $user, 0, 0, 0,
'photouserphoto userphoto',
'small', 0, 1);
2178 $userDropDownImage =
Form::showphoto(
'userphoto', $user, 0, 0, 0,
'dropdown-user-image',
'small', 0, 1);
2180 $nophoto =
'/public/theme/common/user_anonymous.png';
2181 if ($user->gender ==
'man') {
2182 $nophoto =
'/public/theme/common/user_man.png';
2184 if ($user->gender ==
'woman') {
2185 $nophoto =
'/public/theme/common/user_woman.png';
2188 $userImage =
'<img class="photo photouserphoto userphoto" alt="No photo" src="'.DOL_URL_ROOT.$nophoto.
'">';
2189 $userDropDownImage =
'<img class="photo dropdown-user-image" alt="No photo" src="'.DOL_URL_ROOT.$nophoto.
'">';
2193 $dropdownBody .=
'<span id="topmenulogincompanyinfo-btn"><i class="fa fa-caret-right"></i> '.$langs->trans(
"ShowCompanyInfos").
'</span>';
2194 $dropdownBody .=
'<div id="topmenulogincompanyinfo" >';
2196 if ($langs->transcountry(
"ProfId1", $mysoc->country_code) !=
'-') {
2199 if ($langs->transcountry(
"ProfId2", $mysoc->country_code) !=
'-') {
2202 if ($langs->transcountry(
"ProfId3", $mysoc->country_code) !=
'-') {
2205 if ($langs->transcountry(
"ProfId4", $mysoc->country_code) !=
'-') {
2208 if ($langs->transcountry(
"ProfId5", $mysoc->country_code) !=
'-') {
2211 if ($langs->transcountry(
"ProfId6", $mysoc->country_code) !=
'-') {
2215 $dropdownBody .=
'<br><b>'.$langs->trans(
"Country").
'</b>: <span>'.($mysoc->country_code ? $langs->trans(
"Country".$mysoc->country_code) :
'').
'</span>';
2217 $dropdownBody .=
'</div>';
2219 $dropdownBody .=
'<br>';
2220 $dropdownBody .=
'<span id="topmenuloginmoreinfo-btn"><i class="fa fa-caret-right"></i> '.$langs->trans(
"ShowMoreInfos").
'</span>';
2221 $dropdownBody .=
'<div id="topmenuloginmoreinfo" >';
2224 if (!empty($user->admin)) {
2225 $dropdownBody .=
'<br><b>'.$langs->trans(
"Administrator").
'</b>: '.
yn($user->admin);
2227 if (!empty($user->socid)) {
2228 $thirdpartystatic =
new Societe($db);
2229 $thirdpartystatic->fetch($user->socid);
2230 $companylink =
' '.$thirdpartystatic->getNomUrl(2);
2231 $company =
' ('.$langs->trans(
"Company").
': '.$thirdpartystatic->name.
')';
2233 $type = ($user->socid ? $langs->trans(
"External").$company : $langs->trans(
"Internal"));
2234 $dropdownBody .=
'<br><b>'.$langs->trans(
"Type").
':</b> '.$type;
2235 $dropdownBody .=
'<br><b>'.$langs->trans(
"Status").
'</b>: '.$user->getLibStatut(0);
2236 $dropdownBody .=
'<br>';
2238 $dropdownBody .=
'<br><u>'.$langs->trans(
"Session").
'</u>';
2239 $dropdownBody .=
'<br><b>'.$langs->trans(
"IPAddress").
'</b>: '.
dol_escape_htmltag($_SERVER[
"REMOTE_ADDR"]);
2240 if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY)) {
2241 $dropdownBody .=
'<br><b>'.$langs->trans(
"ConnectedOnMultiCompany").
':</b> '.$conf->entity.
' (user entity '.$user->entity.
')';
2243 $dropdownBody .=
'<br><b>'.$langs->trans(
"AuthenticationMode").
':</b> '.$_SESSION[
"dol_authmode"].(empty($dolibarr_main_demo) ?
'' :
' (demo)');
2244 $dropdownBody .=
'<br><b>'.$langs->trans(
"ConnectedSince").
':</b> '.
dol_print_date($user->datelastlogin,
"dayhour",
'tzuser');
2245 $dropdownBody .=
'<br><b>'.$langs->trans(
"PreviousConnexion").
':</b> '.
dol_print_date($user->datepreviouslogin,
"dayhour",
'tzuser');
2246 $dropdownBody .=
'<br><b>'.$langs->trans(
"CurrentTheme").
':</b> '.$conf->theme;
2247 $dropdownBody .=
'<br><b>'.$langs->trans(
"CurrentMenuManager").
':</b> '.(isset($menumanager) ? $menumanager->name :
'unknown');
2249 $dropdownBody .=
'<br><b>'.$langs->trans(
"CurrentUserLanguage").
':</b> '.($langFlag ? $langFlag.
' ' :
'').$langs->getDefaultLang();
2251 $tz = (int) $_SESSION[
'dol_tz'] + (
int) $_SESSION[
'dol_dst'];
2252 $dropdownBody .=
'<br><b>'.$langs->trans(
"ClientTZ").
':</b> '.($tz ? ($tz >= 0 ?
'+' :
'').$tz :
'');
2253 $dropdownBody .=
' ('.$_SESSION[
'dol_tz_string'].
')';
2258 $dropdownBody .=
'<br><b>'.$langs->trans(
"Browser").
':</b> '.$conf->browser->name.($conf->browser->version ?
' '.$conf->browser->version :
'').
' ('.
dol_escape_htmltag($_SERVER[
'HTTP_USER_AGENT']).
')';
2259 $dropdownBody .=
'<br><b>'.$langs->trans(
"Layout").
':</b> '.$conf->browser->layout;
2260 $dropdownBody .=
'<br><b>'.$langs->trans(
"Screen").
':</b> '.$_SESSION[
'dol_screenwidth'].
' x '.$_SESSION[
'dol_screenheight'];
2261 if ($conf->browser->layout ==
'phone') {
2262 $dropdownBody .=
'<br><b>'.$langs->trans(
"Phone").
':</b> '.$langs->trans(
"Yes");
2264 if (!empty($_SESSION[
"disablemodules"])) {
2265 $dropdownBody .=
'<br><b>'.$langs->trans(
"DisabledModules").
':</b> <br>'.join(
', ', explode(
',', $_SESSION[
"disablemodules"]));
2267 $dropdownBody .=
'</div>';
2270 $parameters = array(
'user'=>$user,
'langs' => $langs);
2271 $result = $hookmanager->executeHooks(
'printTopRightMenuLoginDropdownBody', $parameters);
2272 if (is_numeric($result)) {
2274 $dropdownBody .= $hookmanager->resPrint;
2276 $dropdownBody = $hookmanager->resPrint;
2280 if (empty($urllogout)) {
2281 $urllogout = DOL_URL_ROOT.
'/user/logout.php?token='.
newToken();
2283 $logoutLink =
'<a accesskey="l" href="'.$urllogout.
'" class="button-top-menu-dropdown" ><i class="fa fa-sign-out-alt"></i> '.$langs->trans(
"Logout").
'</a>';
2284 $profilLink =
'<a accesskey="l" href="'.DOL_URL_ROOT.
'/user/card.php?id='.$user->id.
'" class="button-top-menu-dropdown" ><i class="fa fa-user"></i> '.$langs->trans(
"Card").
'</a>';
2287 $profilName = $user->getFullName($langs).
' ('.$user->login.
')';
2289 if (!empty($user->admin)) {
2290 $profilName =
'<i class="far fa-star classfortooltip" title="'.$langs->trans(
"Administrator").
'" ></i> '.$profilName;
2294 $appli = constant(
'DOL_APPLICATION_TITLE');
2295 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
2296 $appli = $conf->global->MAIN_APPLICATION_TITLE;
2297 if (preg_match(
'/\d\.\d/', $appli)) {
2298 if (!preg_match(
'/'.preg_quote(DOL_VERSION).
'/', $appli)) {
2299 $appli .=
" (".DOL_VERSION.
")";
2302 $appli .=
" ".DOL_VERSION;
2305 $appli .=
" ".DOL_VERSION;
2308 if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
2309 $btnUser =
'<!-- div for user link -->
2310 <div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu inline-block">
2311 <a href="'.DOL_URL_ROOT.
'/user/card.php?id='.$user->id.
'" class="dropdown-toggle login-dropdown-a" data-toggle="dropdown">
2312 '.$userImage.(empty($user->photo) ?
'<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone paddingleft">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).
'</span>' :
'').
'
2314 <div class="dropdown-menu">
2316 <div class="user-header">
2317 '.$userDropDownImage.
'
2319 '.$profilName.
'<br>';
2320 if ($user->datelastlogin) {
2321 $title = $langs->trans(
"ConnectedSince").
' : '.
dol_print_date($user->datelastlogin,
"dayhour",
'tzuser');
2322 if ($user->datepreviouslogin) {
2323 $title .=
'<br>'.$langs->trans(
"PreviousConnexion").
' : '.
dol_print_date($user->datepreviouslogin,
"dayhour",
'tzuser');
2326 $btnUser .=
'<small class="classfortooltip" title="'.dol_escape_htmltag($title).
'" ><i class="fa fa-user-clock"></i> '.
dol_print_date($user->datelastlogin,
"dayhour",
'tzuser').
'</small><br>';
2327 if ($user->datepreviouslogin) {
2328 $btnUser .=
'<small class="classfortooltip" title="'.dol_escape_htmltag($title).
'" ><i class="fa fa-user-clock opacitymedium"></i> '.
dol_print_date($user->datepreviouslogin,
"dayhour",
'tzuser').
'</small><br>';
2337 <div class="user-body">'.$dropdownBody.
'</div>
2340 <div class="user-footer">
2341 <div class="pull-left">
2344 <div class="pull-right">
2347 <div style="clear:both;"></div>
2353 $btnUser =
'<!-- div for user link -->
2354 <div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu inline-block">
2355 <a href="'.DOL_URL_ROOT.
'/user/card.php?id='.$user->id.
'">
2357 <span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone">'.
dol_trunc($user->firstname ? $user->firstname : $user->login, 10).
'</span>
2362 if (!defined(
'JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) {
2364 <!-- Code to show/hide the user drop-down -->
2366 jQuery(document).ready(function() {
2367 jQuery(document).on("click", function(event) {
2368 if (!$(event.target).closest("#topmenu-login-dropdown").length) {
2369 //console.log("close login dropdown");
2371 jQuery("#topmenu-login-dropdown").removeClass("open");
2376 if ($conf->theme !=
'md') {
2378 jQuery("#topmenu-login-dropdown .dropdown-toggle").on("click", function(event) {
2379 console.log("toggle login dropdown");
2380 event.preventDefault();
2381 jQuery("#topmenu-login-dropdown").toggleClass("open");
2384 jQuery("#topmenulogincompanyinfo-btn").on("click", function() {
2385 console.log("Clik on topmenulogincompanyinfo-btn");
2386 jQuery("#topmenulogincompanyinfo").slideToggle();
2389 jQuery("#topmenuloginmoreinfo-btn").on("click", function() {
2390 console.log("Clik on topmenuloginmoreinfo-btn");
2391 jQuery("#topmenuloginmoreinfo").slideToggle();
2415 $html .=
'<!-- div for quick add link -->
2416 <div id="topmenu-quickadd-dropdown" class="atoplogin dropdown inline-block">
2417 <a class="dropdown-toggle login-dropdown-a" data-toggle="dropdown" href="#" title="'.$langs->trans(
'QuickAdd').
' ('.$langs->trans(
'QuickAddMenuShortCut').
')"><i class="fa fa-plus-circle"></i></a>
2421 <!-- Code to show/hide the user drop-down -->
2423 jQuery(document).ready(function() {
2424 jQuery(document).on("click", function(event) {
2425 if (!$(event.target).closest("#topmenu-quickadd-dropdown").length) {
2427 $("#topmenu-quickadd-dropdown").removeClass("open");
2430 $("#topmenu-quickadd-dropdown .dropdown-toggle").on("click", function(event) {
2431 openQuickAddDropDown();
2434 $(document).keydown(function(e){
2435 if( e.which === 76 && e.ctrlKey && e.shiftKey ){
2436 console.log(\'control + shift + l : trigger open quick add dropdown\');
2437 openQuickAddDropDown();
2442 var openQuickAddDropDown = function() {
2443 event.preventDefault();
2444 $("#topmenu-quickadd-dropdown").toggleClass("open");
2445 //$("#top-quickadd-search-input").focus();
2460 global $conf, $user, $langs, $hookmanager;
2465 "url" =>
"/adherents/card.php?action=create&mainmenu=members",
2466 "title" =>
"MenuNewMember@members",
2467 "name" =>
"Adherent@members",
2468 "picto" =>
"object_member",
2469 "activation" =>
isModEnabled(
'adherent') && $user->hasRight(
"adherent",
"write"),
2473 "url" =>
"/societe/card.php?action=create&mainmenu=companies",
2474 "title" =>
"MenuNewThirdParty@companies",
2475 "name" =>
"ThirdParty@companies",
2476 "picto" =>
"object_company",
2477 "activation" =>
isModEnabled(
"societe") && $user->hasRight(
"societe",
"write"),
2481 "url" =>
"/contact/card.php?action=create&mainmenu=companies",
2482 "title" =>
"NewContactAddress@companies",
2483 "name" =>
"Contact@companies",
2484 "picto" =>
"object_contact",
2485 "activation" =>
isModEnabled(
"societe") && $user->hasRight(
"societe",
"contact",
"write"),
2489 "url" =>
"/comm/propal/card.php?action=create&mainmenu=commercial",
2490 "title" =>
"NewPropal@propal",
2491 "name" =>
"Proposal@propal",
2492 "picto" =>
"object_propal",
2493 "activation" =>
isModEnabled(
"propal") && $user->hasRight(
"propal",
"write"),
2498 "url" =>
"/commande/card.php?action=create&mainmenu=commercial",
2499 "title" =>
"NewOrder@orders",
2500 "name" =>
"Order@orders",
2501 "picto" =>
"object_order",
2502 "activation" =>
isModEnabled(
'commande') && $user->hasRight(
"commande",
"write"),
2506 "url" =>
"/compta/facture/card.php?action=create&mainmenu=billing",
2507 "title" =>
"NewBill@bills",
2508 "name" =>
"Bill@bills",
2509 "picto" =>
"object_bill",
2510 "activation" =>
isModEnabled(
'facture') && $user->hasRight(
"facture",
"write"),
2514 "url" =>
"/contrat/card.php?action=create&mainmenu=commercial",
2515 "title" =>
"NewContractSubscription@contracts",
2516 "name" =>
"Contract@contracts",
2517 "picto" =>
"object_contract",
2518 "activation" =>
isModEnabled(
'contrat') && $user->hasRight(
"contrat",
"write"),
2522 "url" =>
"/supplier_proposal/card.php?action=create&mainmenu=commercial",
2523 "title" =>
"SupplierProposalNew@supplier_proposal",
2524 "name" =>
"SupplierProposal@supplier_proposal",
2525 "picto" =>
"supplier_proposal",
2526 "activation" =>
isModEnabled(
'supplier_proposal') && $user->hasRight(
"supplier_invoice",
"write"),
2530 "url" =>
"/fourn/commande/card.php?action=create&mainmenu=commercial",
2531 "title" =>
"NewSupplierOrderShort@orders",
2532 "name" =>
"SupplierOrder@orders",
2533 "picto" =>
"supplier_order",
2534 "activation" => (
isModEnabled(
"fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight(
"fournisseur",
"commande",
"write")) || (
isModEnabled(
"supplier_order") && $user->hasRight(
"supplier_invoice",
"write")),
2538 "url" =>
"/fourn/facture/card.php?action=create&mainmenu=billing",
2539 "title" =>
"NewBill@bills",
2540 "name" =>
"SupplierBill@bills",
2541 "picto" =>
"supplier_invoice",
2542 "activation" => (
isModEnabled(
"fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight(
"fournisseur",
"facture",
"write")) || (
isModEnabled(
"supplier_invoice") && $user->hasRight(
"supplier_invoice",
"write")),
2546 "url" =>
"/ticket/card.php?action=create&mainmenu=ticket",
2547 "title" =>
"NewTicket@ticket",
2548 "name" =>
"Ticket@ticket",
2549 "picto" =>
"ticket",
2550 "activation" =>
isModEnabled(
'ticket') && $user->hasRight(
"ticket",
"write"),
2554 "url" =>
"/fichinter/card.php?action=create&mainmenu=commercial",
2555 "title" =>
"NewIntervention@interventions",
2556 "name" =>
"Intervention@interventions",
2557 "picto" =>
"intervention",
2558 "activation" =>
isModEnabled(
'ficheinter') && $user->hasRight(
"ficheinter",
"creer"),
2562 "url" =>
"/product/card.php?action=create&type=0&mainmenu=products",
2563 "title" =>
"NewProduct@products",
2564 "name" =>
"Product@products",
2565 "picto" =>
"object_product",
2566 "activation" =>
isModEnabled(
"product") && $user->hasRight(
"produit",
"write"),
2570 "url" =>
"/product/card.php?action=create&type=1&mainmenu=products",
2571 "title" =>
"NewService@products",
2572 "name" =>
"Service@products",
2573 "picto" =>
"object_service",
2574 "activation" =>
isModEnabled(
"service") && $user->hasRight(
"service",
"write"),
2578 "url" =>
"/user/card.php?action=create&type=1&mainmenu=home",
2579 "title" =>
"AddUser@users",
2580 "name" =>
"User@users",
2582 "activation" => $user->hasRight(
"user",
"user",
"write"),
2588 $dropDownQuickAddHtml =
'';
2591 $dropDownQuickAddHtml .=
'<div class="quickadd-body dropdown-body">';
2592 $dropDownQuickAddHtml .=
'<div class="dropdown-quickadd-list">';
2595 $parameters = array();
2596 $hook_items = $items;
2597 $reshook = $hookmanager->executeHooks(
'menuDropdownQuickaddItems', $parameters, $hook_items);
2598 if (is_numeric($reshook) && !empty($hookmanager->results) && is_array($hookmanager->results)) {
2599 if ($reshook == 0) {
2600 $items[
'items'] = array_merge($items[
'items'], $hookmanager->results);
2602 $items = $hookmanager->results;
2606 $position = array();
2607 foreach ($items[
'items'] as $key => $row) {
2608 $position[$key] = $row[
'position'];
2610 $array1_sort_order = SORT_ASC;
2611 array_multisort($position, $array1_sort_order, $items[
'items']);
2614 foreach ($items[
'items'] as $item) {
2615 if (!$item[
'activation']) {
2618 $langs->load(explode(
'@', $item[
'title'])[1]);
2619 $langs->load(explode(
'@', $item[
'name'])[1]);
2620 $dropDownQuickAddHtml .=
'
2621 <a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item[
'url'].
'" title="'.$langs->trans(explode(
'@', $item[
'title'])[0]).
'">
2622 '.
img_picto(
'', $item[
'picto'],
'style="width:18px;"') .
' ' . $langs->trans(explode(
'@', $item[
'name'])[0]) .
'</a>
2626 $dropDownQuickAddHtml .=
'</div>';
2627 $dropDownQuickAddHtml .=
'</div>';
2629 return $dropDownQuickAddHtml;
2639 global $langs, $conf, $db, $user;
2644 if (!
isModEnabled(
'bookmark') || empty($user->rights->bookmark->lire)) {
2648 if (!defined(
'JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) {
2649 include_once DOL_DOCUMENT_ROOT.
'/bookmarks/bookmarks.lib.php';
2650 $langs->load(
"bookmarks");
2652 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
2653 $html .=
'<div id="topmenu-bookmark-dropdown" class="dropdown inline-block">';
2657 $html .=
'<!-- div for bookmark link -->
2658 <div id="topmenu-bookmark-dropdown" class="dropdown inline-block">
2659 <a class="dropdown-toggle login-dropdown-a" data-toggle="dropdown" href="#" title="'.$langs->trans(
'Bookmarks').
' ('.$langs->trans(
'BookmarksMenuShortCut').
')"><i class="fa fa-star"></i></a>
2660 <div class="dropdown-menu">
2666 <!-- Code to show/hide the bookmark drop-down -->
2668 jQuery(document).ready(function() {
2669 jQuery(document).on("click", function(event) {
2670 if (!$(event.target).closest("#topmenu-bookmark-dropdown").length) {
2671 //console.log("close bookmark dropdown - we click outside");
2673 $("#topmenu-bookmark-dropdown").removeClass("open");
2677 jQuery("#topmenu-bookmark-dropdown .dropdown-toggle").on("click", function(event) {
2678 console.log("toggle bookmark dropdown");
2679 openBookMarkDropDown();
2683 jQuery(document).keydown(function(e){
2684 if( e.which === 77 && e.ctrlKey && e.shiftKey ){
2685 console.log(\'control + shift + m : trigger open bookmark dropdown\');
2686 openBookMarkDropDown();
2691 var openBookMarkDropDown = function() {
2692 event.preventDefault();
2693 jQuery("#topmenu-bookmark-dropdown").toggleClass("open");
2694 jQuery("#top-bookmark-search-input").focus();
2712 global $langs, $conf, $db, $user, $hookmanager;
2717 $arrayresult =
null;
2718 include DOL_DOCUMENT_ROOT.
'/core/ajax/selectsearchbox.php';
2720 $defaultAction =
'';
2721 $buttonList =
'<div class="dropdown-global-search-button-list" >';
2723 foreach ($arrayresult as $keyItem => $item) {
2724 if (empty($defaultAction)) {
2725 $defaultAction = $item[
'url'];
2727 $buttonList .=
'<button class="dropdown-item global-search-item" data-target="'.dol_escape_htmltag($item[
'url']).
'" >';
2728 $buttonList .= $item[
'text'];
2729 $buttonList .=
'</button>';
2731 $buttonList .=
'</div>';
2734 $searchInput =
'<input name="sall" id="top-global-search-input" class="dropdown-search-input" placeholder="'.$langs->trans(
'Search').
'" autocomplete="off" >';
2736 $dropDownHtml =
'<form id="top-menu-action-search" name="actionsearch" method="GET" action="'.$defaultAction.
'" >';
2739 <!-- search input -->
2740 <div class="dropdown-header search-dropdown-header">
2747 <div class="dropdown-body search-dropdown-body">
2752 $dropDownHtml .=
'</form>';
2755 $html .=
'<!-- div for Global Search -->
2756 <div id="topmenu-global-search-dropdown" class="atoplogin dropdown inline-block">
2757 <a class="dropdown-toggle login-dropdown-a" data-toggle="dropdown" href="#" title="'.$langs->trans(
'Search').
' ('.$langs->trans(
'SearchMenuShortCut').
')">
2758 <i class="fa fa-search" ></i>
2760 <div class="dropdown-menu dropdown-search">
2766 <!-- Code to show/hide the user drop-down -->
2768 jQuery(document).ready(function() {
2770 // prevent submiting form on press ENTER
2771 jQuery("#top-global-search-input").keydown(function (e) {
2772 if (e.keyCode == 13) {
2773 var inputs = $(this).parents("form").eq(0).find(":button");
2774 if (inputs[inputs.index(this) + 1] != null) {
2775 inputs[inputs.index(this) + 1].focus();
2783 jQuery(document).keydown(function(e) {
2784 // Get the focused element:
2785 var $focused = $(":focus");
2786 if($focused.length && $focused.hasClass("global-search-item")){
2788 // UP - move to the previous line
2789 if (e.keyCode == 38) {
2791 $focused.prev().focus();
2794 // DOWN - move to the next line
2795 if (e.keyCode == 40) {
2797 $focused.next().focus();
2803 // submit form action
2804 jQuery(".dropdown-global-search-button-list .global-search-item").on("click", function(event) {
2805 jQuery("#top-menu-action-search").attr("action", $(this).data("target"));
2806 jQuery("#top-menu-action-search").submit();
2810 jQuery(document).on("click", function(event) {
2811 if (!$(event.target).closest("#topmenu-global-search-dropdown").length) {
2812 console.log("click close search - we click outside");
2814 jQuery("#topmenu-global-search-dropdown").removeClass("open");
2819 jQuery("#topmenu-global-search-dropdown .dropdown-toggle").on("click", function(event) {
2820 console.log("toggle search dropdown");
2821 openGlobalSearchDropDown();
2825 jQuery(document).keydown(function(e){
2826 if( e.which === 70 && e.ctrlKey && e.shiftKey ){
2827 console.log(\'control + shift + f : trigger open global-search dropdown\');
2828 openGlobalSearchDropDown();
2833 var openGlobalSearchDropDown = function() {
2834 jQuery("#topmenu-global-search-dropdown").toggleClass("open");
2835 jQuery("#top-global-search-input").focus();
2859 function left_menu($menu_array_before, $helppagename =
'', $notused =
'', $menu_array_after =
'', $leftmenuwithoutmainarea = 0, $title =
'', $acceptdelayedhtml = 0)
2861 global $user, $conf, $langs, $db,
$form;
2862 global $hookmanager, $menumanager;
2866 if (!empty($menu_array_before)) {
2867 dol_syslog(
"Deprecated parameter menu_array_before was used when calling main::left_menu function. Menu entries of module should now be defined into module descriptor and not provided when calling left_menu.", LOG_WARNING);
2870 if (empty($conf->dol_hide_leftmenu) && (!defined(
'NOREQUIREMENU') || !constant(
'NOREQUIREMENU'))) {
2872 $hookmanager->initHooks(array(
'searchform',
'leftblock'));
2874 print
"\n".
'<!-- Begin side-nav id-left -->'.
"\n".
'<div class="side-nav"><div id="id-left">'.
"\n";
2876 if ($conf->browser->layout ==
'phone') {
2877 $conf->global->MAIN_USE_OLD_SEARCH_FORM = 1;
2882 if (!is_object(
$form)) {
2886 if (empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) {
2888 $arrayresult =
null;
2889 include DOL_DOCUMENT_ROOT.
'/core/ajax/selectsearchbox.php';
2891 if ($conf->use_javascript_ajax && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) {
2892 $searchform .=
$form->selectArrayFilter(
'searchselectcombo', $arrayresult, $selected,
'', 1, 0, (empty($conf->global->MAIN_SEARCHBOX_CONTENT_LOADED_BEFORE_KEY) ? 1 : 0),
'vmenusearchselectcombo', 1, $langs->trans(
"Search"), 1);
2894 if (is_array($arrayresult)) {
2895 foreach ($arrayresult as $key => $val) {
2896 $searchform .=
printSearchForm($val[
'url'], $val[
'url'], $val[
'label'],
'maxwidth125',
'sall', (empty($val[
'shortcut']) ?
'' : $val[
'shortcut']),
'searchleft'.$key, $val[
'img']);
2902 $parameters = array(
'searchform' => $searchform);
2903 $reshook = $hookmanager->executeHooks(
'printSearchForm', $parameters);
2904 if (empty($reshook)) {
2905 $searchform .= $hookmanager->resPrint;
2907 $searchform = $hookmanager->resPrint;
2911 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) || empty($conf->use_javascript_ajax)) {
2912 $urltosearch = DOL_URL_ROOT.
'/core/search_page.php?showtitlebefore=1';
2913 $searchform =
'<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="'.$urltosearch.
'" accesskey="s" alt="'.
dol_escape_htmltag($langs->trans(
"ShowSearchFields")).
'">'.$langs->trans(
"Search").
'...</a></div></div>';
2914 } elseif ($conf->use_javascript_ajax && !empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) {
2915 $searchform =
'<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="#" alt="'.dol_escape_htmltag($langs->trans(
"ShowSearchFields")).
'">'.$langs->trans(
"Search").
'...</a></div><div id="divsearchforms2" style="display: none">'.$searchform.
'</div>';
2916 $searchform .=
'<script>
2917 jQuery(document).ready(function () {
2918 jQuery("#divsearchforms1").click(function(){
2919 jQuery("#divsearchforms2").toggle();
2923 $searchform .=
'</div>';
2928 print
'<!-- Begin left menu -->'.
"\n";
2930 print
'<div class="vmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ?
'' :
' title="Left menu"').
'>'.
"\n\n";
2933 $menumanager->menu_array = $menu_array_before;
2934 $menumanager->menu_array_after = $menu_array_after;
2935 $menumanager->showmenu(
'left', array(
'searchform'=>$searchform));
2939 print
"<!-- Begin Help Block-->\n";
2940 print
'<div id="blockvmenuhelp" class="blockvmenuhelp">'.
"\n";
2943 if (!empty($conf->global->MAIN_SHOW_VERSION)) {
2944 $doliurl =
'https://www.dolibarr.org';
2946 if (preg_match(
'/fr/i', $langs->defaultlang)) {
2947 $doliurl =
'https://www.dolibarr.fr';
2949 if (preg_match(
'/es/i', $langs->defaultlang)) {
2950 $doliurl =
'https://www.dolibarr.es';
2952 if (preg_match(
'/de/i', $langs->defaultlang)) {
2953 $doliurl =
'https://www.dolibarr.de';
2955 if (preg_match(
'/it/i', $langs->defaultlang)) {
2956 $doliurl =
'https://www.dolibarr.it';
2958 if (preg_match(
'/gr/i', $langs->defaultlang)) {
2959 $doliurl =
'https://www.dolibarr.gr';
2962 $appli = constant(
'DOL_APPLICATION_TITLE');
2963 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
2964 $appli = $conf->global->MAIN_APPLICATION_TITLE; $doliurl =
'';
2965 if (preg_match(
'/\d\.\d/', $appli)) {
2966 if (!preg_match(
'/'.preg_quote(DOL_VERSION).
'/', $appli)) {
2967 $appli .=
" (".DOL_VERSION.
")";
2970 $appli .=
" ".DOL_VERSION;
2973 $appli .=
" ".DOL_VERSION;
2975 print
'<div id="blockvmenuhelpapp" class="blockvmenuhelp">';
2977 print
'<a class="help" target="_blank" rel="noopener noreferrer" href="'.$doliurl.
'">';
2979 print
'<span class="help">';
2987 print
'</div>'.
"\n";
2991 if (!empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) {
2992 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
2994 if ($conf->global->MAIN_BUGTRACK_ENABLELINK ==
'github') {
2995 $bugbaseurl =
'https://github.com/Dolibarr/dolibarr/issues/new?labels=Bug';
2996 $bugbaseurl .=
'&title=';
2997 $bugbaseurl .= urlencode(
"Bug: ");
2998 $bugbaseurl .=
'&body=';
2999 $bugbaseurl .= urlencode(
"# Instructions\n");
3000 $bugbaseurl .= urlencode(
"*This is a template to help you report good issues. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.*\n");
3001 $bugbaseurl .= urlencode(
"*Please:*\n");
3002 $bugbaseurl .= urlencode(
"- *replace the bracket enclosed texts with meaningful information*\n");
3003 $bugbaseurl .= urlencode(
"- *remove any unused sub-section*\n");
3004 $bugbaseurl .= urlencode(
"\n");
3005 $bugbaseurl .= urlencode(
"\n");
3006 $bugbaseurl .= urlencode(
"# Bug\n");
3007 $bugbaseurl .= urlencode(
"[*Short description*]\n");
3008 $bugbaseurl .= urlencode(
"\n");
3009 $bugbaseurl .= urlencode(
"## Environment\n");
3010 $bugbaseurl .= urlencode(
"- **Version**: ".DOL_VERSION.
"\n");
3011 $bugbaseurl .= urlencode(
"- **OS**: ".php_uname(
's').
"\n");
3012 $bugbaseurl .= urlencode(
"- **Web server**: ".$_SERVER[
"SERVER_SOFTWARE"].
"\n");
3013 $bugbaseurl .= urlencode(
"- **PHP**: ".php_sapi_name().
' '.phpversion().
"\n");
3014 $bugbaseurl .= urlencode(
"- **Database**: ".$db::LABEL.
' '.$db->getVersion().
"\n");
3015 $bugbaseurl .= urlencode(
"- **URL(s)**: ".$_SERVER[
"REQUEST_URI"].
"\n");
3016 $bugbaseurl .= urlencode(
"\n");
3017 $bugbaseurl .= urlencode(
"## Expected and actual behavior\n");
3018 $bugbaseurl .= urlencode(
"[*Verbose description*]\n");
3019 $bugbaseurl .= urlencode(
"\n");
3020 $bugbaseurl .= urlencode(
"## Steps to reproduce the behavior\n");
3021 $bugbaseurl .= urlencode(
"[*Verbose description*]\n");
3022 $bugbaseurl .= urlencode(
"\n");
3023 $bugbaseurl .= urlencode(
"## [Attached files](https://help.github.com/articles/issue-attachments) (Screenshots, screencasts, dolibarr.log, debugging informations…)\n");
3024 $bugbaseurl .= urlencode(
"[*Files*]\n");
3025 $bugbaseurl .= urlencode(
"\n");
3027 $bugbaseurl .= urlencode(
"\n");
3028 $bugbaseurl .= urlencode(
"## Report\n");
3029 } elseif (!empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) {
3030 $bugbaseurl = $conf->global->MAIN_BUGTRACK_ENABLELINK;
3036 $parameters = array(
'bugbaseurl' => $bugbaseurl);
3037 $reshook = $hookmanager->executeHooks(
'printBugtrackInfo', $parameters);
3038 if (empty($reshook)) {
3039 $bugbaseurl .= $hookmanager->resPrint;
3041 $bugbaseurl = $hookmanager->resPrint;
3044 print
'<div id="blockvmenuhelpbugreport" class="blockvmenuhelp">';
3045 print
'<a class="help" target="_blank" rel="noopener noreferrer" href="'.$bugbaseurl.
'"><i class="fas fa-bug"></i> '.$langs->trans(
"FindBug").
'</a>';
3050 print
"<!-- End Help Block-->\n";
3054 print
"<!-- End left menu -->\n";
3058 $parameters = array();
3059 $reshook = $hookmanager->executeHooks(
'printLeftBlock', $parameters);
3060 print $hookmanager->resPrint;
3062 print
'</div></div> <!-- End side-nav id-left -->';
3066 print
'<!-- Begin right area -->'.
"\n";
3068 if (empty($leftmenuwithoutmainarea)) {
3082 global $conf, $langs, $hookmanager;
3084 if (empty($conf->dol_hide_leftmenu) && !
GETPOST(
'dol_openinpopup')) {
3085 print
'<div id="id-right">';
3090 print
'<!-- Begin div class="fiche" -->'.
"\n".
'<div class="fiche">'.
"\n";
3092 $hookmanager->initHooks(array(
'main'));
3093 $parameters = array();
3094 $reshook = $hookmanager->executeHooks(
'printMainArea', $parameters);
3095 print $hookmanager->resPrint;
3097 if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) {
3098 print
info_admin($langs->trans(
"WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED), 0, 0, 1,
'warning maintenancemode');
3102 if (!empty($conf->global->SHOW_SOCINFO_ON_PRINT) &&
GETPOST(
'optioncss',
'aZ09') ==
'print' && empty(
GETPOST(
'disable_show_socinfo_on_print',
'az09'))) {
3103 $parameters = array();
3104 $reshook = $hookmanager->executeHooks(
'showSocinfoOnPrint', $parameters);
3105 if (empty($reshook)) {
3106 print
'<!-- Begin show mysoc info header -->'.
"\n";
3107 print
'<div id="mysoc-info-header">'.
"\n";
3108 print
'<table class="centpercent div-table-responsive">'.
"\n";
3110 print
'<tr><td rowspan="0" class="width20p">';
3111 if ($conf->global->MAIN_SHOW_LOGO && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($conf->global->MAIN_INFO_SOCIETE_LOGO)) {
3112 print
'<img id="mysoc-info-header-logo" style="max-width:100%" alt="" src="'.DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode(
'logos/'.
dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_LOGO)).
'">';
3114 print
'</td><td rowspan="0" class="width50p"></td></tr>'.
"\n";
3115 print
'<tr><td class="titre bold">'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM).
'</td></tr>'.
"\n";
3116 print
'<tr><td>'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ADDRESS).
'<br>'.
dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP).
' '.
dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN).
'</td></tr>'.
"\n";
3117 if (!empty($conf->global->MAIN_INFO_SOCIETE_TEL)) {
3118 print
'<tr><td style="padding-left: 1em" class="small">'.$langs->trans(
"Phone").
' : '.
dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TEL).
'</td></tr>';
3120 if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) {
3121 print
'<tr><td style="padding-left: 1em" class="small">'.$langs->trans(
"Email").
' : '.
dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL).
'</td></tr>';
3123 if (!empty($conf->global->MAIN_INFO_SOCIETE_WEB)) {
3124 print
'<tr><td style="padding-left: 1em" class="small">'.$langs->trans(
"Web").
' : '.
dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_WEB).
'</td></tr>';
3127 print
'</table>'.
"\n";
3128 print
'</div>'.
"\n";
3129 print
'<!-- End show mysoc info header -->'.
"\n";
3148 if (preg_match(
'/^http/i', $helppagename)) {
3150 $helpbaseurl =
'%s';
3151 $helppage = $helppagename;
3156 if (preg_match(
'/^es/i', $langs->defaultlang)) {
3157 $helpbaseurl =
'http://wiki.dolibarr.org/index.php/%s';
3158 if (preg_match(
'/ES:([^|]+)/i', $helppagename, $reg)) {
3159 $helppage = $reg[1];
3162 if (preg_match(
'/^fr/i', $langs->defaultlang)) {
3163 $helpbaseurl =
'http://wiki.dolibarr.org/index.php/%s';
3164 if (preg_match(
'/FR:([^|]+)/i', $helppagename, $reg)) {
3165 $helppage = $reg[1];
3168 if (empty($helppage)) {
3169 $helpbaseurl =
'http://wiki.dolibarr.org/index.php/%s';
3170 if (preg_match(
'/EN:([^|]+)/i', $helppagename, $reg)) {
3171 $helppage = $reg[1];
3176 return array(
'helpbaseurl'=>$helpbaseurl,
'helppage'=>$helppage,
'mode'=>$mode);
3196 function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinputname, $accesskey =
'', $prefhtmlinputname =
'', $img =
'', $showtitlebefore = 0, $autofocus = 0)
3198 global $conf, $langs, $user;
3201 $ret .=
'<form action="'.$urlaction.
'" method="post" class="searchform nowraponall tagtr">';
3202 $ret .=
'<input type="hidden" name="token" value="'.newToken().
'">';
3203 $ret .=
'<input type="hidden" name="mode" value="search">';
3204 $ret .=
'<input type="hidden" name="savelogin" value="'.dol_escape_htmltag($user->login).
'">';
3205 if ($showtitlebefore) {
3206 $ret .=
'<div class="tagtd left">'.$title.
'</div> ';
3208 $ret .=
'<div class="tagtd">';
3209 $ret .=
img_picto(
'', $img,
'',
false, 0, 0,
'',
'paddingright width20');
3210 $ret .=
'<input type="text" class="flat '.$htmlmorecss.
'"';
3211 $ret .=
' style="background-repeat: no-repeat; background-position: 3px;"';
3212 $ret .= ($accesskey ?
' accesskey="'.$accesskey.
'"' :
'');
3213 $ret .=
' placeholder="'.strip_tags($title).
'"';
3214 $ret .= ($autofocus ?
' autofocus' :
'');
3215 $ret .=
' name="'.$htmlinputname.
'" id="'.$prefhtmlinputname.$htmlinputname.
'" />';
3216 $ret .=
'<button type="submit" class="button bordertransp" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px">';
3217 $ret .=
'<span class="fa fa-search"></span>';
3218 $ret .=
'</button>';
3220 $ret .=
"</form>\n";
3225 if (!function_exists(
"llxFooter")) {
3236 function llxFooter($comment =
'', $zone =
'private', $disabledoutputofmessages = 0)
3238 global $conf, $db, $langs, $user, $mysoc, $object, $hookmanager;
3239 global $delayedhtmlcontent;
3240 global $contextpage, $page, $limit, $mode;
3241 global $dolibarr_distrib;
3243 $ext =
'layout='.urlencode($conf->browser->layout).
'&version='.urlencode(DOL_VERSION);
3247 $parameters = array();
3248 $reshook = $hookmanager->executeHooks(
'llxFooter', $parameters, $object, $action);
3249 if (empty($reshook)) {
3250 $llxfooter .= $hookmanager->resPrint;
3251 } elseif ($reshook > 0) {
3252 $llxfooter = $hookmanager->resPrint;
3263 if (is_object($user) && !empty($user->lastsearch_values_tmp) && is_array($user->lastsearch_values_tmp)) {
3265 foreach ($user->lastsearch_values_tmp as $key => $val) {
3266 unset($_SESSION[
'lastsearch_values_tmp_'.$key]);
3267 if (count($val) && empty($_POST[
'button_removefilter']) && empty($_POST[
'button_removefilter_x'])) {
3268 if (empty($val[
'sortfield'])) {
3269 unset($val[
'sortfield']);
3271 if (empty($val[
'sortorder'])) {
3272 unset($val[
'sortorder']);
3274 dol_syslog(
'Save lastsearch_values_tmp_'.$key.
'='.json_encode($val, 0).
" (systematic recording of last search criterias)");
3275 $_SESSION[
'lastsearch_values_tmp_'.$key] = json_encode($val);
3276 unset($_SESSION[
'lastsearch_values_'.$key]);
3282 $relativepathstring = $_SERVER[
"PHP_SELF"];
3284 if (constant(
'DOL_URL_ROOT')) {
3285 $relativepathstring = preg_replace(
'/^'.preg_quote(constant(
'DOL_URL_ROOT'),
'/').
'/',
'', $relativepathstring);
3287 $relativepathstring = preg_replace(
'/^\//',
'', $relativepathstring);
3288 $relativepathstring = preg_replace(
'/^custom\//',
'', $relativepathstring);
3289 if (preg_match(
'/list\.php$/', $relativepathstring)) {
3290 unset($_SESSION[
'lastsearch_contextpage_tmp_'.$relativepathstring]);
3291 unset($_SESSION[
'lastsearch_page_tmp_'.$relativepathstring]);
3292 unset($_SESSION[
'lastsearch_limit_tmp_'.$relativepathstring]);
3293 unset($_SESSION[
'lastsearch_mode_tmp_'.$relativepathstring]);
3295 if (!empty($contextpage)) {
3296 $_SESSION[
'lastsearch_contextpage_tmp_'.$relativepathstring] = $contextpage;
3298 if (!empty($page) && $page > 0) {
3299 $_SESSION[
'lastsearch_page_tmp_'.$relativepathstring] = $page;
3301 if (!empty($limit) && $limit != $conf->liste_limit) {
3302 $_SESSION[
'lastsearch_limit_tmp_'.$relativepathstring] = $limit;
3304 if (!empty($mode)) {
3305 $_SESSION[
'lastsearch_mode_tmp_'.$relativepathstring] = $mode;
3308 unset($_SESSION[
'lastsearch_contextpage_'.$relativepathstring]);
3309 unset($_SESSION[
'lastsearch_page_'.$relativepathstring]);
3310 unset($_SESSION[
'lastsearch_limit_'.$relativepathstring]);
3311 unset($_SESSION[
'lastsearch_mode_'.$relativepathstring]);
3315 if (!empty($conf->global->MAIN_CORE_ERROR)) {
3317 if ($conf->use_javascript_ajax) {
3318 $title =
img_warning().
' '.$langs->trans(
'CoreErrorTitle');
3319 print
ajax_dialog($title, $langs->trans(
'CoreErrorMessage'));
3322 $msg =
img_warning().
' '.$langs->trans(
'CoreErrorMessage');
3323 print
'<div class="error">'.$msg.
'</div>';
3331 print
'</div> <!-- End div class="fiche" -->'.
"\n";
3333 if (empty($conf->dol_hide_leftmenu) && !
GETPOST(
'dol_openinpopup')) {
3334 print
'</div> <!-- End div id-right -->'.
"\n";
3337 if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile)) {
3338 print
'</div> <!-- End div id-container -->'.
"\n";
3343 print
'<!-- '.$comment.
' -->'.
"\n";
3348 if (!empty($delayedhtmlcontent)) {
3349 print $delayedhtmlcontent;
3352 if (!empty($conf->use_javascript_ajax)) {
3353 print
"\n".
'<!-- Includes JS Footer of Dolibarr -->'.
"\n";
3354 print
'<script src="'.DOL_URL_ROOT.
'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.($ext ?
'&'.$ext :
'').
'"></script>'.
"\n";
3358 if (
isModEnabled(
'blockedlog') && is_object($object) && !empty($object->id) && $object->id > 0 && $object->statut > 0) {
3359 if (in_array($object->element, array(
'facture'))) {
3360 print
"\n<!-- JS CODE TO ENABLE log when making a download or a preview of a document -->\n";
3363 jQuery(document).ready(
function () {
3364 $(
'a.documentpreview').click(
function() {
3365 $.post(
'<?php echo DOL_URL_ROOT."/blockedlog/ajax/block-add.php" ?>'
3367 id:<?php echo $object->id; ?>
3368 , element:
'<?php echo $object->element ?>'
3369 , action:
'DOC_PREVIEW'
3370 , token:
'<?php echo currentToken(); ?>'
3374 $(
'a.documentdownload').click(
function() {
3375 $.post(
'<?php echo DOL_URL_ROOT."/blockedlog/ajax/block-add.php" ?>'
3377 id:<?php echo $object->id; ?>
3378 , element:
'<?php echo $object->element ?>'
3379 , action:
'DOC_DOWNLOAD'
3380 , token:
'<?php echo currentToken(); ?>'
3391 print
"\n<!-- A div to allow dialog popup by jQuery('#dialogforpopup').dialog() -->\n";
3392 print
'<div id="dialogforpopup" style="display: none;"></div>'.
"\n";
3396 $forceping =
GETPOST(
'forceping',
'alpha');
3397 if (($_SERVER[
"PHP_SELF"] == DOL_URL_ROOT.
'/index.php') || $forceping) {
3399 $hash_unique_id = md5(
'dolibarr'.$conf->file->instance_unique_id);
3401 if (empty($conf->global->MAIN_FIRST_PING_OK_DATE)
3402 || (!empty($conf->file->instance_unique_id) && ($hash_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID) && ($conf->global->MAIN_FIRST_PING_OK_ID !=
'disabled'))
3405 if (strpos(
'alpha', DOL_VERSION) > 0 && !$forceping) {
3406 print
"\n<!-- NO JS CODE TO ENABLE the anonymous Ping. It is an alpha version -->\n";
3407 } elseif (empty($_COOKIE[
'DOLINSTALLNOPING_'.$hash_unique_id]) || $forceping) {
3410 if (!empty($conf->global->MAIN_LAST_PING_KO_DATE) && substr($conf->global->MAIN_LAST_PING_KO_DATE, 0, 6) ==
dol_print_date(
dol_now(),
'%Y%m') && !$forceping) {
3411 print
"\n<!-- NO JS CODE TO ENABLE the anonymous Ping. An error already occured this month, we will try later. -->\n";
3413 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
3415 print
"\n".
'<!-- Includes JS for Ping of Dolibarr forceping='.$forceping.
' MAIN_FIRST_PING_OK_DATE='.
getDolGlobalString(
"MAIN_FIRST_PING_OK_DATE").
' MAIN_FIRST_PING_OK_ID='.
getDolGlobalString(
"MAIN_FIRST_PING_OK_ID").
' MAIN_LAST_PING_KO_DATE='.
getDolGlobalString(
"MAIN_LAST_PING_KO_DATE").
' -->'.
"\n";
3416 print
"\n<!-- JS CODE TO ENABLE the anonymous Ping -->\n";
3417 $url_for_ping = (empty($conf->global->MAIN_URL_FOR_PING) ?
"https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING);
3419 $distrib =
'standard';
3420 if ($_SERVER[
"SERVER_ADMIN"] ==
'doliwamp@localhost') {
3421 $distrib =
'doliwamp';
3423 if (!empty($dolibarr_distrib)) {
3424 $distrib = $dolibarr_distrib;
3428 jQuery(document).ready(
function (tmp) {
3429 console.log(
"Try Ping with hash_unique_id is md5('dolibarr'+instance_unique_id)");
3432 url:
"<?php echo $url_for_ping ?>",
3437 hash_unique_id:
'<?php echo dol_escape_js($hash_unique_id); ?>',
3438 action:
'dolibarrping',
3439 version:
'<?php echo (float) DOL_VERSION; ?>',
3440 entity:
'<?php echo (int) $conf->entity; ?>',
3441 dbtype:
'<?php echo dol_escape_js($db->type); ?>',
3442 country_code:
'<?php echo $mysoc->country_code ? dol_escape_js($mysoc->country_code) : 'unknown
'; ?>',
3443 php_version:
'<?php echo dol_escape_js(phpversion()); ?>',
3444 os_version:
'<?php echo dol_escape_js(version_os('smr
')); ?>',
3445 distrib:
'<?php echo $distrib ? dol_escape_js($distrib) : 'unknown
'; ?>',
3446 token:
'notrequired'
3448 success:
function (data, status, xhr) {
3449 console.log(
"Ping ok");
3452 url:
'<?php echo DOL_URL_ROOT.'/core/ajax/pingresult.php
'; ?>',
3455 data: { hash_algo:
'md5', hash_unique_id:
'<?php echo dol_escape_js($hash_unique_id); ?>', action:
'firstpingok', token:
'<?php echo currentToken(); ?>' },
3458 error:
function (data,status,xhr) {
3459 console.log(
"Ping ko: " + data);
3462 url:
'<?php echo DOL_URL_ROOT.'/core/ajax/pingresult.php
'; ?>',
3465 data: { hash_algo:
'md5', hash_unique_id:
'<?php echo dol_escape_js($hash_unique_id); ?>', action:
'firstpingko', token:
'<?php echo currentToken(); ?>' },
3475 print
"\n<!-- NO JS CODE TO ENABLE the anonymous Ping. It was disabled -->\n";
3476 include_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
3478 dolibarr_set_const($db,
'MAIN_FIRST_PING_OK_ID',
'disabled',
'chaine', 0,
'', $conf->entity);
3483 $reshook = $hookmanager->executeHooks(
'beforeBodyClose');
3485 print $hookmanager->resPrint;
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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).
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays).
ajax_dialog($title, $message, $w=350, $h=150)
Show an ajax dialog.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
printDropdownBookmarksList()
Add area with bookmarks in top menu.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_stringtotime($string, $gm=1)
Convert a string date into a GM Timestamps date Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not s...
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
isHTTPS()
Return if we are using a HTTPS connexion Check HTTPS (no way to be modified by user but may be empty ...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
printCommonFooter($zone='private')
Print common footer : conf->global->MAIN_HTML_FOOTER js for switch of menu hider js for conf->global-...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_htmlentities($string, $flags=ENT_QUOTES|ENT_SUBSTITUTE, $encoding='UTF-8', $double_encode=false)
Replace htmlentities functions.
dol_print_profids($profID, $profIDtype, $countrycode='', $addcpButton=1, $separ=' ')
Format profIDs according to country.
getBrowserInfo($user_agent)
Return information about user browser.
dol_htmloutput_events($disabledoutputofmessages=0)
Print formated messages to output (Used to show messages on html output).
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
if(!defined( 'CSRFCHECK_WITH_TOKEN'))
left_menu($menu_array_before, $helppagename='', $notused='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='', $acceptdelayedhtml=0)
Show left menu bar.
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
top_menu_quickadd()
Build the tooltip on top menu quick add.
analyseVarsForSqlAndScriptsInjection(&$var, $type)
Return true if security check on parameters are OK, false otherwise.
top_menu_user($hideloginname=0, $urllogout='')
Build the tooltip on user login.
testSqlAndScriptInject($val, $type)
Security: WAF layer for SQL Injection and XSS Injection (scripts) protection (Filters on GET,...
if(!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) realCharForNumericEntities($matches)
Return the real char for a numeric entities.
main_area($title='')
Begin main area.
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Ouput html header of a page.
getHelpParamFor($helppagename, $langs)
Return helpbaseurl, helppage and mode.
top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $helppagename='')
Show an HTML header + a BODY + The top menu bar.
printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinputname, $accesskey='', $prefhtmlinputname='', $img='', $showtitlebefore=0, $autofocus=0)
Show a search area.
top_menu_search()
Build the tooltip on top menu tsearch.
printDropdownQuickadd()
Generate list of quickadd items.
top_menu_bookmark()
Build the tooltip on top menu bookmark.
div float
Buy price without taxes.
checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $authmode, $context='')
Return a login if login/pass was successfull.
dol_hash($chain, $type='0')
Returns a hash (non reversible encryption) of a string.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.