From 700470dd29caf001c48f46d07a97bd9cc355141b Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Fri, 11 Jul 2025 10:28:24 +0200 Subject: [PATCH 1/2] =?UTF-8?q?N=C2=B08219=20-=20Allow=20to=20reset=20user?= =?UTF-8?q?=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/userrights.class.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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 From 1438006861b1c5a7b5ae502528208d22e1a3a731 Mon Sep 17 00:00:00 2001 From: Benjamin Dalsass Date: Wed, 16 Jul 2025 09:35:19 +0200 Subject: [PATCH 2/2] =?UTF-8?q?N=C2=B08419=20-=20Improve=20Setup=20process?= =?UTF-8?q?=20by=20avoiding=20the=20update=20of=20the=20attachment=20table?= =?UTF-8?q?=20when=20contact=5Fid=20is=20already=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- datamodels/2.x/itop-attachments/module.itop-attachments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datamodels/2.x/itop-attachments/module.itop-attachments.php b/datamodels/2.x/itop-attachments/module.itop-attachments.php index 54489c1b3d..6c097cc577 100644 --- a/datamodels/2.x/itop-attachments/module.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/module.itop-attachments.php @@ -201,7 +201,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');