mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 10:21:32 +01:00
Fix trackid must contains an id of instance
This commit is contained in:
@@ -610,9 +610,9 @@ if (! function_exists('dol_getprefix'))
|
||||
{
|
||||
/**
|
||||
* Return a prefix to use for this Dolibarr instance, for session/cookie names or email id.
|
||||
* This prefix is valid in a web context only and is unique for instance and avoid conflict
|
||||
* between multi-instances, even when having two instances with one root dir or two instances
|
||||
* in virtual servers.
|
||||
* The prefix for session is unique in a web context only and is unique for instance and avoid conflict
|
||||
* between multi-instances, even when having two instances with one root dir or two instances in virtual servers.
|
||||
* The prefix for email is unique if MAIL_PREFIX_FOR_EMAIL_ID is set to a value, otherwise value may be same than other instance.
|
||||
*
|
||||
* @param string $mode '' (prefix for session name) or 'email' (prefix for email id)
|
||||
* @return string A calculated prefix
|
||||
@@ -621,11 +621,15 @@ if (! function_exists('dol_getprefix'))
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// If MAIL_PREFIX_FOR_EMAIL_ID is set and prefix is for email
|
||||
if ($mode == 'email' && ! empty($conf->global->MAIL_PREFIX_FOR_EMAIL_ID))
|
||||
// If prefix is for email
|
||||
if ($mode == 'email')
|
||||
{
|
||||
if ($conf->global->MAIL_PREFIX_FOR_EMAIL_ID != 'SERVER_NAME') return $conf->global->MAIL_PREFIX_FOR_EMAIL_ID;
|
||||
else if (isset($_SERVER["SERVER_NAME"])) return $_SERVER["SERVER_NAME"];
|
||||
if (! empty($conf->global->MAIL_PREFIX_FOR_EMAIL_ID)) // If MAIL_PREFIX_FOR_EMAIL_ID is set (a value initialized with a random value is recommended)
|
||||
{
|
||||
if ($conf->global->MAIL_PREFIX_FOR_EMAIL_ID != 'SERVER_NAME') return $conf->global->MAIL_PREFIX_FOR_EMAIL_ID;
|
||||
else if (isset($_SERVER["SERVER_NAME"])) return $_SERVER["SERVER_NAME"];
|
||||
}
|
||||
return dol_hash(DOL_DOCUMENT_ROOT.DOL_URL_ROOT);
|
||||
}
|
||||
|
||||
if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["DOCUMENT_ROOT"]))
|
||||
@@ -634,7 +638,7 @@ if (! function_exists('dol_getprefix'))
|
||||
// Use this for a "readable" cookie name
|
||||
//return dol_sanitizeFileName($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT);
|
||||
}
|
||||
else return dol_hash(DOL_DOCUMENT_ROOT.DOL_URL_ROOT);
|
||||
return dol_hash(DOL_DOCUMENT_ROOT.DOL_URL_ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user