Skip to content
Snippets Groups Projects
Commit b25d2ff0 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop

Conflicts:
	htdocs/main.inc.php
parents 0a2bafaa 0cbf92c7
No related branches found
No related tags found
No related merge requests found
...@@ -611,7 +611,7 @@ if (! defined('NOLOGIN')) ...@@ -611,7 +611,7 @@ if (! defined('NOLOGIN'))
exit; exit;
} }
else else
{ {
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('main')); $hookmanager->initHooks(array('main'));
...@@ -656,28 +656,6 @@ if (! defined('NOLOGIN')) ...@@ -656,28 +656,6 @@ if (! defined('NOLOGIN'))
$user->update_last_login_date(); $user->update_last_login_date();
// Create entity cookie, just used for login page
// TODO Multicompany Move this into hook
if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_COOKIE_ENABLED) && isset($_POST["entity"]))
{
dol_syslog("You are using a bugged version of a module using deprecated code instead that should be located into the hook 'afterLogin' instead", LOG_WARNING);
include_once DOL_DOCUMENT_ROOT.'/core/class/cookie.class.php';
$entity = $_SESSION["dol_login"].'|'.$_POST["entity"];
$prefix=dol_getprefix();
$entityCookieName = 'DOLENTITYID_'.$prefix;
// TTL : is defined in the config page multicompany
$ttl = (! empty($conf->global->MULTICOMPANY_COOKIE_TTL) ? dol_now()+$conf->global->MULTICOMPANY_COOKIE_TTL : dol_now()+60*60*8 );
// Cryptkey : will be created randomly in the config page multicompany
$cryptkey = (! empty($conf->file->cookie_cryptkey) ? $conf->file->cookie_cryptkey : '' );
$entityCookie = new DolCookie($cryptkey);
$entityCookie->_setCookie($entityCookieName, $entity, $ttl);
}
$loginfo = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"]; $loginfo = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"];
$user->trigger_mesg = $loginfo; $user->trigger_mesg = $loginfo;
...@@ -869,18 +847,6 @@ else ...@@ -869,18 +847,6 @@ else
$heightforframes=52; $heightforframes=52;
// Switch to another entity
// TODO Multicompany Remove this
if (! empty($conf->multicompany->enabled) && GETPOST('action') == 'switchentity')
{
if ($mc->switchEntity(GETPOST('entity','int')) > 0)
{
header("Location: ".DOL_URL_ROOT.'/');
exit;
}
}
// Init menu manager // Init menu manager
if (! defined('NOREQUIREMENU')) if (! defined('NOREQUIREMENU'))
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment