diff --git a/core/userrights.class.inc.php b/core/userrights.class.inc.php index 23151b2080..aeea4fa20c 100644 --- a/core/userrights.class.inc.php +++ b/core/userrights.class.inc.php @@ -1962,6 +1962,15 @@ class UserRights return self::$m_aCacheUsers[$sAuthentication][$sLogin]; } + /** + * Reset the cache of users + * @return void + */ + public static function ResetCacheUsers() + { + self::$m_aCacheUsers = [ 'internal' => [], 'external' => [] ]; + } + /** * @param string$sClass * @param array $aAllowedOrgs diff --git a/datamodels/2.x/itop-attachments/module.itop-attachments.php b/datamodels/2.x/itop-attachments/module.itop-attachments.php index 06480eab35..b383836b4a 100644 --- a/datamodels/2.x/itop-attachments/module.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/module.itop-attachments.php @@ -204,7 +204,7 @@ SQL; } SetupLog::Info("Initializing attachment/item_org_id - $iUpdated records have been adjusted"); - if (MetaModel::GetAttributeDef('Attachment', 'contact_id') instanceof AttributeExternalKey) { + if (MetaModel::GetAttributeDef('Attachment', 'contact_id') instanceof AttributeExternalKey && version_compare($sPreviousVersion, '3.2.0', '<')) { SetupLog::Info("Upgrading itop-attachment from '$sPreviousVersion' to '$sCurrentVersion'. Starting with 3.2.0, contact_id will be added into the DB..."); $sUserTableName = MetaModel::DBGetTable('User'); $sUserFieldContactId = MetaModel::GetAttributeDef('User', 'contactid')->Get('sql');