N890.3 Archive mode toggle menu not visible after setup/MTP: the information is cached into the session and needs to be reset

SVN:trunk[4870]
This commit is contained in:
Romain Quetiez
2017-08-21 15:28:07 +00:00
parent 0655904683
commit b1494d0dd9
4 changed files with 23 additions and 7 deletions

View File

@@ -155,7 +155,10 @@ class utils
}
// Read and record the value for switching the archive mode
$iCurrent = self::ReadParam('with-archive', $iDefault);
$_SESSION['archive_mode'] = $iCurrent;
if (isset($_SESSION))
{
$_SESSION['archive_mode'] = $iCurrent;
}
// Read and use the value for the current page (web services)
$iCurrent = self::ReadParam('with_archive', $iCurrent, true);
self::$bPageMode = ($iCurrent == 1);

View File

@@ -5261,20 +5261,26 @@ abstract class MetaModel
public static function ResetCache($sEnvironmentId = null)
{
if (!function_exists('apc_delete')) return;
if (is_null($sEnvironmentId))
{
$sEnvironmentId = MetaModel::GetEnvironmentId();
}
$sAppIdentity = 'itop-'.$sEnvironmentId;
require_once(APPROOT.'/core/dict.class.inc.php');
Dict::ResetCache($sAppIdentity);
foreach(self::GetCacheEntries($sEnvironmentId) as $sKey => $aAPCInfo)
if (function_exists('apc_delete'))
{
$sAPCKey = $aAPCInfo['info'];
apc_delete($sAPCKey);
foreach (self::GetCacheEntries($sEnvironmentId) as $sKey => $aAPCInfo)
{
$sAPCKey = $aAPCInfo['info'];
apc_delete($sAPCKey);
}
}
require_once(APPROOT.'core/userrights.class.inc.php');
UserRights::FlushPrivileges();
}
/**

View File

@@ -1152,8 +1152,16 @@ class UserRights
self::$m_aAdmins = array();
self::$m_aPortalUsers = array();
}
if (!isset($_SESSION))
{
session_name('itop-'.md5(APPROOT));
session_start();
}
self::_ResetSessionCache();
return self::$m_oAddOn->FlushPrivileges();
if (self::$m_oAddOn)
{
self::$m_oAddOn->FlushPrivileges();
}
}
static $m_aCacheUsers;

View File

@@ -505,7 +505,6 @@ class RunTimeEnvironment
SetupUtils::builddir($sCacheDir);
SetupUtils::tidydir($sCacheDir);
require_once(APPROOT.'/core/dict.class.inc.php');
MetaModel::ResetCache(md5(APPROOT).'-'.$this->sTargetEnv);
}
}