Skip to content
Snippets Groups Projects
Commit b3013401 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: limit to dolibarr session and current entity

parent f8c8df10
No related branches found
No related tags found
No related merge requests found
......@@ -496,6 +496,8 @@ function listOfSessions()
*/
function purgeSessions($mysessionid)
{
global $conf;
$arrayofSessions = array();
$sessPath = ini_get("session.save_path")."/";
dol_syslog('admin.lib:purgeSessions mysessionid='.$mysessionid.' sessPath='.$sessPath);
......@@ -508,6 +510,10 @@ function purgeSessions($mysessionid)
{
$fullpath = $sessPath.$file;
if(! @is_dir($fullpath))
{
$sessValues = file_get_contents($fullpath); // get raw session data
if (eregi('dol_login',$sessValues) && eregi('dol_entity\|s:([0-9]+):"('.$conf->entity.')"',$sessValues)) // limit to dolibarr session and current entity
{
$tmp=split('_', $file);
$idsess=$tmp[1];
......@@ -520,6 +526,7 @@ function purgeSessions($mysessionid)
}
}
}
}
@closedir($dh);
if (! $error) return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment