mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Fix: remove useless code
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -145,7 +145,7 @@ function checkLoginPassEntity($usertotest,$passwordtotest,$entitytotest,$authmod
|
||||
function dol_loginfunction($langs,$conf,$mysoc)
|
||||
{
|
||||
global $dolibarr_main_demo,$db;
|
||||
global $smartphone;
|
||||
global $smartphone,$mc;
|
||||
|
||||
$langcode=(GETPOST('lang')?((is_object($langs)&&$langs->defaultlang)?$langs->defaultlang:'auto'):GETPOST('lang'));
|
||||
$langs->setDefaultLang($langcode);
|
||||
@@ -214,12 +214,12 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
}
|
||||
|
||||
// Entity cookie
|
||||
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY))
|
||||
if (! empty($conf->multicompany->enabled))
|
||||
{
|
||||
$lastuser = '';
|
||||
$lastentity = $_POST['entity'];
|
||||
|
||||
if (! empty($conf->global->MAIN_MULTICOMPANY_COOKIE))
|
||||
if (! empty($conf->global->MULTICOMPANY_COOKIE_ENABLED))
|
||||
{
|
||||
$prefix=dol_getprefix();
|
||||
$entityCookieName = 'DOLENTITYID_'.$prefix;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2008 Matteli
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
@@ -576,7 +576,7 @@ if (! defined('NOLOGIN'))
|
||||
$prefix=dol_getprefix();
|
||||
$entityCookieName = 'DOLENTITYID_'.$prefix;
|
||||
// TTL : is defined in the config page multicompany
|
||||
$ttl = (! empty($conf->global->MULTICOMPANY_COOKIE_TTL) ? $conf->global->MULTICOMPANY_COOKIE_TTL : time()+60*60*8 );
|
||||
$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 : '' );
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <andre.cianfarani@acdeveloppement.net>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
@@ -137,20 +137,6 @@ if (! defined('NOREQUIREDB'))
|
||||
{
|
||||
$conf->entity = GETPOST("entity",'int');
|
||||
}
|
||||
else if (! empty($conf->file->cookie_cryptkey))
|
||||
{
|
||||
$prefix=dol_getprefix();
|
||||
$entityCookieName = 'DOLENTITYID_'.$prefix;
|
||||
if (! empty($_COOKIE[$entityCookieName])) // Just for view specific login page
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT."/core/class/cookie.class.php");
|
||||
$lastuser = ''; $lastentity = '';
|
||||
$entityCookie = new DolCookie($conf->file->cookie_cryptkey);
|
||||
$cookieValue = $entityCookie->_getCookie($entityCookieName);
|
||||
list($lastuser, $lastentity) = explode('|', $cookieValue);
|
||||
$conf->entity = $lastentity;
|
||||
}
|
||||
}
|
||||
|
||||
//print "Will work with data into entity instance number '".$conf->entity."'";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user