Fix: issue during upgrade of MAIN_VERSION_LAST_UPGRADE (rc -> rc2)
This commit is contained in:
parent
215b24df54
commit
e9ac41fb24
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
@ -62,18 +62,22 @@ function versioncompare($versionarray1,$versionarray2)
|
||||
{
|
||||
$operande1=isset($versionarray1[$level])?$versionarray1[$level]:0;
|
||||
$operande2=isset($versionarray2[$level])?$versionarray2[$level]:0;
|
||||
if (preg_match('/alpha|dev/i',$operande1)) $operande1=-3;
|
||||
if (preg_match('/alpha|dev/i',$operande2)) $operande2=-3;
|
||||
if (preg_match('/beta/i',$operande1)) $operande1=-2;
|
||||
if (preg_match('/beta/i',$operande2)) $operande2=-2;
|
||||
if (preg_match('/rc/i',$operande1)) $operande1=-1;
|
||||
if (preg_match('/rc/i',$operande2)) $operande2=-1;
|
||||
if (preg_match('/alpha|dev/i',$operande1)) $operande1=-5;
|
||||
if (preg_match('/alpha|dev/i',$operande2)) $operande2=-5;
|
||||
if (preg_match('/beta$/i',$operande1)) $operande1=-4;
|
||||
if (preg_match('/beta$/i',$operande2)) $operande2=-4;
|
||||
if (preg_match('/beta([0-9])*/i',$operande1)) $operande1=-3;
|
||||
if (preg_match('/beta([0-9])*/i',$operande2)) $operande2=-3;
|
||||
if (preg_match('/rc$/i',$operande1)) $operande1=-2;
|
||||
if (preg_match('/rc$/i',$operande2)) $operande2=-2;
|
||||
if (preg_match('/rc([0-9])*/i',$operande1)) $operande1=-1;
|
||||
if (preg_match('/rc([0-9])*/i',$operande2)) $operande2=-1;
|
||||
$level++;
|
||||
//print 'level '.$level.' '.$operande1.'-'.$operande2.'<br>';
|
||||
print 'level '.$level.' '.$operande1.'-'.$operande2.'<br>';
|
||||
if ($operande1 < $operande2) { $ret = -$level; break; }
|
||||
if ($operande1 > $operande2) { $ret = $level; break; }
|
||||
}
|
||||
//print join('.',$versionarray1).'('.count($versionarray1).') / '.join('.',$versionarray2).'('.count($versionarray2).') => '.$ret.'<br>'."\n";
|
||||
print join('.',$versionarray1).'('.count($versionarray1).') / '.join('.',$versionarray2).'('.count($versionarray2).') => '.$ret.'<br>'."\n";
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@ -591,7 +595,7 @@ function listOfSessions()
|
||||
$sessValues = file_get_contents($fullpath); // get raw session data
|
||||
// Example of possible value
|
||||
//$sessValues = 'newtoken|s:32:"1239f7a0c4b899200fe9ca5ea394f307";dol_loginmesg|s:0:"";newtoken|s:32:"1236457104f7ae0f328c2928973f3cb5";dol_loginmesg|s:0:"";token|s:32:"123615ad8d650c5cc4199b9a1a76783f";dol_login|s:5:"admin";dol_authmode|s:8:"dolibarr";dol_tz|s:1:"1";dol_tz_string|s:13:"Europe/Berlin";dol_dst|i:0;dol_dst_observed|s:1:"1";dol_dst_first|s:0:"";dol_dst_second|s:0:"";dol_screenwidth|s:4:"1920";dol_screenheight|s:3:"971";dol_company|s:12:"MyBigCompany";dol_entity|i:1;mainmenu|s:4:"home";leftmenuopened|s:10:"admintools";idmenu|s:0:"";leftmenu|s:10:"admintools";';
|
||||
|
||||
|
||||
if (preg_match('/dol_login/i',$sessValues) && // limit to dolibarr session
|
||||
(preg_match('/dol_entity\|i:'.$conf->entity.';/i',$sessValues) || preg_match('/dol_entity\|s:([0-9]+):"'.$conf->entity.'"/i',$sessValues)) && // limit to current entity
|
||||
preg_match('/dol_company\|s:([0-9]+):"('.$conf->global->MAIN_INFO_SOCIETE_NOM.')"/i',$sessValues)) // limit to company name
|
||||
|
||||
Loading…
Reference in New Issue
Block a user