diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 67458a66445..15934a32f86 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -300,7 +300,7 @@ if (! defined('NOTOKENRENEWAL')) { // roulement des jetons car cree a chaque appel if (isset($_SESSION['newtoken'])) $_SESSION['token'] = $_SESSION['newtoken']; - + // Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken'] $token = dol_hash(uniqid(mt_rand(),TRUE)); // Generates a hash of a random number $_SESSION['newtoken'] = $token; @@ -659,7 +659,7 @@ if (! defined('NOLOGIN')) unset($_SESSION['lastsearch_values_tmp_'.$relativepathstring]); } } - + $action = ''; $reshook = $hookmanager->executeHooks('updateSession', array(), $user, $action); if ($reshook < 0) { @@ -667,7 +667,7 @@ if (! defined('NOLOGIN')) } } } - + // Is it a new session that has started ? // If we are here, this means authentication was successfull. if (! isset($_SESSION["dol_login"])) @@ -981,7 +981,7 @@ if (! function_exists("llxHeader")) { top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss, $morequerystring, $help_url); } - + if (empty($conf->dol_hide_leftmenu)) { left_menu('', $help_url, '', '', 1, $title, 1); @@ -1011,13 +1011,13 @@ function top_httphead($contenttype='text/html') if (! empty($conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY)) { // For example, to restrict script, object, frames or img to some domains - // script-src https://api.google.com https://anotherhost.com; object-src https://youtube.com; child-src https://youtube.com; img-src: https://static.example.com + // script-src https://api.google.com https://anotherhost.com; object-src https://youtube.com; child-src https://youtube.com; img-src: https://static.example.com // For example, to restrict everything to one domain, except object, ... // default-src https://cdn.example.net; object-src 'none' header("Content-Security-Policy: ".$conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY); } - - + + // On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1. /*if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); @@ -1085,7 +1085,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs $ext='version='.urlencode(DOL_VERSION); if (GETPOST('version','int')) $ext='version='.GETPOST('version','int'); // usefull to force no cache on css/js if (GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)) $ext.='&testmenuhider='.(GETPOST('testmenuhider','int')?GETPOST('testmenuhider','int'):$conf->global->MAIN_TESTMENUHIDER); - + $themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss','aZ09')?'&optioncss='.GETPOST('optioncss','aZ09',1):'').'&userid='.$user->id.'&entity='.$conf->entity; $themeparam.=($ext?'&'.$ext:''); if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache']; @@ -1094,7 +1094,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs if (GETPOST('dol_optimize_smallscreen','int')) { $themeparam.='&dol_optimize_smallscreen='.GETPOST('dol_optimize_smallscreen','int'); } if (GETPOST('dol_no_mouse_hover','int')) { $themeparam.='&dol_no_mouse_hover='.GETPOST('dol_no_mouse_hover','int'); } if (GETPOST('dol_use_jmobile','int')) { $themeparam.='&dol_use_jmobile='.GETPOST('dol_use_jmobile','int'); $conf->dol_use_jmobile=GETPOST('dol_use_jmobile','int'); } - + if (! defined('DISABLE_JQUERY') && ! $disablejs && $conf->use_javascript_ajax) { print ''."\n"; @@ -1122,13 +1122,13 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; } } - + if (! defined('DISABLE_FONT_AWSOME')) { print ''."\n"; print ''."\n"; } - + print ''."\n"; // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' $themepath=dol_buildpath($conf->css,1); @@ -1293,7 +1293,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; print ''."\n"; } - + // Browser notifications if (! defined('DISABLE_BROWSER_NOTIF')) { @@ -1306,7 +1306,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; } } - + // Global js function print ''."\n"; print ''."\n"; @@ -1316,7 +1316,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs { print ''."\n"; } - + // JS forced by modules (relative url starting with /) if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2')) { @@ -1391,7 +1391,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $toprightmenu=''; // For backward compatibility with old modules - if (empty($conf->headerdone)) + if (empty($conf->headerdone)) { top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); print ''; @@ -1403,7 +1403,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a if (empty($conf->dol_hide_topmenu) && (! defined('NOREQUIREMENU') || ! constant('NOREQUIREMENU'))) { print "\n".''."\n"; - + print '
'; // Show menu entries @@ -1461,7 +1461,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $toprightmenu.='
'; $toprightmenu.='
'; - + // Execute hook printTopRightMenu (hooks should output string like '') $parameters=array(); $result=$hookmanager->executeHooks('printTopRightMenu',$parameters); // Note that $action and $object may have been modified by some hooks @@ -1548,7 +1548,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a print '
'; //unset($form); - + print '
'; print "\n\n"; } @@ -1693,7 +1693,7 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra if (preg_match('/de/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.de'; if (preg_match('/it/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.it'; if (preg_match('/gr/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.gr'; - + $appli=constant('DOL_APPLICATION_TITLE'); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) { @@ -1778,7 +1778,7 @@ function main_area($title='') print "\n"; print ''."\n".'
'."\n"; - + if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) print info_admin($langs->trans("WarningYouAreInMaintenanceMode",$conf->global->MAIN_ONLY_LOGIN_ALLOWED)); } @@ -1908,7 +1908,7 @@ if (! function_exists("llxFooter")) { if (empty($val['sortfield'])) unset($val['sortfield']); if (empty($val['sortorder'])) unset($val['sortorder']); - dol_syslog('Save lastsearch_values_tmp_'.$key.'='.json_encode($val, 0, 1)." (systematic recording of last search criteria)"); + dol_syslog('Save lastsearch_values_tmp_'.$key.'='.json_encode($val, 0)." (systematic recording of last search criteria)"); $_SESSION['lastsearch_values_tmp_'.$key]=json_encode($val); unset($_SESSION['lastsearch_values_'.$key]); } @@ -1935,7 +1935,7 @@ if (! function_exists("llxFooter")) } print "\n\n"; - + print '
'."\n"; // End div fiche if (empty($conf->dol_hide_leftmenu)) print ' '; // End div id-right @@ -1970,7 +1970,7 @@ if (! function_exists("llxFooter")) }); ' . "\n"; } - + // Wrapper to manage document_preview if (! empty($conf->use_javascript_ajax) && ($conf->browser->layout != 'phone')) { @@ -1985,7 +1985,7 @@ if (! function_exists("llxFooter")) }); ' . "\n"; } - + // Wrapper to manage dropdown if ($conf->use_javascript_ajax) { @@ -2016,7 +2016,7 @@ if (! function_exists("llxFooter")) console.log("Link has class dropdowncloseonclick, so we close/hide the popup ul"); $(this).parent().parent().hide(); }); - + $(document).bind(\'click\', function (e) { var $clicked = $(e.target); if (!$clicked.parents().hasClass("dropdown")) $(".dropdown dd ul").hide(); @@ -2024,7 +2024,7 @@ if (! function_exists("llxFooter")) }); '; } - + // A div for the address popup print "\n\n"; print ''."\n";