Fix parameter session_cache_limiter

This commit is contained in:
Laurent Destailleur
2018-12-18 15:06:00 +01:00
parent c3eb131054
commit 57c41bac56
10 changed files with 28 additions and 34 deletions

View File

@@ -29,14 +29,14 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
session_cache_limiter(false);
session_cache_limiter('public');
require_once '../../main.inc.php';
// Define javascript type
top_httphead('text/javascript; charset=UTF-8');
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
else header('Cache-Control: no-cache');
//var_dump($conf);

View File

@@ -33,14 +33,14 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
session_cache_limiter(false);
session_cache_limiter('public');
require_once '../../main.inc.php';
// Define javascript type
top_httphead('text/javascript; charset=UTF-8');
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
else header('Cache-Control: no-cache');
?>

View File

@@ -32,14 +32,14 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
session_cache_limiter(false);
session_cache_limiter('public');
require_once '../../main.inc.php';
// Define javascript type
top_httphead('text/javascript; charset=UTF-8');
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
else header('Cache-Control: no-cache');

View File

@@ -40,7 +40,7 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
// TODO Try to make a solution with only a javascript timer that is easier. Difficulty is to avoid notification twice when.
/* session already started into main
session_cache_limiter(false);
session_cache_limiter('public');
header('Cache-Control: no-cache');
session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie
session_start();*/

View File

@@ -29,14 +29,14 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
session_cache_limiter(false);
session_cache_limiter('public');
require_once '../../main.inc.php';
// Define javascript type
top_httphead('text/javascript; charset=UTF-8');
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
else header('Cache-Control: no-cache');
?>

View File

@@ -48,7 +48,9 @@ if (! $res) die("Include of main fails");
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
session_cache_limiter(false);
session_cache_limiter('public');
// false or '' = keep cache instruction added by server
// 'public' = remove cache instruction added by server and if no cache-control added later, a default cache delay (10800) will be added by PHP.
// Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS
/*if (empty($user->id) && ! empty($_SESSION['dol_login']))
@@ -62,7 +64,7 @@ session_cache_limiter(false);
header('Content-type: text/css');
// Important: Following code is to cache this file to avoid page request by browser at each Dolibarr page access.
// You can use CTRL+F5 to refresh your browser cache.
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
else header('Cache-Control: no-cache');
?>

View File

@@ -61,7 +61,7 @@ if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) {
} else {
print '<div style="margin: 0 auto; width:60%">';
print '<p style="text-align: center">' . ($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")) . '</p>';
print '<div class="corps">';
print '<div class="ticketform">';
print '<div class="index_create"><a href="create_ticket.php" class="button orange bigrounded"><strong>&nbsp;' . dol_escape_htmltag($langs->trans("CreateTicket")) . '</strong></a></div>';
print '<div class="index_display"><a href="list.php" class="button blue bigrounded"><strong>&nbsp;' . dol_escape_htmltag($langs->trans("ShowListTicketWithTrackId")) . '</strong></a></div>';
print '<div class="index_display"><a href="view.php" class="button blue bigrounded"><strong>&nbsp;' . dol_escape_htmltag($langs->trans("ShowTicketWithTrackId")) . '</strong></a></div>';

View File

@@ -59,7 +59,7 @@ $fontsizesmaller='0.75em';
if (defined('THEME_ONLY_CONSTANT')) return;
session_cache_limiter(false);
session_cache_limiter('public');
require_once '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
@@ -71,7 +71,7 @@ if (empty($user->id) && ! empty($_SESSION['dol_login'])) $user->fetch('',$_SESSI
// Define css type
top_httphead('text/css');
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
if (!empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
else header('Cache-Control: no-cache');
if (GETPOST('theme','alpha')) $conf->theme=GETPOST('theme','alpha'); // If theme was forced on URL

View File

@@ -60,7 +60,7 @@ $fontsizesmaller='11';
if (defined('THEME_ONLY_CONSTANT')) return;
session_cache_limiter(false);
session_cache_limiter('public');
require_once '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
@@ -72,7 +72,7 @@ if (empty($user->id) && ! empty($_SESSION['dol_login'])) $user->fetch('',$_SESSI
// Define css type
top_httphead('text/css');
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
else header('Cache-Control: no-cache');
if (GETPOST('theme','alpha')) $conf->theme=GETPOST('theme','alpha'); // If theme was forced on URL

View File

@@ -56,14 +56,8 @@ if (! empty($conf->global->TICKET_SHOW_MODULE_LOGO)) {
?>
}
body {
font-size: 0.88em;
background: none;
min-height: 600px;
/*padding-bottom:150px;*/
}
div.corps {
div.ticketform {
font-family: arial;
position: static;
padding: 2em 1em;
@@ -78,13 +72,13 @@ div.corps {
}
.index_create, .index_display {
div.ticketform .index_create, .index_display {
float: left;
width: 33%;
text-align: center;
}
.orange {
div.ticketform .orange {
color: #fef4e9;
border: solid 1px #da7c0c;
background: #f78d1d;
@@ -92,22 +86,21 @@ div.corps {
background: -moz-linear-gradient(top, #faa51a, #f47a20);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#faa51a', endColorstr='#f47a20');
}
.orange:active {
div.ticketform .orange:active {
color: #fcd3a5;
background: -webkit-gradient(linear, left top, left bottom, from(#f47a20), to(#faa51a));
background: -moz-linear-gradient(top, #f47a20, #faa51a);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f47a20', endColorstr='#faa51a');
}
.orange:hover {
div.ticketform .orange:hover {
background: #f47c20;
background: -webkit-gradient(linear, left top, left bottom, from(#f88e11), to(#f06015));
background: -moz-linear-gradient(top, #f88e11, #f06015);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f88e11', endColorstr='#f06015');
}
.blue {
div.ticketform .blue {
color: #d9eef7;
border: solid 1px #0076a3;
background: #0095cd;
@@ -115,22 +108,21 @@ div.corps {
background: -moz-linear-gradient(top, #00adee, #0078a5);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5');
}
.blue:active {
div.ticketform .blue:active {
color: #80bed6;
background: -webkit-gradient(linear, left top, left bottom, from(#0078a5), to(#00adee));
background: -moz-linear-gradient(top, #0078a5, #00adee);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0078a5', endColorstr='#00adee');
}
.blue:hover {
div.ticketform .blue:hover {
background: #007ead;
background: -webkit-gradient(linear, left top, left bottom, from(#0095cc), to(#00678e));
background: -moz-linear-gradient(top, #0095cc, #00678e);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0095cc', endColorstr='#00678e');
}
#form_create_ticket,
#form_view_ticket {
#form_create_ticket, #form_view_ticket
{
margin-left: 10px;
margin-right: 10px;
padding-left:1em;